From e554caf425090387ad60d202741dda02abd88a9d Mon Sep 17 00:00:00 2001 From: Shane Fournier <93808768+win32ss@users.noreply.github.com> Date: Wed, 26 Jul 2023 23:04:22 +0000 Subject: [PATCH 01/93] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c8c137672061e..d30c8483bccac 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +This is a custom build of the Electron framework based on the Supermium browser codebase, coming soon. This will be used to run Electron-based web applications that otherwise require Electron binaries that are incompatible with Windows Vista/7/8.x. Instructions for end-users will be provided once the project is stabilized. The original readme follows below. + [![Electron Logo](https://electronjs.org/images/electron-logo.svg)](https://electronjs.org) [![CircleCI Build Status](https://circleci.com/gh/electron/electron/tree/main.svg?style=shield)](https://circleci.com/gh/electron/electron/tree/main) From 8f5c9efa0882c48a7d1494cae8b5e3c7dbc8c5da Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 26 Jul 2023 22:10:58 -0700 Subject: [PATCH 02/93] fix: do not resolve electron entrypoints on disk (#39247) --- patches/node/.patches | 1 + ..._do_not_resolve_electron_entrypoints.patch | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 patches/node/fix_do_not_resolve_electron_entrypoints.patch diff --git a/patches/node/.patches b/patches/node/.patches index dab529ec70d62..5b0d4b546ad02 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -37,3 +37,4 @@ chore_remove_--no-harmony-atomics_related_code.patch fix_account_for_createexternalizablestring_v8_global.patch fix_wunreachable-code_warning_in_ares_init_rand_engine.patch fix_-wshadow_warning.patch +fix_do_not_resolve_electron_entrypoints.patch diff --git a/patches/node/fix_do_not_resolve_electron_entrypoints.patch b/patches/node/fix_do_not_resolve_electron_entrypoints.patch new file mode 100644 index 0000000000000..8d700b8fab6b3 --- /dev/null +++ b/patches/node/fix_do_not_resolve_electron_entrypoints.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Samuel Attard +Date: Wed, 26 Jul 2023 17:03:15 -0700 +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/run_main.js b/lib/internal/modules/run_main.js +index 5a50d5d6afab6e6648f72a1c0efa1df4cd80bcd9..0be45309028b00a6957ee473322a9452a7fa7d67 100644 +--- a/lib/internal/modules/run_main.js ++++ b/lib/internal/modules/run_main.js +@@ -13,6 +13,12 @@ const { + } = require('internal/modules/esm/handle_process_exit'); + + function resolveMainPath(main) { ++ // For built-in modules used as the main entry point we _never_ ++ // want to waste cycles resolving them to file paths on disk ++ // that actually might exist ++ if (typeof main === 'string' && main.startsWith('electron/js2c')) { ++ return main; ++ } + // Note extension resolution for the main entry point can be deprecated in a + // future major. + // Module._findPath is monkey-patchable here. From 2557bc88a769d6a193f2fefaff1c0db5180ee45f Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 27 Jul 2023 16:53:45 +0200 Subject: [PATCH 03/93] refactor: use optional catch binding (#39232) --- spec/api-app-spec.ts | 2 +- spec/api-auto-updater-spec.ts | 4 ++-- spec/api-crash-reporter-spec.ts | 4 ++-- spec/api-debugger-spec.ts | 2 +- spec/api-net-log-spec.ts | 2 +- spec/api-process-spec.ts | 4 ++-- spec/api-protocol-spec.ts | 6 +++--- spec/api-web-contents-spec.ts | 2 +- spec/fixtures/api/default-menu/main.js | 4 ++-- spec/fixtures/module/echo-renamed.js | 2 +- spec/webview-spec.ts | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/spec/api-app-spec.ts b/spec/api-app-spec.ts index 79c3388cb1fec..87b6e616484f8 100644 --- a/spec/api-app-spec.ts +++ b/spec/api-app-spec.ts @@ -345,7 +345,7 @@ describe('app module', () => { expectedAdditionalData: undefined }); assert(false); - } catch (e) { + } catch { // This is expected. } }); diff --git a/spec/api-auto-updater-spec.ts b/spec/api-auto-updater-spec.ts index ec0da4b9bd450..e558dbf517557 100644 --- a/spec/api-auto-updater-spec.ts +++ b/spec/api-auto-updater-spec.ts @@ -32,7 +32,7 @@ ifdescribe(!process.mas)('autoUpdater module', function () { const url = 'http://electronjs.org'; try { (autoUpdater.setFeedURL as any)(url, { header: 'val' }); - } catch (err) { /* ignore */ } + } catch { /* ignore */ } expect(autoUpdater.getFeedURL()).to.equal(url); }); @@ -44,7 +44,7 @@ ifdescribe(!process.mas)('autoUpdater module', function () { const url = 'http://mymagicurl.local'; try { autoUpdater.setFeedURL({ url }); - } catch (err) { /* ignore */ } + } catch { /* ignore */ } expect(autoUpdater.getFeedURL()).to.equal(url); }); diff --git a/spec/api-crash-reporter-spec.ts b/spec/api-crash-reporter-spec.ts index e7232573dfde5..bc7afe2cddf8c 100644 --- a/spec/api-crash-reporter-spec.ts +++ b/spec/api-crash-reporter-spec.ts @@ -116,7 +116,7 @@ function waitForNewFileInDir (dir: string): Promise { function readdirIfPresent (dir: string): string[] { try { return fs.readdirSync(dir); - } catch (e) { + } catch { return []; } } @@ -402,7 +402,7 @@ ifdescribe(!isLinuxOnArm && !process.mas && !process.env.DISABLE_CRASH_REPORTER_ try { fs.rmdirSync(dir, { recursive: true }); fs.mkdirSync(dir); - } catch (e) { /* ignore */ } + } catch { /* ignore */ } // 1. start the crash reporter. await remotely((port: number) => { diff --git a/spec/api-debugger-spec.ts b/spec/api-debugger-spec.ts index 311b7ec6c6733..057f39e418465 100644 --- a/spec/api-debugger-spec.ts +++ b/spec/api-debugger-spec.ts @@ -32,7 +32,7 @@ describe('debugger module', () => { it('fails when protocol version is not supported', done => { try { w.webContents.debugger.attach('2.0'); - } catch (err) { + } catch { expect(w.webContents.debugger.isAttached()).to.be.false(); done(); } diff --git a/spec/api-net-log-spec.ts b/spec/api-net-log-spec.ts index eb5957e825876..fc570f2297598 100644 --- a/spec/api-net-log-spec.ts +++ b/spec/api-net-log-spec.ts @@ -55,7 +55,7 @@ describe('netLog module', () => { if (fs.existsSync(dumpFileDynamic)) { fs.unlinkSync(dumpFileDynamic); } - } catch (e) { + } catch { // Ignore error } expect(testNetLog().currentlyLogging).to.be.false('currently logging'); diff --git a/spec/api-process-spec.ts b/spec/api-process-spec.ts index a5d1326a661b1..7ae874c7fea2a 100644 --- a/spec/api-process-spec.ts +++ b/spec/api-process-spec.ts @@ -99,7 +99,7 @@ describe('process module', () => { defer(() => { try { fs.unlinkSync(filePath); - } catch (e) { + } catch { // ignore error } }); @@ -211,7 +211,7 @@ describe('process module', () => { defer(() => { try { fs.unlinkSync(filePath); - } catch (e) { + } catch { // ignore error } }); diff --git a/spec/api-protocol-spec.ts b/spec/api-protocol-spec.ts index 90b07b7074222..72dfe18fe89db 100644 --- a/spec/api-protocol-spec.ts +++ b/spec/api-protocol-spec.ts @@ -104,7 +104,7 @@ describe('protocol module', () => { try { callback(text); callback(''); - } catch (error) { + } catch { // Ignore error } }); @@ -557,7 +557,7 @@ describe('protocol module', () => { try { callback(text); callback(''); - } catch (error) { + } catch { // Ignore error } }); @@ -1106,7 +1106,7 @@ describe('protocol module', () => { // In case of failure, make sure we unhandle. But we should succeed // :) protocol.unhandle('test-scheme'); - } catch (_ignored) { /* ignore */ } + } catch { /* ignore */ } }); const resp1 = await net.fetch('test-scheme://foo'); expect(resp1.status).to.equal(200); diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index 7445111b632e7..aeb2a11349882 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -1786,7 +1786,7 @@ describe('webContents module', () => { const cleanup = () => { try { fs.unlinkSync(filePath); - } catch (e) { + } catch { // ignore error } }; diff --git a/spec/fixtures/api/default-menu/main.js b/spec/fixtures/api/default-menu/main.js index 16e84badc9136..28cad7a2936bc 100644 --- a/spec/fixtures/api/default-menu/main.js +++ b/spec/fixtures/api/default-menu/main.js @@ -22,11 +22,11 @@ try { setImmediate(() => { try { output(Menu.getApplicationMenu() === expectedMenu); - } catch (error) { + } catch { output(null); } }); }); -} catch (error) { +} catch { output(null); } diff --git a/spec/fixtures/module/echo-renamed.js b/spec/fixtures/module/echo-renamed.js index 6dfa05f914a3c..d81f922c21f67 100644 --- a/spec/fixtures/module/echo-renamed.js +++ b/spec/fixtures/module/echo-renamed.js @@ -1,7 +1,7 @@ let echo; try { echo = require('@electron-ci/echo'); -} catch (e) { +} catch { process.exit(1); } process.exit(echo(0)); diff --git a/spec/webview-spec.ts b/spec/webview-spec.ts index 51c2ab952ba63..06ad8c527f1cc 100644 --- a/spec/webview-spec.ts +++ b/spec/webview-spec.ts @@ -2032,7 +2032,7 @@ describe(' tag', function () { // Values can be 0,2,3,4, or 6. We want 6, which is RGB + Alpha expect(imgBuffer[25]).to.equal(6); return; - } catch (e) { + } catch { /* drop the error */ } } From 2bcb25eb1f6448ee7e8d85ec9b14ce132505a9c7 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 28 Jul 2023 10:48:25 +0200 Subject: [PATCH 04/93] fix: `pageVisibility` state when `backgroundThrottling` disabled (#39223) fix: pageVisibility state when backgroundThrottling disabled --- ..._scheduler_throttling_per_renderview.patch | 60 ++++++++++++++++--- .../extend_apply_webpreferences.patch | 2 +- spec/api-browser-window-spec.ts | 19 +++--- spec/disabled-tests.json | 1 - spec/fixtures/pages/visibilitychange.html | 6 +- 5 files changed, 63 insertions(+), 25 deletions(-) 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 5f773163dcd12..cb2aae3ac228e 100644 --- a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch +++ b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch @@ -33,6 +33,21 @@ index 180abdc9f983887c83fd9d4a596472222e9ab472..00842717a7570561ee9e3eca11190ab5 void SendWebPreferencesToRenderer(); 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 02a3d39508397e90133eb4adad79515d507f14ea..b292c8ced209d49ac668e68ad8ad01a1821802d3 100644 +--- a/content/browser/renderer_host/render_widget_host_view_aura.cc ++++ b/content/browser/renderer_host/render_widget_host_view_aura.cc +@@ -554,8 +554,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. +- DCHECK(host_->is_hidden() || visibility_ == Visibility::VISIBLE); +- OnShowWithPageVisibility(page_visibility); ++ if (host_->is_hidden() || visibility_ == Visibility::VISIBLE) ++ OnShowWithPageVisibility(page_visibility); + } + + void RenderWidgetHostViewAura::NotifyHostAndDelegateOnWasShown( diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h index 9979c25ecd57e68331b628a518368635db5c2027..f65bfbbb663a5bb0511ffa389d3163e0fdeb4d1f 100644 --- a/content/public/browser/render_view_host.h @@ -84,10 +99,21 @@ index 8a18ecf567cd3a6a2fb1627083a5544a93198bf4..6bb4074e033e045de164bc776f75f152 // 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 79c3ac1ae8f9a5c643fdf3f8772084afdb8ea0d2..8f834dd2d0eb89b896b704045d7bcee53bd08ec9 100644 +index 79c3ac1ae8f9a5c643fdf3f8772084afdb8ea0d2..379ff57cbfe13a05b0b4dd2341a3cbcfe453c857 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -3853,13 +3853,21 @@ PageScheduler* WebViewImpl::Scheduler() const { +@@ -2392,6 +2392,10 @@ void WebViewImpl::SetPageLifecycleStateInternal( + TRACE_EVENT2("navigation", "WebViewImpl::SetPageLifecycleStateInternal", + "old_state", old_state, "new_state", new_state); + ++ // If backgroundThrottling is disabled, the page is always visible. ++ if (!scheduler_throttling_allowed_) ++ new_state->visibility = mojom::blink::PageVisibilityState::kVisible; ++ + 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 && +@@ -3853,17 +3857,31 @@ PageScheduler* WebViewImpl::Scheduler() const { return GetPage()->GetPageScheduler(); } @@ -102,14 +128,30 @@ index 79c3ac1ae8f9a5c643fdf3f8772084afdb8ea0d2..8f834dd2d0eb89b896b704045d7bcee5 mojom::blink::PageVisibilityState visibility_state, bool is_initial_state) { DCHECK(GetPage()); - GetPage()->SetVisibilityState(visibility_state, is_initial_state); - GetPage()->GetPageScheduler()->SetPageVisible( +- GetPage()->SetVisibilityState(visibility_state, is_initial_state); +- GetPage()->GetPageScheduler()->SetPageVisible( - visibility_state == mojom::blink::PageVisibilityState::kVisible); -+ scheduler_throttling_allowed_ ? -+ (visibility_state == mojom::blink::PageVisibilityState::kVisible) : true); - // Notify observers of the change. - if (!is_initial_state) { - for (auto& observer : observers_) +- // Notify observers of the change. +- if (!is_initial_state) { +- for (auto& observer : observers_) +- observer.OnPageVisibilityChanged(visibility_state); ++ ++ // If backgroundThrottling is disabled, the page is always visible. ++ if (!scheduler_throttling_allowed_) { ++ GetPage()->SetVisibilityState(mojom::blink::PageVisibilityState::kVisible, is_initial_state); ++ GetPage()->GetPageScheduler()->SetPageVisible(true); ++ } else { ++ bool is_visible = visibility_state == mojom::blink::PageVisibilityState::kVisible; ++ GetPage()->SetVisibilityState(visibility_state, is_initial_state); ++ GetPage()->GetPageScheduler()->SetPageVisible(is_visible); ++ // Notify observers of the change. ++ if (!is_initial_state) { ++ for (auto& observer : observers_) ++ observer.OnPageVisibilityChanged(visibility_state); ++ } + } + } + diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h index 6a180620e00c77d0f4be346d1296f62feb714abb..c0ccf14faa52ab190c5848e8e9b597bcf637d4c0 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.h diff --git a/patches/chromium/extend_apply_webpreferences.patch b/patches/chromium/extend_apply_webpreferences.patch index 38545f9567584..6d4350963c67e 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 8f834dd2d0eb89b896b704045d7bcee53bd08ec9..cda2b89e88cb1358a8277c0f67903173d43bb5c3 100644 +index 379ff57cbfe13a05b0b4dd2341a3cbcfe453c857..8de0090eb12b66e6a34ae7512245405100b70193 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -165,6 +165,7 @@ diff --git a/spec/api-browser-window-spec.ts b/spec/api-browser-window-spec.ts index ed55d9af8bc05..bf7ddada8508b 100644 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -4072,7 +4072,8 @@ describe('BrowserWindow module', () => { }); }); - describe('document.visibilityState/hidden', () => { + // TODO(codebytere): figure out how to make these pass in CI on Windows. + ifdescribe(process.platform !== 'win32')('document.visibilityState/hidden', () => { afterEach(closeAllWindows); it('visibilityState is initially visible despite window being hidden', async () => { @@ -4100,8 +4101,7 @@ describe('BrowserWindow module', () => { expect(hidden).to.be.false('hidden'); }); - // TODO(nornagon): figure out why this is failing on windows - ifit(process.platform !== 'win32')('visibilityState changes when window is hidden', async () => { + it('visibilityState changes when window is hidden', async () => { const w = new BrowserWindow({ width: 100, height: 100, @@ -4128,8 +4128,7 @@ describe('BrowserWindow module', () => { } }); - // TODO(nornagon): figure out why this is failing on windows - ifit(process.platform !== 'win32')('visibilityState changes when window is shown', async () => { + it('visibilityState changes when window is shown', async () => { const w = new BrowserWindow({ width: 100, height: 100, @@ -4150,7 +4149,7 @@ describe('BrowserWindow module', () => { expect(visibilityState).to.equal('visible'); }); - ifit(process.platform !== 'win32')('visibilityState changes when window is shown inactive', async () => { + it('visibilityState changes when window is shown inactive', async () => { const w = new BrowserWindow({ width: 100, height: 100, @@ -4170,7 +4169,6 @@ describe('BrowserWindow module', () => { expect(visibilityState).to.equal('visible'); }); - // TODO(nornagon): figure out why this is failing on windows ifit(process.platform === 'darwin')('visibilityState changes when window is minimized', async () => { const w = new BrowserWindow({ width: 100, @@ -4197,8 +4195,6 @@ describe('BrowserWindow module', () => { } }); - // DISABLED-FIXME(MarshallOfSound): This test fails locally 100% of the time, on CI it started failing - // when we introduced the compositor recycling patch. Should figure out how to fix this it('visibilityState remains visible if backgroundThrottling is disabled', async () => { const w = new BrowserWindow({ show: false, @@ -4206,10 +4202,13 @@ describe('BrowserWindow module', () => { height: 100, webPreferences: { backgroundThrottling: false, - nodeIntegration: true + nodeIntegration: true, + contextIsolation: false } }); + w.loadFile(path.join(fixtures, 'pages', 'visibilitychange.html')); + { const [, visibilityState, hidden] = await once(ipcMain, 'pong'); expect(visibilityState).to.equal('visible'); diff --git a/spec/disabled-tests.json b/spec/disabled-tests.json index 6391393933abe..873ca2415cc84 100644 --- a/spec/disabled-tests.json +++ b/spec/disabled-tests.json @@ -1,7 +1,6 @@ [ "// NOTE: this file is used to disable tests in our test suite by their full title.", "BrowserWindow module BrowserWindow.loadURL(url) should emit did-fail-load event for files that do not exist", - "BrowserWindow module document.visibilityState/hidden visibilityState remains visible if backgroundThrottling is disabled", "Menu module Menu.setApplicationMenu unsets a menu with null", "process module main process process.takeHeapSnapshot() returns true on success", "protocol module protocol.registerSchemesAsPrivileged cors-fetch disallows CORS and fetch requests when only supportFetchAPI is specified", diff --git a/spec/fixtures/pages/visibilitychange.html b/spec/fixtures/pages/visibilitychange.html index 0d4f07c46f933..3814475b5bdb5 100644 --- a/spec/fixtures/pages/visibilitychange.html +++ b/spec/fixtures/pages/visibilitychange.html @@ -3,10 +3,8 @@ From d42b3408de0df4159795514749f773f1dfc50268 Mon Sep 17 00:00:00 2001 From: hunter Date: Mon, 31 Jul 2023 16:32:59 +0800 Subject: [PATCH 05/93] docs: fix some string union type (#39258) * docs: fix some string union types Improve Type Union Typings in the Docs * test: add smoke tests * test: update `ses.clearStorageData` test case * test: update `ses.clearStorageData` test case --------- Co-authored-by: mhli --- docs/api/desktop-capturer.md | 2 +- docs/api/native-image.md | 2 +- docs/api/session.md | 6 +++--- docs/api/web-contents.md | 2 +- docs/api/webview-tag.md | 2 +- spec/api-session-spec.ts | 7 +++---- spec/ts-smoke/electron/main.ts | 20 ++++++++++++++++++++ 7 files changed, 30 insertions(+), 11 deletions(-) diff --git a/docs/api/desktop-capturer.md b/docs/api/desktop-capturer.md index 32b881516ae54..078d4f980b441 100644 --- a/docs/api/desktop-capturer.md +++ b/docs/api/desktop-capturer.md @@ -91,7 +91,7 @@ The `desktopCapturer` module has the following methods: * `options` Object * `types` string[] - An array of strings that lists the types of desktop sources - to be captured, available types are `screen` and `window`. + to be captured, available types can be `screen` and `window`. * `thumbnailSize` [Size](structures/size.md) (optional) - The size that the media source thumbnail should be scaled to. Default is `150` x `150`. Set width or height to 0 when you do not need the thumbnails. This will save the processing time required for capturing the content of each diff --git a/docs/api/native-image.md b/docs/api/native-image.md index 84660c5da77b7..d31b39f1c7784 100644 --- a/docs/api/native-image.md +++ b/docs/api/native-image.md @@ -306,7 +306,7 @@ Returns `NativeImage` - The cropped image. * `width` Integer (optional) - Defaults to the image's width. * `height` Integer (optional) - Defaults to the image's height. * `quality` string (optional) - The desired quality of the resize image. - Possible values are `good`, `better`, or `best`. The default is `best`. + Possible values include `good`, `better`, or `best`. The default is `best`. These values express a desired quality/speed tradeoff. They are translated into an algorithm-specific method that depends on the capabilities (CPU, GPU) of the underlying platform. It is possible for all three methods diff --git a/docs/api/session.md b/docs/api/session.md index df59bf0886a62..7be9461b10a40 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -574,11 +574,11 @@ Clears the session’s HTTP cache. * `options` Object (optional) * `origin` string (optional) - Should follow `window.location.origin`’s representation `scheme://host:port`. - * `storages` string[] (optional) - The types of storages to clear, can contain: + * `storages` string[] (optional) - The types of storages to clear, can be `cookies`, `filesystem`, `indexdb`, `localstorage`, `shadercache`, `websql`, `serviceworkers`, `cachestorage`. If not specified, clear all storage types. - * `quotas` string[] (optional) - The types of quotas to clear, can contain: + * `quotas` string[] (optional) - The types of quotas to clear, can be `temporary`, `syncable`. If not specified, clear all quotas. Returns `Promise` - resolves when the storage data has been cleared. @@ -1113,7 +1113,7 @@ app.whenReady().then(() => { * `handler` Function\ | null * `details` Object - * `protectedClasses` string[] - The current list of protected USB classes. Possible class values are: + * `protectedClasses` string[] - The current list of protected USB classes. Possible class values include: * `audio` * `audio-video` * `hid` diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index fb123983169d7..cb046fb8fd9f2 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -795,7 +795,7 @@ Returns: * `frameCharset` string - The character encoding of the frame on which the menu was invoked. * `inputFieldType` string - If the context menu was invoked on an input - field, the type of that field. Possible values are `none`, `plainText`, + field, the type of that field. Possible values include `none`, `plainText`, `password`, `other`. * `spellcheckEnabled` boolean - If the context is editable, whether or not spellchecking is enabled. * `menuSourceType` string - Input source that invoked the context menu. diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index 4a71c998f54b8..74b8c1519dd25 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -1091,7 +1091,7 @@ Returns: * `frameCharset` string - The character encoding of the frame on which the menu was invoked. * `inputFieldType` string - If the context menu was invoked on an input - field, the type of that field. Possible values are `none`, `plainText`, + field, the type of that field. Possible values include `none`, `plainText`, `password`, `other`. * `spellcheckEnabled` boolean - If the context is editable, whether or not spellchecking is enabled. * `menuSourceType` string - Input source that invoked the context menu. diff --git a/spec/api-session-spec.ts b/spec/api-session-spec.ts index 6768077027c50..840748167a24e 100644 --- a/spec/api-session-spec.ts +++ b/spec/api-session-spec.ts @@ -252,12 +252,11 @@ describe('session module', () => { it('clears localstorage data', async () => { const w = new BrowserWindow({ show: false, webPreferences: { nodeIntegration: true } }); await w.loadFile(path.join(fixtures, 'api', 'localstorage.html')); - const options = { + await w.webContents.session.clearStorageData({ origin: 'file://', storages: ['localstorage'], - quotas: ['persistent'] - }; - await w.webContents.session.clearStorageData(options); + quotas: ['temporary'] + }); while (await w.webContents.executeJavaScript('localStorage.length') !== 0) { // The storage clear isn't instantly visible to the renderer, so keep // trying until it is. diff --git a/spec/ts-smoke/electron/main.ts b/spec/ts-smoke/electron/main.ts index 05829f4d6e212..27ea0da6c3cd1 100644 --- a/spec/ts-smoke/electron/main.ts +++ b/spec/ts-smoke/electron/main.ts @@ -526,6 +526,10 @@ dialog.showMessageBoxSync(win3, { message: 'test', type: 'foo' }); ipcMain.handle('get-sources', (event, options) => desktopCapturer.getSources(options)); +desktopCapturer.getSources({ types: ['window', 'screen'] }); +// @ts-expect-error Invalid type value +desktopCapturer.getSources({ types: ['unknown'] }); + // global-shortcut // https://github.com/electron/electron/blob/main/docs/api/global-shortcut.md @@ -1030,6 +1034,12 @@ appIcon4.destroy(); const image2 = nativeImage.createFromPath('/Users/somebody/images/icon.png'); console.log(image2.getSize()); +image2.resize({ quality: 'best' }); +image2.resize({ quality: 'better' }); +image2.resize({ quality: 'good' }); +// @ts-expect-error Invalid type value +image2.resize({ quality: 'bad' }); + // process // https://github.com/electron/electron/blob/main/docs/api/process.md @@ -1133,6 +1143,16 @@ shell.writeShortcutLink('/home/user/Desktop/shortcut.lnk', 'update', shell.readS // session // https://github.com/electron/electron/blob/main/docs/api/session.md +session.defaultSession.clearStorageData({ storages: ['cookies', 'filesystem'] }); +session.defaultSession.clearStorageData({ storages: ['localstorage', 'indexdb', 'serviceworkers'] }); +session.defaultSession.clearStorageData({ storages: ['shadercache', 'websql', 'cachestorage'] }); +// @ts-expect-error Invalid type value +session.defaultSession.clearStorageData({ storages: ['wrong_path'] }); + +session.defaultSession.clearStorageData({ quotas: ['syncable', 'temporary'] }); +// @ts-expect-error Invalid type value +session.defaultSession.clearStorageData({ quotas: ['bad_type'] }); + session.defaultSession.on('will-download', (event, item, webContents) => { console.log('will-download', webContents.id); event.preventDefault(); From 1a9d50014f6315dd7d8fb5f49bf7b6cb2ce64c63 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 31 Jul 2023 01:39:01 -0700 Subject: [PATCH 06/93] chore: update @electron/lint-roller and improve doc type checks (#39262) --- docs/development/creating-api.md | 4 ++-- docs/tutorial/context-isolation.md | 4 ++-- docs/tutorial/ipc.md | 10 +++++----- docs/tutorial/message-ports.md | 4 ++-- package.json | 2 +- yarn.lock | 14 ++++++++++---- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/docs/development/creating-api.md b/docs/development/creating-api.md index 4e219cf3561ef..6194ceb716e1a 100644 --- a/docs/development/creating-api.md +++ b/docs/development/creating-api.md @@ -129,7 +129,7 @@ void Initialize(v8::Local exports, In the [`typings/internal-ambient.d.ts`](https://github.com/electron/electron/blob/main/typings/internal-ambient.d.ts) file, we need to append a new property onto the `Process` interface like so: -```ts title='typings/internal-ambient.d.ts' +```ts title='typings/internal-ambient.d.ts' @ts-nocheck interface Process { _linkedBinding(name: 'electron_browser_{api_name}'): Electron.ApiName; } @@ -164,7 +164,7 @@ An example of the contents of this file can be found [here](https://github.com/e Add your module to the module list found at `"lib/browser/api/module-list.ts"` like so: -```typescript title='lib/browser/api/module-list.ts' +```typescript title='lib/browser/api/module-list.ts' @ts-nocheck export const browserModuleList: ElectronInternal.ModuleEntry[] = [ { name: 'apiName', loader: () => require('./api-name') }, ]; diff --git a/docs/tutorial/context-isolation.md b/docs/tutorial/context-isolation.md index 5615d4d9b3cf6..0fce721646df7 100644 --- a/docs/tutorial/context-isolation.md +++ b/docs/tutorial/context-isolation.md @@ -84,7 +84,7 @@ contextBridge.exposeInMainWorld('electronAPI', { You can create a `renderer.d.ts` declaration file and globally augment the `Window` interface: -```typescript title='renderer.d.ts' +```typescript title='renderer.d.ts' @ts-noisolate export interface IElectronAPI { loadPreferences: () => Promise, } @@ -98,7 +98,7 @@ declare global { Doing so will ensure that the TypeScript compiler will know about the `electronAPI` property on your global `window` object when writing scripts in your renderer process: -```typescript title='renderer.ts' @ts-nocheck +```typescript title='renderer.ts' window.electronAPI.loadPreferences() ``` diff --git a/docs/tutorial/ipc.md b/docs/tutorial/ipc.md index 2111382c31ace..71c1d843b82d5 100644 --- a/docs/tutorial/ipc.md +++ b/docs/tutorial/ipc.md @@ -412,7 +412,7 @@ function createWindow () { For the purposes of the tutorial, it's important to note that the `click` handler sends a message (either `1` or `-1`) to the renderer process through the `update-counter` channel. -```javascript @ts-nocheck +```javascript @ts-type={mainWindow:Electron.BrowserWindow} click: () => mainWindow.webContents.send('update-counter', -1) ``` @@ -486,13 +486,13 @@ To tie it all together, we'll create an interface in the loaded HTML file that c Finally, to make the values update in the HTML document, we'll add a few lines of DOM manipulation so that the value of the `#counter` element is updated whenever we fire an `update-counter` event. -```javascript title='renderer.js (Renderer Process)' @ts-nocheck +```javascript title='renderer.js (Renderer Process)' @ts-window-type={electronAPI:{onUpdateCounter:(callback:(event:Electron.IpcRendererEvent,value:number)=>void)=>void}} const counter = document.getElementById('counter') window.electronAPI.onUpdateCounter((_event, value) => { const oldValue = Number(counter.innerText) const newValue = oldValue + value - counter.innerText = newValue + counter.innerText = newValue.toString() }) ``` @@ -509,13 +509,13 @@ We can demonstrate this with slight modifications to the code from the previous renderer process, use the `event` parameter to send a reply back to the main process through the `counter-value` channel. -```javascript title='renderer.js (Renderer Process)' @ts-nocheck +```javascript title='renderer.js (Renderer Process)' @ts-window-type={electronAPI:{onUpdateCounter:(callback:(event:Electron.IpcRendererEvent,value:number)=>void)=>void}} const counter = document.getElementById('counter') window.electronAPI.onUpdateCounter((event, value) => { const oldValue = Number(counter.innerText) const newValue = oldValue + value - counter.innerText = newValue + counter.innerText = newValue.toString() event.sender.send('counter-value', newValue) }) ``` diff --git a/docs/tutorial/message-ports.md b/docs/tutorial/message-ports.md index 4a01a698955b2..9587b743f67fa 100644 --- a/docs/tutorial/message-ports.md +++ b/docs/tutorial/message-ports.md @@ -126,7 +126,7 @@ app.whenReady().then(async () => { Then, in your preload scripts you receive the port through IPC and set up the listeners. -```js title='preloadMain.js and preloadSecondary.js (Preload scripts)' @ts-nocheck +```js title='preloadMain.js and preloadSecondary.js (Preload scripts)' @ts-window-type={electronMessagePort:MessagePort} const { ipcRenderer } = require('electron') ipcRenderer.on('port', e => { @@ -148,7 +148,7 @@ That means window.electronMessagePort is globally available and you can call `postMessage` on it from anywhere in your app to send a message to the other renderer. -```js title='renderer.js (Renderer Process)' @ts-nocheck +```js title='renderer.js (Renderer Process)' @ts-window-type={electronMessagePort:MessagePort} // elsewhere in your code to send a message to the other renderers message handler window.electronMessagePort.postMessage('ping') ``` diff --git a/package.json b/package.json index 75d6cd8a85106..3784e17ec6177 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "@electron/docs-parser": "^1.1.1", "@electron/fiddle-core": "^1.0.4", "@electron/github-app-auth": "^2.0.0", - "@electron/lint-roller": "^1.5.0", + "@electron/lint-roller": "^1.8.0", "@electron/typescript-definitions": "^8.14.5", "@octokit/rest": "^19.0.7", "@primer/octicons": "^10.0.0", diff --git a/yarn.lock b/yarn.lock index f0d46387e6e68..4ceb1ed2870e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -199,12 +199,13 @@ "@octokit/auth-app" "^4.0.13" "@octokit/rest" "^19.0.11" -"@electron/lint-roller@^1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@electron/lint-roller/-/lint-roller-1.5.0.tgz#9b743979e1b03327e475fa696bb781eb2ea05ef2" - integrity sha512-205UxwJEx8zv5wLwPq4wMA0OYrJ7d1GuqOhPav0Uy2HWe4K+DZbSP50safCvZCSpI6Op3DMo79tp5i8VppuPWA== +"@electron/lint-roller@^1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@electron/lint-roller/-/lint-roller-1.8.0.tgz#26c29f2b2b7eaa9429fde04b178d7fdfe9d56da9" + integrity sha512-4LKE2SeSM3kdorDoFMzvZBTKvNUPAJl8apH9e1E9Gb5SKhFBZuG9CIJwtPKwtRYiGmBfu/HxoHuGEGkycxM+3Q== dependencies: "@dsanders11/vscode-markdown-languageservice" "^0.3.0" + balanced-match "^2.0.0" glob "^8.1.0" markdown-it "^13.0.1" markdownlint-cli "^0.33.0" @@ -1571,6 +1572,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +balanced-match@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-2.0.0.tgz#dc70f920d78db8b858535795867bf48f820633d9" + integrity sha512-1ugUSr8BHXRnK23KfuYS+gVMC3LB8QGH9W1iGtDPsNWoQbgtXSExkBu2aDR4epiGWZOjZsj6lDl/N/AqqTC3UA== + base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" From 9d82a23d5f9d9427ffe157ec3db42f6759c9e261 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 31 Jul 2023 10:39:37 +0200 Subject: [PATCH 07/93] refactor: throw errors directly in async functions (#39233) --- lib/browser/api/web-contents.ts | 35 ++++++++++++++++----------------- lib/common/deprecate.ts | 2 +- spec/api-app-spec.ts | 2 +- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/lib/browser/api/web-contents.ts b/lib/browser/api/web-contents.ts index bea6d7225d2db..8f0f53aa2ba74 100644 --- a/lib/browser/api/web-contents.ts +++ b/lib/browser/api/web-contents.ts @@ -211,28 +211,28 @@ WebContents.prototype.printToPDF = async function (options) { if (options.landscape !== undefined) { if (typeof options.landscape !== 'boolean') { - return Promise.reject(new Error('landscape must be a Boolean')); + throw new Error('landscape must be a Boolean'); } printSettings.landscape = options.landscape; } if (options.displayHeaderFooter !== undefined) { if (typeof options.displayHeaderFooter !== 'boolean') { - return Promise.reject(new Error('displayHeaderFooter must be a Boolean')); + throw new Error('displayHeaderFooter must be a Boolean'); } printSettings.displayHeaderFooter = options.displayHeaderFooter; } if (options.printBackground !== undefined) { if (typeof options.printBackground !== 'boolean') { - return Promise.reject(new Error('printBackground must be a Boolean')); + throw new Error('printBackground must be a Boolean'); } printSettings.shouldPrintBackgrounds = options.printBackground; } if (options.scale !== undefined) { if (typeof options.scale !== 'number') { - return Promise.reject(new Error('scale must be a Number')); + throw new Error('scale must be a Number'); } printSettings.scale = options.scale; } @@ -242,53 +242,53 @@ WebContents.prototype.printToPDF = async function (options) { if (typeof pageSize === 'string') { const format = paperFormats[pageSize.toLowerCase()]; if (!format) { - return Promise.reject(new Error(`Invalid pageSize ${pageSize}`)); + throw new Error(`Invalid pageSize ${pageSize}`); } printSettings.paperWidth = format.width; printSettings.paperHeight = format.height; } else if (typeof options.pageSize === 'object') { if (!pageSize.height || !pageSize.width) { - return Promise.reject(new Error('height and width properties are required for pageSize')); + throw new Error('height and width properties are required for pageSize'); } printSettings.paperWidth = pageSize.width; printSettings.paperHeight = pageSize.height; } else { - return Promise.reject(new Error('pageSize must be a String or Object')); + throw new Error('pageSize must be a String or Object'); } } const { margins } = options; if (margins !== undefined) { if (typeof margins !== 'object') { - return Promise.reject(new Error('margins must be an Object')); + throw new Error('margins must be an Object'); } if (margins.top !== undefined) { if (typeof margins.top !== 'number') { - return Promise.reject(new Error('margins.top must be a Number')); + throw new Error('margins.top must be a Number'); } printSettings.marginTop = margins.top; } if (margins.bottom !== undefined) { if (typeof margins.bottom !== 'number') { - return Promise.reject(new Error('margins.bottom must be a Number')); + throw new Error('margins.bottom must be a Number'); } printSettings.marginBottom = margins.bottom; } if (margins.left !== undefined) { if (typeof margins.left !== 'number') { - return Promise.reject(new Error('margins.left must be a Number')); + throw new Error('margins.left must be a Number'); } printSettings.marginLeft = margins.left; } if (margins.right !== undefined) { if (typeof margins.right !== 'number') { - return Promise.reject(new Error('margins.right must be a Number')); + throw new Error('margins.right must be a Number'); } printSettings.marginRight = margins.right; } @@ -296,28 +296,28 @@ WebContents.prototype.printToPDF = async function (options) { if (options.pageRanges !== undefined) { if (typeof options.pageRanges !== 'string') { - return Promise.reject(new Error('pageRanges must be a String')); + throw new Error('pageRanges must be a String'); } printSettings.pageRanges = options.pageRanges; } if (options.headerTemplate !== undefined) { if (typeof options.headerTemplate !== 'string') { - return Promise.reject(new Error('headerTemplate must be a String')); + throw new Error('headerTemplate must be a String'); } printSettings.headerTemplate = options.headerTemplate; } if (options.footerTemplate !== undefined) { if (typeof options.footerTemplate !== 'string') { - return Promise.reject(new Error('footerTemplate must be a String')); + throw new Error('footerTemplate must be a String'); } printSettings.footerTemplate = options.footerTemplate; } if (options.preferCSSPageSize !== undefined) { if (typeof options.preferCSSPageSize !== 'boolean') { - return Promise.reject(new Error('preferCSSPageSize must be a Boolean')); + throw new Error('preferCSSPageSize must be a Boolean'); } printSettings.preferCSSPageSize = options.preferCSSPageSize; } @@ -330,8 +330,7 @@ WebContents.prototype.printToPDF = async function (options) { } return pendingPromise; } else { - const error = new Error('Printing feature is disabled'); - return Promise.reject(error); + throw new Error('Printing feature is disabled'); } }; diff --git a/lib/common/deprecate.ts b/lib/common/deprecate.ts index 94f2e80acd597..c6435cc816035 100644 --- a/lib/common/deprecate.ts +++ b/lib/common/deprecate.ts @@ -46,7 +46,7 @@ export function log (message: string): void { // remove a function with no replacement export function removeFunction (fn: T, removedName: string): T { - if (!fn) { throw Error(`'${removedName} function' is invalid or does not exist.`); } + if (!fn) { throw new Error(`'${removedName} function' is invalid or does not exist.`); } // wrap the deprecated function to warn user const warn = warnOnce(`${fn.name} function`); diff --git a/spec/api-app-spec.ts b/spec/api-app-spec.ts index 87b6e616484f8..10c931126b7d8 100644 --- a/spec/api-app-spec.ts +++ b/spec/api-app-spec.ts @@ -1422,7 +1422,7 @@ describe('app module', () => { } } else { // return error if not clean exit - return Promise.reject(new Error(errorData)); + throw new Error(errorData); } }; const verifyBasicGPUInfo = async (gpuInfo: any) => { From 4887feb8f0b6c41968dcec2d8c7b95043ac69bb6 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 31 Jul 2023 15:59:51 +0200 Subject: [PATCH 08/93] fix: skip artifact validation for doc-only PRs (#39296) --- appveyor-woa.yml | 40 +++++++++++++++++++++++----------------- appveyor.yml | 41 ++++++++++++++++++++++++----------------- 2 files changed, 47 insertions(+), 34 deletions(-) diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 2b5f135a0e09d..bf8ffa907e7bc 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -74,8 +74,10 @@ for: - ps: | node script/yarn.js install --frozen-lockfile node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER + $env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false" if ($LASTEXITCODE -eq 0) { - Write-warning "Skipping build for doc only change" + Write-warning "Skipping build for doc-only change" + $env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true" Exit-AppveyorBuild } else { $global:LASTEXITCODE = 0 @@ -206,25 +208,29 @@ for: - ps: | cd C:\projects\src $missing_artifacts = $false - $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') - foreach($artifact_name in $artifacts_to_upload) { - if ($artifact_name -eq 'ffmpeg.zip') { - $artifact_file = "out\ffmpeg\ffmpeg.zip" - } elseif ($artifact_name -eq 'node_headers.zip') { - $artifact_file = $artifact_name - } else { - $artifact_file = "out\Default\$artifact_name" + if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') { + Write-warning "Skipping artifact validation for doc-only PR" + } else { + $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') + foreach($artifact_name in $artifacts_to_upload) { + if ($artifact_name -eq 'ffmpeg.zip') { + $artifact_file = "out\ffmpeg\ffmpeg.zip" + } elseif ($artifact_name -eq 'node_headers.zip') { + $artifact_file = $artifact_name + } else { + $artifact_file = "out\Default\$artifact_name" + } + if (Test-Path $artifact_file) { + appveyor-retry appveyor PushArtifact $artifact_file + } else { + Write-warning "$artifact_name is missing and cannot be added to artifacts" + $missing_artifacts = $true + } } - if (Test-Path $artifact_file) { - appveyor-retry appveyor PushArtifact $artifact_file - } else { - Write-warning "$artifact_name is missing and cannot be added to artifacts" - $missing_artifacts = $true + if ($missing_artifacts) { + throw "Build failed due to missing artifacts" } } - if ($missing_artifacts) { - throw "Build failed due to missing artifacts" - } - ps: >- if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) { appveyor-retry appveyor PushArtifact pdb.zip diff --git a/appveyor.yml b/appveyor.yml index 43673d58133a7..85ac52b756c40 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -72,8 +72,10 @@ for: - ps: | node script/yarn.js install --frozen-lockfile node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER + $env:SHOULD_SKIP_ARTIFACT_VALIDATION = "false" if ($LASTEXITCODE -eq 0) { - Write-warning "Skipping build for doc only change" + Write-warning "Skipping build for doc-only change" + $env:SHOULD_SKIP_ARTIFACT_VALIDATION = "true" Exit-AppveyorBuild } else { $global:LASTEXITCODE = 0 @@ -204,25 +206,30 @@ for: - ps: | cd C:\projects\src $missing_artifacts = $false - $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') - foreach($artifact_name in $artifacts_to_upload) { - if ($artifact_name -eq 'ffmpeg.zip') { - $artifact_file = "out\ffmpeg\ffmpeg.zip" - } elseif ($artifact_name -eq 'node_headers.zip') { - $artifact_file = $artifact_name - } else { - $artifact_file = "out\Default\$artifact_name" + + if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') { + Write-warning "Skipping artifact validation for doc-only PR" + } else { + $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') + foreach($artifact_name in $artifacts_to_upload) { + if ($artifact_name -eq 'ffmpeg.zip') { + $artifact_file = "out\ffmpeg\ffmpeg.zip" + } elseif ($artifact_name -eq 'node_headers.zip') { + $artifact_file = $artifact_name + } else { + $artifact_file = "out\Default\$artifact_name" + } + if (Test-Path $artifact_file) { + appveyor-retry appveyor PushArtifact $artifact_file + } else { + Write-warning "$artifact_name is missing and cannot be added to artifacts" + $missing_artifacts = $true + } } - if (Test-Path $artifact_file) { - appveyor-retry appveyor PushArtifact $artifact_file - } else { - Write-warning "$artifact_name is missing and cannot be added to artifacts" - $missing_artifacts = $true + if ($missing_artifacts) { + throw "Build failed due to missing artifacts" } } - if ($missing_artifacts) { - throw "Build failed due to missing artifacts" - } - ps: >- if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) { appveyor-retry appveyor PushArtifact pdb.zip From fbfd1354ebf619a84640b7bb194ca554fce4bd48 Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Mon, 31 Jul 2023 10:47:32 -0700 Subject: [PATCH 09/93] chore: bump chromium to 117.0.5913.0 (main) (#39172) * chore: bump chromium in DEPS to 117.0.5899.0 * 4686653: webui: Filter out non-chrome scheme URLs in WebUIConfigMap https://chromium-review.googlesource.com/c/chromium/src/+/4686653 * 4696355: Remove deprecated version of base::CommandLine::CopySwitchesFrom() https://chromium-review.googlesource.com/c/chromium/src/+/4696355 * chore: fixup patch indices * 4603888: Reland "Enable raw_ref check on linux" https://chromium-review.googlesource.com/c/chromium/src/+/4603888 * chore: bump chromium in DEPS to 117.0.5901.0 * chore: update patches * chore: bump chromium in DEPS to 117.0.5903.0 * chore: bump chromium in DEPS to 117.0.5903.2 * chore: bump chromium in DEPS to 117.0.5905.0 * 4706792: Printing: Add debug code for a DispatchBeforePrintEvent() failure https://chromium-review.googlesource.com/c/chromium/src/+/4706792 * 4704786: Refactor libunwind build rules/flags https://chromium-review.googlesource.com/c/chromium/src/+/4704786 * 4701710: [Linux Ui] Set toolkit dark preference based on FDO dark preference https://chromium-review.googlesource.com/c/chromium/src/+/4701710 * chore: fixup patch indices * chore: bump chromium in DEPS to 117.0.5907.0 * chore: bump chromium in DEPS to 117.0.5909.2 * chore: update patches * chore: bump chromium in DEPS to 117.0.5911.0 * chore: update patches * chore: build-what-we-include * fix: set allowFileAccess on devtools extensions correctly Ref: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4714725 * 4670615: Reland "[iterator-helpers] Shipping iterator helpers" https://chromium-review.googlesource.com/c/v8/v8/+/4670615 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard --- DEPS | 2 +- chromium_src/BUILD.gn | 1 + .../add_didinstallconditionalfeatures.patch | 12 ++--- ...er_to_linuxui_getwindowframeprovider.patch | 24 +++++----- ..._scheduler_throttling_per_renderview.patch | 10 ++--- ..._secondary_label_via_simplemenumodel.patch | 2 +- patches/chromium/blink_local_frame.patch | 2 +- ..._depend_on_packed_resource_integrity.patch | 16 +++---- .../build_libc_as_static_library.patch | 6 +-- ...ld_config_in_the_required_components.patch | 18 ++++---- patches/chromium/can_create_window.patch | 28 ++++++------ ...d_buildflag_guard_around_new_include.patch | 2 +- ...hore_add_electron_deps_to_gitignores.patch | 10 ++--- ...dle_synthetic_mouse_events_for_touch.patch | 2 +- ..._introduce_blocking_api_for_electron.patch | 2 +- ...tition_attribute_dcheck_for_webviews.patch | 2 +- ...screationoverridden_with_full_params.patch | 12 ++--- .../custom_protocols_plzserviceworker.patch | 4 +- .../disable_color_correct_rendering.patch | 6 +-- .../disable_compositor_recycling.patch | 2 +- patches/chromium/disable_hidden.patch | 4 +- .../chromium/enable_reset_aspect_ratio.patch | 2 +- ...xpose_setuseragent_on_networkcontext.patch | 10 ++--- .../extend_apply_webpreferences.patch | 4 +- ...dd_set_theme_source_to_allow_apps_to.patch | 4 +- ...e_launch_options_for_service_process.patch | 12 ++--- ...screen_rendering_with_viz_compositor.patch | 2 +- ..._raw_response_headers_from_urlloader.patch | 16 +++---- ...uest_webcontents_to_enter_fullscreen.patch | 4 +- .../fix_aspect_ratio_with_max_size.patch | 2 +- ...ding_non-standard_schemes_in_iframes.patch | 10 ++--- ...eme_change_during_context_menu_close.patch | 6 +-- ...x_crash_when_saving_edited_pdf_files.patch | 6 +-- .../chromium/fix_export_zlib_symbols.patch | 2 +- ...board_hides_on_input_blur_in_webview.patch | 4 +- ...x_remove_caption-removing_style_call.patch | 2 +- ...from_localframe_requestexecutescript.patch | 8 ++-- ...t_menu_item_when_opened_via_keyboard.patch | 14 +++--- patches/chromium/frame_host_manager.patch | 8 ++-- .../gin_enable_disable_v8_platform.patch | 2 +- ...gpu_notify_when_dxdiag_request_fails.patch | 2 +- .../chromium/gritsettings_resource_ids.patch | 4 +- patches/chromium/gtk_visibility.patch | 2 +- ...tform_electron_can_call_x11_property.patch | 4 +- patches/chromium/isolate_holder.patch | 2 +- .../mas_disable_remote_accessibility.patch | 22 +++++----- ...emote_certificate_verification_logic.patch | 10 ++--- .../chromium/notification_provenance.patch | 2 +- patches/chromium/picture-in-picture.patch | 2 +- ...utofill_colors_to_the_color_pipeline.patch | 6 +-- patches/chromium/printing.patch | 44 +++++++++---------- ...r_changes_to_the_webcontentsobserver.patch | 6 +-- ...store_base_adaptcallbackforrepeating.patch | 2 +- .../render_widget_host_view_base.patch | 6 +-- patches/chromium/resource_file_conflict.patch | 2 +- patches/chromium/web_contents.patch | 6 +-- patches/chromium/webview_cross_drag.patch | 4 +- patches/chromium/webview_fullscreen.patch | 4 +- patches/node/.patches | 1 + ...enerator_tostringtag_prototype_to_v8.patch | 20 +++++++++ patches/v8/build_gn.patch | 8 ++-- ...export_private_v8_symbols_on_windows.patch | 4 +- shell/browser/electron_browser_client.cc | 3 +- .../net/proxying_url_loader_factory.cc | 4 +- .../browser/net/proxying_url_loader_factory.h | 3 +- .../browser/ui/accelerator_util_unittests.cc | 3 +- shell/browser/ui/inspectable_web_contents.cc | 3 ++ spec/webview-spec.ts | 4 +- 68 files changed, 248 insertions(+), 220 deletions(-) create mode 100644 patches/node/fix_adapt_generator_tostringtag_prototype_to_v8.patch diff --git a/DEPS b/DEPS index 009d5b633bcce..6c89ee897f9c9 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ gclient_gn_args_from = 'src' vars = { 'chromium_version': - '117.0.5897.0', + '117.0.5911.0', 'node_version': 'v18.16.1', 'nan_version': diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index aa28cc6721356..e44ed98478748 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -177,6 +177,7 @@ static_library("chrome") { "//chrome/app/vector_icons", "//chrome/browser:resource_prefetch_predictor_proto", "//chrome/browser/resource_coordinator:mojo_bindings", + "//chrome/browser/web_applications/mojom:mojom_web_apps_enum", "//components/vector_icons:vector_icons", "//ui/snapshot", "//ui/views/controls/webview", diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index 87d8338382b1c..69409308c0419 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -23,7 +23,7 @@ index 103a9d9fb17e954ecaf0acecaa3eeafc23e39c94..de299316216dba204decba3b0eb57f5c int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 49d960da588af130304df1b45dda6dc05f58d966..a7d6bd40c52ae4e010fbfa846da6f8b785dedd1a 100644 +index 6aecc6c215cb33bf4b0f2cd38a79ebeef6be527d..a1a8cde301a8ea24bae61f816cb0325a04f4994f 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -4474,6 +4474,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, @@ -79,7 +79,7 @@ index fbd5c929b323ee9d943615ed8c890d869345165d..af11f266db8d626dfbba6f16d0a906e6 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 fb229297df448dbe48e5b0ef2978bce2a8affc83..892d971c749b5bf7499c2fc246bc9d5fe5b63b79 100644 +index 62e611ec3ac95eac88d4665d2640429e9d833594..7bf646d6cd8eaf29267b6136de0952e2545ec503 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client.h +++ b/third_party/blink/renderer/core/frame/local_frame_client.h @@ -319,6 +319,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient { @@ -92,7 +92,7 @@ index fb229297df448dbe48e5b0ef2978bce2a8affc83..892d971c749b5bf7499c2fc246bc9d5f 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 fa8c26e31341b2b53879a8760ad8314a569374c6..76ba9e3761d85acdaeeb017f52e24efc3d40e9b7 100644 +index dbf7fd73a855f7d45eeeeff17582696aac66ff0d..9b489f661f524f380523e38518345e9b22eb8dec 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 @@ -283,6 +283,13 @@ void LocalFrameClientImpl::DidCreateScriptContext( @@ -110,7 +110,7 @@ index fa8c26e31341b2b53879a8760ad8314a569374c6..76ba9e3761d85acdaeeb017f52e24efc 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 9f6a7e8337a4ade6b902d36919bee58f5e461790..9a73f4ceb6111b7e8bcb607b4e8eb96ebbfb0d42 100644 +index 28e1c00e05e74d5a79f32897e57a854ff14ce7a9..1cd704b1bb53eaf226d1c72c97e3f765a4b1f10e 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 @@ -84,6 +84,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient { @@ -123,10 +123,10 @@ index 9f6a7e8337a4ade6b902d36919bee58f5e461790..9a73f4ceb6111b7e8bcb607b4e8eb96e 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 6b695ab181bc7e8a8b6ecb48ca56145ddc63d6e8..4955c7246498139a20be290a48eee234de44530e 100644 +index 1934ca82e3e26e0f5c4f2f7b417df6bcd6e66abf..1277b858f2d5b4b0a0dd1c97282eff0d763cdc2b 100644 --- a/third_party/blink/renderer/core/loader/empty_clients.h +++ b/third_party/blink/renderer/core/loader/empty_clients.h -@@ -401,6 +401,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient { +@@ -403,6 +403,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient { void DidCreateScriptContext(v8::Local, int32_t world_id) override {} diff --git a/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch b/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch index d4114822f5b2f..c0f3c6419f4ff 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 a0d000a3f7d9bfb9e42f5548d5c4c6c0bfe68b71..0d47f92855e41ab06ad2c2c5421820daae01a8a0 100644 +index a463500570c03b0461d625f4a41dfbf76e41d493..a50895d9ef0e3049130b952993d2d572012d542c 100644 --- a/ui/gtk/gtk_ui.cc +++ b/ui/gtk/gtk_ui.cc -@@ -481,12 +481,13 @@ std::unique_ptr GtkUi::CreateNavButtonProvider() { +@@ -492,12 +492,13 @@ std::unique_ptr GtkUi::CreateNavButtonProvider() { return std::make_unique(); } @@ -31,19 +31,19 @@ index a0d000a3f7d9bfb9e42f5548d5c4c6c0bfe68b71..0d47f92855e41ab06ad2c2c5421820da } diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h -index adf91ed69c33c5da4ba8cf55d7cbfc482d0762ba..404fccbbe6957ba9309955ef5e7498cdcd0411f0 100644 +index 53c02c50dac536af3f235a9d8192a92449acb9a6..5df5c3fdb62b6aa5c20715fa1d07033d0f36a23e 100644 --- a/ui/gtk/gtk_ui.h +++ b/ui/gtk/gtk_ui.h -@@ -106,7 +106,7 @@ class GtkUi : public ui::LinuxUiAndTheme { - void GetInactiveSelectionFgColor(SkColor* color) const override; +@@ -108,7 +108,7 @@ class GtkUi : public ui::LinuxUiAndTheme { bool PreferDarkTheme() const override; + void SetDarkTheme(bool dark) override; std::unique_ptr CreateNavButtonProvider() override; - ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override; + ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) override; private: using TintMap = std::map; -@@ -195,6 +195,8 @@ class GtkUi : public ui::LinuxUiAndTheme { +@@ -200,6 +200,8 @@ class GtkUi : public ui::LinuxUiAndTheme { // while Chrome is running. std::unique_ptr solid_frame_provider_; std::unique_ptr transparent_frame_provider_; @@ -171,10 +171,10 @@ index 32c3d63ae4598339965c58443a8c2d12b99fb89a..91496d957b8291cd37948e237a1cc4bf } // namespace gtk diff --git a/ui/linux/fallback_linux_ui.cc b/ui/linux/fallback_linux_ui.cc -index 5f5abeeb78372785d57315056fa61fc65a3848a9..f52f436d674ad54c9973488eec59e26d02866847 100644 +index 6d77be047e202d1b1a75c62ab829dd1131ce7f68..ee1f503a679b3e939e3f2d2417aec2182063dbd8 100644 --- a/ui/linux/fallback_linux_ui.cc +++ b/ui/linux/fallback_linux_ui.cc -@@ -136,7 +136,7 @@ FallbackLinuxUi::CreateNavButtonProvider() { +@@ -135,7 +135,7 @@ FallbackLinuxUi::CreateNavButtonProvider() { } ui::WindowFrameProvider* FallbackLinuxUi::GetWindowFrameProvider( @@ -184,12 +184,12 @@ index 5f5abeeb78372785d57315056fa61fc65a3848a9..f52f436d674ad54c9973488eec59e26d } diff --git a/ui/linux/fallback_linux_ui.h b/ui/linux/fallback_linux_ui.h -index d5b12df3f4e32aef6d974986ceeb666edecc4e11..e836f661a17f2e9916685d497ee5f487c4000661 100644 +index 9901d4939400da87610b1a960ca989eb9da6dc9b..035ab6679f9f6a9083382580bbbe7fa2420ab28d 100644 --- a/ui/linux/fallback_linux_ui.h +++ b/ui/linux/fallback_linux_ui.h @@ -67,7 +67,7 @@ class FallbackLinuxUi : public LinuxUiAndTheme { - void GetInactiveSelectionFgColor(SkColor* color) const override; bool PreferDarkTheme() const override; + void SetDarkTheme(bool dark) override; std::unique_ptr CreateNavButtonProvider() override; - ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override; + ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) override; @@ -197,10 +197,10 @@ index d5b12df3f4e32aef6d974986ceeb666edecc4e11..e836f661a17f2e9916685d497ee5f487 private: std::string default_font_family_; diff --git a/ui/linux/linux_ui.h b/ui/linux/linux_ui.h -index 82d40cb5fa1b9ad54e43502793a7d1d3e94e2ebb..6f6296c4f8334e59e1522abe291d65bb508f9541 100644 +index a47134d7fa67213e8928ce98071f85fa1bc66508..2fe17292aee5021864615abc5b60ee38d7fa0e4b 100644 --- a/ui/linux/linux_ui.h +++ b/ui/linux/linux_ui.h -@@ -273,7 +273,7 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUiTheme { +@@ -313,7 +313,7 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUiTheme { // if transparency is unsupported and the frame should be rendered opaque. // The returned object is not owned by the caller and will remain alive until // the process ends. 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 cb2aae3ac228e..cdbc5e0cb9015 100644 --- a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch +++ b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch @@ -34,10 +34,10 @@ index 180abdc9f983887c83fd9d4a596472222e9ab472..00842717a7570561ee9e3eca11190ab5 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 02a3d39508397e90133eb4adad79515d507f14ea..b292c8ced209d49ac668e68ad8ad01a1821802d3 100644 +index ae96b235b8b85abc7a8d5fc9213d90181a82faee..4974d23751093bb918ef3764289937b9da109b24 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -554,8 +554,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) { +@@ -565,8 +565,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. @@ -99,10 +99,10 @@ index 8a18ecf567cd3a6a2fb1627083a5544a93198bf4..6bb4074e033e045de164bc776f75f152 // 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 79c3ac1ae8f9a5c643fdf3f8772084afdb8ea0d2..379ff57cbfe13a05b0b4dd2341a3cbcfe453c857 100644 +index 70813fe806ce29cfeeb9ae93c06d714070404521..0913b97dd24270ff2e6e02964ea0c7536de8de22 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc -@@ -2392,6 +2392,10 @@ void WebViewImpl::SetPageLifecycleStateInternal( +@@ -2406,6 +2406,10 @@ void WebViewImpl::SetPageLifecycleStateInternal( TRACE_EVENT2("navigation", "WebViewImpl::SetPageLifecycleStateInternal", "old_state", old_state, "new_state", new_state); @@ -113,7 +113,7 @@ index 79c3ac1ae8f9a5c643fdf3f8772084afdb8ea0d2..379ff57cbfe13a05b0b4dd2341a3cbcf 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 && -@@ -3853,17 +3857,31 @@ PageScheduler* WebViewImpl::Scheduler() const { +@@ -3870,17 +3874,31 @@ PageScheduler* WebViewImpl::Scheduler() const { return GetPage()->GetPageScheduler(); } diff --git a/patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch b/patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch index f0c763ed8c961..1831e5359366d 100644 --- a/patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch +++ b/patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch @@ -47,7 +47,7 @@ index 7c13717b3d397310bc66ae77928cb4f42730496c..2980b8ddf0a58d74f98fc2136f537185 return items_[ValidateItemIndex(index)].minor_text; } diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h -index 37ae910505f1d9be97972718c160ff6ce5c979f4..ef38ce51995f07fd7a090f54387e1c6cd2f162ed 100644 +index c507638d611613f267e0e4adf09c5d050afa5267..3eb9036708d459c7657085f7ca4d55c1a181ffc3 100644 --- a/ui/base/models/simple_menu_model.h +++ b/ui/base/models/simple_menu_model.h @@ -50,6 +50,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel { diff --git a/patches/chromium/blink_local_frame.patch b/patches/chromium/blink_local_frame.patch index 26f0d44f5cb01..1ebeebd0cbb49 100644 --- a/patches/chromium/blink_local_frame.patch +++ b/patches/chromium/blink_local_frame.patch @@ -49,7 +49,7 @@ index 22c4d4e9718a503d9c7ca26a40c97149b0f8986a..6bdc2757c96a28022fda9e6f5e3b74a0 // its owning reference back to our owning LocalFrame. client_->Detached(type); diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc -index 4cb2f337c2abac9e2c3b71ef8b1e2c72631acc64..a0c8491cd204c74b9806ce2824f51126acdccb4c 100644 +index 5f5b127adaa95894722768a3300455f6c086bba7..8cb40ed9c41d438463e18793ee6dd112b59d823c 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc @@ -665,10 +665,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) { 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 523cccf624bf1..d3a867b9bcbb9 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 9cb1abe75f29fbd1510968c1e571583563d18c29..a58a36e75951c3ef366bebc11b80c6533144b2f5 100644 +index 2153df7bef066da7851bd1cc6375faaeee2f4537..1c138a0f3dfc9c99333aababe4d36b215992e731 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -202,11 +202,16 @@ if (!is_android && !is_mac) { @@ -33,10 +33,10 @@ index 9cb1abe75f29fbd1510968c1e571583563d18c29..a58a36e75951c3ef366bebc11b80c653 "//base", "//build:branding_buildflags", diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 8f717ddb019922921b46eb982680275b8f1a81d2..a44da62f31d3d48ed4492213b0aec47456958c49 100644 +index 07f0f0f97e0dc608513e7f532746f0f9a78e6a94..2dcfb98422d580908882540c01efc3cd05f164ae 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -4642,7 +4642,7 @@ static_library("browser") { +@@ -4652,7 +4652,7 @@ static_library("browser") { # On Windows, the hashes are embedded in //chrome:chrome_initial rather # than here in :chrome_dll. @@ -46,10 +46,10 @@ index 8f717ddb019922921b46eb982680275b8f1a81d2..a44da62f31d3d48ed4492213b0aec474 sources += [ "certificate_viewer_stub.cc" ] } diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index bc6f976f4c7465540afcc3441ae776628168aaef..3cc053517fa97cab165b4546b9a149a0205e17a0 100644 +index 974ec1a5cd3f06d63b4453dc719446c8b1af5787..1fe92ce6472ef393716d75ec17ee9e56d043ec4e 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -6685,7 +6685,6 @@ test("unit_tests") { +@@ -6716,7 +6716,6 @@ test("unit_tests") { deps += [ "//chrome:other_version", @@ -57,7 +57,7 @@ index bc6f976f4c7465540afcc3441ae776628168aaef..3cc053517fa97cab165b4546b9a149a0 "//chrome//services/util_win:unit_tests", "//chrome/app:chrome_dll_resources", "//chrome/app:win_unit_tests", -@@ -6711,6 +6710,10 @@ test("unit_tests") { +@@ -6742,6 +6741,10 @@ test("unit_tests") { "//ui/resources", ] @@ -68,7 +68,7 @@ index bc6f976f4c7465540afcc3441ae776628168aaef..3cc053517fa97cab165b4546b9a149a0 ldflags = [ "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll", "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll", -@@ -7664,7 +7667,6 @@ test("unit_tests") { +@@ -7695,7 +7698,6 @@ test("unit_tests") { } deps += [ @@ -76,7 +76,7 @@ index bc6f976f4c7465540afcc3441ae776628168aaef..3cc053517fa97cab165b4546b9a149a0 "//chrome/browser/apps:icon_standardizer", "//chrome/browser/apps/app_service", "//chrome/browser/apps/app_service:test_support", -@@ -7750,6 +7752,10 @@ test("unit_tests") { +@@ -7781,6 +7783,10 @@ test("unit_tests") { "//ui/webui/resources/js/browser_command:mojo_bindings", ] diff --git a/patches/chromium/build_libc_as_static_library.patch b/patches/chromium/build_libc_as_static_library.patch index cea07c765fbe0..782c6acee4e7c 100644 --- a/patches/chromium/build_libc_as_static_library.patch +++ b/patches/chromium/build_libc_as_static_library.patch @@ -32,12 +32,12 @@ index 069fdba14a56808c8db3cf76c8245dff527b0add..4a20bed0985b0f4200a7e88f9f85ad93 ] if (is_linux) { diff --git a/buildtools/third_party/libc++abi/BUILD.gn b/buildtools/third_party/libc++abi/BUILD.gn -index ecd4a007ce9ad0b1595d88d7df4ffa09af89db83..94f6b98b873a6cdda7a04192fed16e532f0856ce 100644 +index b1895ae3b8ddf5820d3dd0c294bd8b36d4b43dc7..38d32a0b11d7cf5c33ef9a481caa6dc58d2ccfde 100644 --- a/buildtools/third_party/libc++abi/BUILD.gn +++ b/buildtools/third_party/libc++abi/BUILD.gn -@@ -5,7 +5,7 @@ - import("//build/config/android/config.gni") +@@ -6,7 +6,7 @@ import("//build/config/android/config.gni") import("//build/config/c++/c++.gni") + import("//build/config/unwind.gni") -source_set("libc++abi") { +static_library("libc++abi") { diff --git a/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch b/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch index 201093c46765a..d2a1de3c08ce7 100644 --- a/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch +++ b/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch @@ -6,10 +6,10 @@ Subject: build: only use the mas build config in the required components Before landing this patch should be split into the relevant MAS patches, or at least the patch this one partially reverts diff --git a/base/BUILD.gn b/base/BUILD.gn -index aa7f2d6b3f2ff416ea42e320c6813c45ab38049d..9509ae4fb685a5b2257f34500918fbe777e2dc9b 100644 +index 173283fa984ed8a6d4fc24287e70450d2806a321..2f5b2b23a33924d8d80d2bc3ce5d9d9f550df3bf 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -1029,6 +1029,7 @@ component("base") { +@@ -1034,6 +1034,7 @@ component("base") { "//build/config/compiler:prevent_unsafe_narrowing", "//build/config/compiler:wexit_time_destructors", "//build/config/compiler:wglobal_constructors", @@ -76,7 +76,7 @@ index fa72a9170a7e41ae475b05653be99af59d4eaebb..b5c39b57a61a6595b842c52da8489bdb if (is_win) { diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 0bda4e5d18a4d1a3e504a9ced4a6046f31a0a028..abbcd619f96c4cb3245a54747a0fed2b44183281 100644 +index 183c520baa855d3065f34f3bc90c8c590237192c..7f587f6e743e312898ca81908d1f85856ef3bd09 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -56,6 +56,7 @@ source_set("browser") { @@ -112,7 +112,7 @@ index 65714a5dca013794527640645d8eb2ce36049ac6..b2df50b4cd64816ddf9c5b7e222c47b6 public_deps = [ diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn -index 7acee465256990399d3629479f3ef83c3849ae89..512ea9bb291797c6e29fd6742f239c87a2247b57 100644 +index a779b02aefe3d26e5193d6cecef1675ef5937a4d..34ddd9c1b0ef8cd6ed866cd1ba1e033b9fef6023 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn @@ -475,6 +475,7 @@ static_library("test_support") { @@ -149,10 +149,10 @@ index f619de1d332d7f0c5d6d30be17f5c6b94dadf6a3..4b1bbe5a804ef0d844eaf246942129e7 if (is_mac) { diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn -index 5cd85e75040ab619eed724eace4ade1e10b0f4bb..d95c2bb18c624054f2b0702a4fbc339e7aa3c98b 100644 +index 911cc3f4764a7a61e599a41a2dd2812d07b867f7..1257e7de947195ed6f8a9906b5a9e26a7bd6216b 100644 --- a/gpu/ipc/service/BUILD.gn +++ b/gpu/ipc/service/BUILD.gn -@@ -135,6 +135,7 @@ component("service") { +@@ -139,6 +139,7 @@ component("service") { "QuartzCore.framework", ] defines += [ "GL_SILENCE_DEPRECATION" ] @@ -251,7 +251,7 @@ index 0d3fdc9b8cdff853b54e413de98800142be332d2..de65225a25ce6d6d3ff531c5c53d2259 if (use_atk) { diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index 7d0a002dba31c5e5bdc4bbec0ef396280f0f3d89..fe61909e6228b8c2f982035ef2ccee2bef45e4e3 100644 +index 0d07c88cb9fec014b727b5294a03671d183943ea..0d869fbc084773630f63380bb87e2ae6ee5b1ea9 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn @@ -355,6 +355,7 @@ component("base") { @@ -290,7 +290,7 @@ index e66e2339ea3cb8b2b80ef3f0b09dcc53a2240339..07e11afb172ecbb24c04f25f87c11bdc if (is_win) { sources += [ diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn -index 30642c59d4ab84cbe6cc82e6b5b645cdacc07418..ca2e4c1b9064132fa9612339106d3729d79bf3cf 100644 +index 002c180d97ced4c5711f6d432c2c09108bcbc69c..6d52e99b6f9414a907fa3b74fc2930795510d086 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn @@ -686,6 +686,7 @@ component("views") { @@ -301,7 +301,7 @@ index 30642c59d4ab84cbe6cc82e6b5b645cdacc07418..ca2e4c1b9064132fa9612339106d3729 } if (is_win) { -@@ -1103,6 +1104,8 @@ source_set("test_support") { +@@ -1105,6 +1106,8 @@ source_set("test_support") { "//testing/gtest", ] diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index 6abb861ee0448..e68f891e55d8a 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 1f7b1a8ea1ed2da433b1e39b091baa3246aaf79f..15011d7efd9f1f239e425904c8c22511e49dff88 100644 +index 337c990b8a5fcce3526be405500b538ea62c2dba..587d3594c54bb395db7074b0c2e2f10fa61d682b 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -8002,6 +8002,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -8034,6 +8034,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 1f7b1a8ea1ed2da433b1e39b091baa3246aaf79f..15011d7efd9f1f239e425904c8c22511 &no_javascript_access); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index ca05449b088d1604b8f85660df2cb2ebd91bc011..90d2b872112c936ddfa8871575ac6124b88d778e 100644 +index cd8824f971af6fd092e3ac3ea2ffc80a9dc3aa44..e262b0d1b1c50b81345d6333c5190769dd35c4a8 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4261,6 +4261,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4301,6 +4301,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( auto* new_contents_impl = new_contents.get(); @@ -37,7 +37,7 @@ index ca05449b088d1604b8f85660df2cb2ebd91bc011..90d2b872112c936ddfa8871575ac6124 // 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 -@@ -4302,12 +4308,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4342,12 +4348,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( AddWebContentsDestructionObserver(new_contents_impl); } @@ -66,10 +66,10 @@ index b0b0236d58b97bae0c80998c5eff4ede5879de00..c92546b9853219bf601f550416ce392a // 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 bc0649020b011d528d0cdda3b3b84d0c3b78ce8f..76920cee42bd0378d99981a719c94150581e1527 100644 +index bd9d3b40e9aea64885014cc64f182997fe90dbdd..87bcb651c9361ec51ced9da4c7a2e259c4782ac6 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -673,6 +673,8 @@ bool ContentBrowserClient::CanCreateWindow( +@@ -674,6 +674,8 @@ bool ContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -79,10 +79,10 @@ index bc0649020b011d528d0cdda3b3b84d0c3b78ce8f..76920cee42bd0378d99981a719c94150 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 907e248848ed8efc50cbaf334df130b8aa8bb659..ce463cfe3bffbe34d567dcc154ef883a7ccbba73 100644 +index 738cf91eca91de2732d1b3d2cfef7a482a768db3..e942f9cf1fb664591264e75e80d5d93ad70be070 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -169,6 +169,7 @@ class NetworkService; +@@ -170,6 +170,7 @@ class NetworkService; class TrustedURLLoaderHeaderClient; } // namespace mojom struct ResourceRequest; @@ -148,7 +148,7 @@ index c5bda327264c330345baf7b44b4ba5c478e58952..989778079d5dc91127989e43f3ce6b25 // 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 98668c5adb4a16ef77ed6a8a718430310ed8aea4..49d960da588af130304df1b45dda6dc05f58d966 100644 +index f8e6dce7f67424322a6d14c0a188e5ebb7daea7d..6aecc6c215cb33bf4b0f2cd38a79ebeef6be527d 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -6371,6 +6371,10 @@ WebView* RenderFrameImpl::CreateNewWindow( @@ -163,10 +163,10 @@ index 98668c5adb4a16ef77ed6a8a718430310ed8aea4..49d960da588af130304df1b45dda6dc0 // moved on send. bool is_background_tab = diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc -index e0f55d75e7f39425c72a01a8117c3671a1ff98e3..2697f6e2a6343aa87d84fc6b87357787e9e57173 100644 +index 4bb1004a8a06d54850b6278de934d5f7b3d82247..989e4e964f4f845f32008ea58bbf17b4c4c7e70b 100644 --- a/content/web_test/browser/web_test_content_browser_client.cc +++ b/content/web_test/browser/web_test_content_browser_client.cc -@@ -505,6 +505,8 @@ bool WebTestContentBrowserClient::CanCreateWindow( +@@ -511,6 +511,8 @@ bool WebTestContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -176,7 +176,7 @@ index e0f55d75e7f39425c72a01a8117c3671a1ff98e3..2697f6e2a6343aa87d84fc6b87357787 bool opener_suppressed, bool* no_javascript_access) { diff --git a/content/web_test/browser/web_test_content_browser_client.h b/content/web_test/browser/web_test_content_browser_client.h -index e6b2df55b872f4cf7208aaa5755955a27e0c3eef..57a7944e476f5a287447467134f2d7a83de024a6 100644 +index cb46d458e97131cd9be38a6424558718e0b8542c..bcb3542c921d6f52d23bbfa9b02457704763366c 100644 --- a/content/web_test/browser/web_test_content_browser_client.h +++ b/content/web_test/browser/web_test_content_browser_client.h @@ -84,6 +84,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient { @@ -210,7 +210,7 @@ index bef5a989bac50c177f15f52fe87ac3790d553e85..65dcd2e3b51929400c8bfb6a98a4fb59 } // 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 22a139de0e2eab33b9e2f3e95bf5156493bf2be9..fdf1196fdaabdeebfcfe1095d139e1643c2a8cff 100644 +index 22811c82015f2ab2b7715ac503c9b5106cfd9d73..cd2336506d5826c827ce0e0fd8e17ad28217e6f7 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc @@ -2192,6 +2192,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, diff --git a/patches/chromium/chore_add_buildflag_guard_around_new_include.patch b/patches/chromium/chore_add_buildflag_guard_around_new_include.patch index a86b36f5cee2b..4173334632847 100644 --- a/patches/chromium/chore_add_buildflag_guard_around_new_include.patch +++ b/patches/chromium/chore_add_buildflag_guard_around_new_include.patch @@ -9,7 +9,7 @@ This is an experimental commit; but if it's successful, This patch should be upstreamed and then removed from electron's code. diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h -index e149a732b5d0652c87c7a9dd24119561ffa2401f..b86f1ed64c586ef6add9c2c0ab383dffdaf67439 100644 +index 4aca3728a4a3a49d41bbb1b8f036024b2afec52a..ab8f07dafa915be32fe4cc93aa6c1c8ae3801b2a 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -43,7 +43,6 @@ diff --git a/patches/chromium/chore_add_electron_deps_to_gitignores.patch b/patches/chromium/chore_add_electron_deps_to_gitignores.patch index 317201be2f9ef..16ab82bdd7e3f 100644 --- a/patches/chromium/chore_add_electron_deps_to_gitignores.patch +++ b/patches/chromium/chore_add_electron_deps_to_gitignores.patch @@ -6,10 +6,10 @@ Subject: chore: add electron deps to gitignores Makes things like "git status" quicker when developing electron locally diff --git a/.gitignore b/.gitignore -index bd657c899e9e3bd234a77b592ee0dc12d94fb646..0c2661706a0801acb08eb98c649823f3cd66941d 100644 +index 6241dd501bd423350accd2a2f0b69b5d8b7e45bd..08befddc25e17bfde46bb11e94b646e8619edf54 100644 --- a/.gitignore +++ b/.gitignore -@@ -241,6 +241,7 @@ vs-chromium-project.txt +@@ -243,6 +243,7 @@ vs-chromium-project.txt /delegate_execute /device/serial/device_serial_mojo.xml /docs/website @@ -18,7 +18,7 @@ index bd657c899e9e3bd234a77b592ee0dc12d94fb646..0c2661706a0801acb08eb98c649823f3 /google_apis/internal /googleurl diff --git a/third_party/.gitignore b/third_party/.gitignore -index 71fde6424ea0c2220cb79c5c170275874373722b..9fc6e97aa109be0c455614c10bf4bb5c21302fc1 100644 +index 414cd656ba3c210d346f0b2e84aa7a414a3754c3..c2a18f684fb82fea298b11d946946d685c23e753 100644 --- a/third_party/.gitignore +++ b/third_party/.gitignore @@ -94,6 +94,7 @@ @@ -29,7 +29,7 @@ index 71fde6424ea0c2220cb79c5c170275874373722b..9fc6e97aa109be0c455614c10bf4bb5c /elfutils/src /emoji-metadata/src /emoji-segmenter/src -@@ -203,6 +204,7 @@ +@@ -204,6 +205,7 @@ /mocha /mockito/src /nacl_sdk_binaries/ @@ -37,7 +37,7 @@ index 71fde6424ea0c2220cb79c5c170275874373722b..9fc6e97aa109be0c455614c10bf4bb5c /nasm /nearby/src /neon_2_sse/src -@@ -270,6 +272,7 @@ +@@ -271,6 +273,7 @@ /speex /sqlite/src /sqlite4java/lib/ 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 f2693270fb060..bf6cf8cdc9364 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,7 +34,7 @@ index 2e4bacce52a45b5d9d7829c1f88f82aa0bb1b4bb..f3537e89191bd2c6d9b06c9b741a1680 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 1676180ba1d1535b3cfb34f91c90da37a22f2334..1b35fd35d54aee39c486be83a6d30e922cf06325 100644 +index 27ae44f218befbfb5a8246dbabc05fe77a2b3baf..0d39d88d3084bd3f38231e476b215f29623ac1e7 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -3246,15 +3246,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, diff --git a/patches/chromium/chore_introduce_blocking_api_for_electron.patch b/patches/chromium/chore_introduce_blocking_api_for_electron.patch index 08a9508bc4514..4c0714e07e1de 100644 --- a/patches/chromium/chore_introduce_blocking_api_for_electron.patch +++ b/patches/chromium/chore_introduce_blocking_api_for_electron.patch @@ -7,7 +7,7 @@ This patch comes after Chromium removed the ScopedAllowIO API in favor of explicitly adding ScopedAllowBlocking calls as friends. diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h -index 385b540b5a4291070eff5e1e6a407223de097cdb..32fec685bc3b6631594ca3ee5922c5f49da83e45 100644 +index b88010ec63528497fc2ae0b7b3fc04c0fdd2e539..51565cbfe42bf17881c13d12facb3d982bbab335 100644 --- a/base/threading/thread_restrictions.h +++ b/base/threading/thread_restrictions.h @@ -133,6 +133,7 @@ class FirefoxProfileLock; diff --git a/patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch b/patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch index 94c9f7fb2c14d..f98a6c0432fae 100644 --- a/patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch +++ b/patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch @@ -14,7 +14,7 @@ This change patches it out to prevent the DCHECK. It can be removed once/if we see a better solution to the problem. diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc -index 6eeaf96f4f056eebe73555c46cf15436b1dcf184..cb91f11d38cca8b87b35b04fb39162b3d77acfd4 100644 +index 276d831dba64b941a80f5804669f5e9f72f359b5..5110dbb5efd152872a03f074a1e57f0c2bf4603c 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc @@ -205,7 +205,7 @@ scoped_refptr SiteInstanceImpl::CreateForGuest( diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index ef18ff58fc187..26ab5864d8f3b 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 aaaa61d5c3a1d5ade2fd355e38a3985ef5cc4e7d..b45746ba0f38a381a2ee5ca17f3a1685 } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc -index 9125b6d7e3e8771458eaa1675bf0dac8f53f7be2..11fbe3bb7d9ee7b0b1c594c5ae32573308e276a9 100644 +index 0555f16960c7c754734a9535339cbf05d5f9b0d6..7acd32a48865357dc5c08d352c009098fcfb3203 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc -@@ -1860,12 +1860,11 @@ bool Browser::IsWebContentsCreationOverridden( +@@ -1861,12 +1861,11 @@ bool Browser::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -99,10 +99,10 @@ index 9125b6d7e3e8771458eaa1675bf0dac8f53f7be2..11fbe3bb7d9ee7b0b1c594c5ae325733 WebContents* Browser::CreateCustomWebContents( diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h -index b0fdd859647548824f6e33cc1ba6dd835d90a269..bfc6f5156f32386c4b12b4ee447a5607a62fc890 100644 +index ac5c9a7b58adfb078d5a461af6be1daa4fbb7f5b..673ec4513e40b5d26823e12cfe0e2743f5de22d0 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h -@@ -881,8 +881,7 @@ class Browser : public TabStripModelObserver, +@@ -886,8 +886,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 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7 void AddNewContents(content::WebContents* source, std::unique_ptr new_contents, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 927350f823a4ed3581a1902ea3c1746baae92c37..f30fed3d18b215f0f0315bfe723791611aeb12fb 100644 +index a41d8c314019ddd26e7c549149053bae25080d68..c302ba2e69b71b58faf40bc3e622b22183b17f26 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4168,8 +4168,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4208,8 +4208,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( if (delegate_ && delegate_->IsWebContentsCreationOverridden( source_site_instance, params.window_container_type, diff --git a/patches/chromium/custom_protocols_plzserviceworker.patch b/patches/chromium/custom_protocols_plzserviceworker.patch index 8437e1bdf9db2..121ed7d5139ba 100644 --- a/patches/chromium/custom_protocols_plzserviceworker.patch +++ b/patches/chromium/custom_protocols_plzserviceworker.patch @@ -8,7 +8,7 @@ Allow registering custom protocols to handle service worker main script fetching Refs https://bugs.chromium.org/p/chromium/issues/detail?id=996511 diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc -index e22a9f481b83e04e923cbf4d6878416b958af5c6..855732eedaeef2790fb79102a5778d1226ee192d 100644 +index 0d1a5e0874546d1ead5e84a3fa7b4cbac943d1b7..54a9ca8e45b2f935463f41b68617c959b88f1247 100644 --- a/content/browser/service_worker/service_worker_context_wrapper.cc +++ b/content/browser/service_worker/service_worker_context_wrapper.cc @@ -1852,6 +1852,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest( @@ -36,7 +36,7 @@ index e22a9f481b83e04e923cbf4d6878416b958af5c6..855732eedaeef2790fb79102a5778d12 + } + if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig( - browser_context(), scope_origin)) { + browser_context(), scope)) { // If this is a Service Worker for a WebUI, the WebUI's URLDataSource @@ -1871,9 +1891,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest( features::kEnableServiceWorkersForChromeScheme) && diff --git a/patches/chromium/disable_color_correct_rendering.patch b/patches/chromium/disable_color_correct_rendering.patch index 64ca874592f68..65e60b1a1dd21 100644 --- a/patches/chromium/disable_color_correct_rendering.patch +++ b/patches/chromium/disable_color_correct_rendering.patch @@ -20,7 +20,7 @@ to deal with color spaces. That is being tracked at https://crbug.com/634542 and https://crbug.com/711107. diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc -index 8d253544e97c8bf7767ce51dda44593cea118e34..523d58c083458143c2eab5abd0e81251cd99bdc5 100644 +index bff2acf54d5ee55075723db70af22dccab5d6097..c6fa4ef0a5fdaae81c91f4cc95711ce22966d7f6 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1867,6 +1867,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( @@ -81,10 +81,10 @@ index e4deb71ea3afa1ef9d6ddac9c61f5916ff608514..d2e6854ac2aaa3cc83c0b72ebc03193b !command_line->HasSwitch(switches::kUIDisablePartialSwap); diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc -index 7891c0d116ef4e9b080746698be0c71b6f9a8595..e5a2ac168bf1fdbfc2c0c64f5c8b03efb56db347 100644 +index 9d7e9780c3ae58b45b2f443e48175254dd3f480b..6a276759550e6f80740875df654a136cd89ef189 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc -@@ -227,6 +227,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus( +@@ -228,6 +228,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus( // Command-line switches to propagate to the GPU process. static const char* const kSwitchNames[] = { diff --git a/patches/chromium/disable_compositor_recycling.patch b/patches/chromium/disable_compositor_recycling.patch index 05ae1034d071a..cb04037544c41 100644 --- a/patches/chromium/disable_compositor_recycling.patch +++ b/patches/chromium/disable_compositor_recycling.patch @@ -6,7 +6,7 @@ Subject: fix: disabling compositor recycling Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron. diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index 726d2c933c8f72ae364ce55c76abeec33caaa2b5..82546a3dc008276ad2fe5e792d3202953cd2adf8 100644 +index f9d1b5d75d88eddc51bbabca4cb0571d8f5882ab..9bcc38946c670b807e8835be5bf28c00bb0c2668 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -532,7 +532,11 @@ diff --git a/patches/chromium/disable_hidden.patch b/patches/chromium/disable_hidden.patch index 848d527ea2a6b..420f3c53a4f11 100644 --- a/patches/chromium/disable_hidden.patch +++ b/patches/chromium/disable_hidden.patch @@ -33,10 +33,10 @@ index b60b9a5d403bd8be11a6132f630954b53e9de571..beb2af696d0f6585648b65f70ef5b68b protected: // |routing_id| must not be MSG_ROUTING_NONE. 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 fc773d1601a7fae8bf4a70b0d277f36e1f091a6f..02a3d39508397e90133eb4adad79515d507f14ea 100644 +index e3a86d56dee37c990c71403515013558f9fdfafb..ae96b235b8b85abc7a8d5fc9213d90181a82faee 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc -@@ -606,7 +606,7 @@ void RenderWidgetHostViewAura::HideImpl() { +@@ -617,7 +617,7 @@ void RenderWidgetHostViewAura::HideImpl() { DCHECK(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 d88db568e3d3e..4d402b9f38921 100644 --- a/patches/chromium/enable_reset_aspect_ratio.patch +++ b/patches/chromium/enable_reset_aspect_ratio.patch @@ -19,7 +19,7 @@ index 53c1d25e3f56daa9d7929089620c9df7971ceda6..d90c652d7c572686bf54c4d282960ea4 excluded_margin); } diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index bb3e9c6759cef48ac2993145d5993cbc7e640805..642945e5f30942088189c3085d9efe16d774999e 100644 +index a32b8e9f61e85cca548e2b3b2cf7cd65b1c6ba52..812663feb8ba48dd170406bc463c8c286eec6882 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -1154,8 +1154,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen, diff --git a/patches/chromium/expose_setuseragent_on_networkcontext.patch b/patches/chromium/expose_setuseragent_on_networkcontext.patch index 22853e21e7d36..d7896254fdb4f 100644 --- a/patches/chromium/expose_setuseragent_on_networkcontext.patch +++ b/patches/chromium/expose_setuseragent_on_networkcontext.patch @@ -33,7 +33,7 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4 } // namespace net diff --git a/services/network/network_context.cc b/services/network/network_context.cc -index 4d50f0bf3462d906f1a1820f8a04f5fc2885b0e0..9058001a7ecbe75af9269b6cdf30455ebe3f3365 100644 +index a07eed86e0845bb63bb9b4f8f952c02a3cbaba1c..fb93eab3c9ee2c67b48b01017318d3cdec21483f 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc @@ -1505,6 +1505,13 @@ void NetworkContext::SetNetworkConditions( @@ -51,7 +51,7 @@ index 4d50f0bf3462d906f1a1820f8a04f5fc2885b0e0..9058001a7ecbe75af9269b6cdf30455e // 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 253cbf3f2dd5c69e2bb03991cd75a8573a900c9e..3226a24e9e6a2a0136be143966029081bf7f5876 100644 +index 1f18813a6a27c24c915f7b0d40c1d4f5d88d062b..0a117e03c9c040b2c9736d3d9643bc20a2509e36 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h @@ -317,6 +317,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext @@ -63,10 +63,10 @@ index 253cbf3f2dd5c69e2bb03991cd75a8573a900c9e..3226a24e9e6a2a0136be143966029081 void SetEnableReferrers(bool enable_referrers) override; #if BUILDFLAG(IS_CHROMEOS) diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index aae713bf0b77e22ec0c516da780df54a62b7ef72..5fbc60c85ccdc95beefdab2026f5ff8f169fa9a4 100644 +index 055f212db4a53cd1283e4d5bed8377cb34aff81a..a489d82156ccbf6e358a795d5cf9e7b3c2eaec47 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -1211,6 +1211,9 @@ interface NetworkContext { +@@ -1216,6 +1216,9 @@ interface NetworkContext { SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id, NetworkConditions? conditions); @@ -77,7 +77,7 @@ index aae713bf0b77e22ec0c516da780df54a62b7ef72..5fbc60c85ccdc95beefdab2026f5ff8f SetAcceptLanguage(string new_accept_language); diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h -index f57865a13047689262b6652245900aded73b4860..0f675ef272d31f92316b3ae323f43d8eba5d2eb2 100644 +index 216e7780e0ec29298cd56e04f67697702072e2f3..d8f4a4a3f85efd54320121e335787696354c30af 100644 --- a/services/network/test/test_network_context.h +++ b/services/network/test/test_network_context.h @@ -144,6 +144,7 @@ class TestNetworkContext : public mojom::NetworkContext { diff --git a/patches/chromium/extend_apply_webpreferences.patch b/patches/chromium/extend_apply_webpreferences.patch index 6d4350963c67e..e8a5f23653811 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 379ff57cbfe13a05b0b4dd2341a3cbcfe453c857..8de0090eb12b66e6a34ae7512245405100b70193 100644 +index 0913b97dd24270ff2e6e02964ea0c7536de8de22..2829b0855b5cf1499c6146a05b1bed0bb61d9936 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -165,6 +165,7 @@ @@ -23,7 +23,7 @@ index 379ff57cbfe13a05b0b4dd2341a3cbcfe453c857..8de0090eb12b66e6a34ae75122454051 #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" -@@ -1771,6 +1772,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs, +@@ -1785,6 +1786,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_set_theme_source_to_allow_apps_to.patch b/patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch index baf503b524d1f..72d9c69cca6ae 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 @@ -62,10 +62,10 @@ index 8c761ec5303bf5057a3d48f16b7e476a75f69b76..481480a6404459bbd87e2a079f029143 SEQUENCE_CHECKER(sequence_checker_); }; diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index 87807be3558a2fdd222241b046718f9f1f0b7858..dcff51e17f5215d62c62141f2b63f26501e59d09 100644 +index d3f9fcbed28f92a113fc2734cc0789e663ccfff9..7c71f93a8aaff618e59a2477b0608f0e437b9b44 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -623,6 +623,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { +@@ -632,6 +632,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_configure_launch_options_for_service_process.patch b/patches/chromium/feat_configure_launch_options_for_service_process.patch index b6aee218935ae..a762065fba43c 100644 --- a/patches/chromium/feat_configure_launch_options_for_service_process.patch +++ b/patches/chromium/feat_configure_launch_options_for_service_process.patch @@ -627,7 +627,7 @@ index cb43aa14c9742f3788ae58c3e49b890cd532f327..6a738f7aade504f2ff3bb6647a0da8f8 #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 490ecf09ab4736ef3bb30b63f50e25a4448df493..190309e482e90db1a66ca00acbf88bb5f79689a8 100644 +index 8a130451b14772e2f4280403576b4d3d3d5827ff..c5aab674d99f7c8b38e477eea56dad33bc234930 100644 --- a/sandbox/policy/win/sandbox_win.cc +++ b/sandbox/policy/win/sandbox_win.cc @@ -697,11 +697,9 @@ ResultCode GenerateConfigForSandboxedProcess(const base::CommandLine& cmd_line, @@ -643,7 +643,7 @@ index 490ecf09ab4736ef3bb30b63f50e25a4448df493..190309e482e90db1a66ca00acbf88bb5 // Network process runs in a job even when unsandboxed. This is to ensure it // does not outlive the browser, which could happen if there is a lot of I/O // on process shutdown, in which case TerminateProcess can fail. See -@@ -931,7 +929,7 @@ bool SandboxWin::InitTargetServices(TargetServices* target_services) { +@@ -930,7 +928,7 @@ bool SandboxWin::InitTargetServices(TargetServices* target_services) { ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( const base::CommandLine& cmd_line, const std::string& process_type, @@ -652,7 +652,7 @@ index 490ecf09ab4736ef3bb30b63f50e25a4448df493..190309e482e90db1a66ca00acbf88bb5 SandboxDelegate* delegate, TargetPolicy* policy) { const base::CommandLine& launcher_process_command_line = -@@ -945,7 +943,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( +@@ -944,7 +942,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( } // Add any handles to be inherited to the policy. @@ -661,7 +661,7 @@ index 490ecf09ab4736ef3bb30b63f50e25a4448df493..190309e482e90db1a66ca00acbf88bb5 policy->AddHandleToShare(handle); if (!policy->GetConfig()->IsConfigured()) { -@@ -960,6 +958,13 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( +@@ -959,6 +957,13 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( // have no effect. These calls can fail with SBOX_ERROR_BAD_PARAMS. policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE)); policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE)); @@ -675,7 +675,7 @@ index 490ecf09ab4736ef3bb30b63f50e25a4448df493..190309e482e90db1a66ca00acbf88bb5 #endif if (!delegate->PreSpawnTarget(policy)) -@@ -972,7 +977,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( +@@ -971,7 +976,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( ResultCode SandboxWin::StartSandboxedProcess( const base::CommandLine& cmd_line, const std::string& process_type, @@ -684,7 +684,7 @@ index 490ecf09ab4736ef3bb30b63f50e25a4448df493..190309e482e90db1a66ca00acbf88bb5 SandboxDelegate* delegate, base::Process* process) { const base::ElapsedTimer timer; -@@ -980,13 +985,13 @@ ResultCode SandboxWin::StartSandboxedProcess( +@@ -979,13 +984,13 @@ ResultCode SandboxWin::StartSandboxedProcess( // Avoid making a policy if we won't use it. if (IsUnsandboxedProcess(delegate->GetSandboxType(), cmd_line, *base::CommandLine::ForCurrentProcess())) { 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 9df7a3d5b078a..0fd30f2e3b9ba 100644 --- a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch +++ b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch @@ -589,7 +589,7 @@ index 29936bca703b86fee89e2b7f35c64a47cd60770b..7fb5a0082bae7d8e06ca8588129d34e8 // Sends the created child window to the browser process so that it can be diff --git a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom -index f4c967e69e91a09c3cdb3295f353939e77ae1afb..eb87b444ec2f3142e19765f5a27c2cbe76141f5b 100644 +index 3457931b597b96587294a06c6976fb4d64a7bd31..5c058dc459c3b9aaf1f959f920b7e9ad3a807da5 100644 --- a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom +++ b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom @@ -32,6 +32,7 @@ struct RootCompositorFrameSinkParams { 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 55e4147f41681..b14a00b8e205a 100644 --- a/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch +++ b/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch @@ -37,7 +37,7 @@ index d5239af9a83d408ed8e6e71daa3e2458318ed0df..2fdaf6813ccec6e7cba074ffd7e3c01f allow_cookies_from_browser == other.allow_cookies_from_browser && client_security_state == other.client_security_state; diff --git a/services/network/public/cpp/resource_request.h b/services/network/public/cpp/resource_request.h -index 220b29c9806b3446602b943780a7d28d45d0dfa0..278e3396e9a3507b38936e4818fec931b3bf212a 100644 +index 9ccc46def23013c59a7e32a8395976896d313fac..1dc6a0b40d5790bc5491c2e530536297d5dd2ced 100644 --- a/services/network/public/cpp/resource_request.h +++ b/services/network/public/cpp/resource_request.h @@ -69,6 +69,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest { @@ -49,7 +49,7 @@ index 220b29c9806b3446602b943780a7d28d45d0dfa0..278e3396e9a3507b38936e4818fec931 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 826e4f94538f9130d2af89c47828755396286e3b..15c41429fbeeff49cdc9dec6baebe2acfd7c9179 100644 +index f5e0f664fe4a1d90fc3667b40a61ba7234a21500..8a5c2902ab2614beb3a56db3f443bb264b7d311f 100644 --- a/services/network/public/cpp/url_request_mojom_traits.cc +++ b/services/network/public/cpp/url_request_mojom_traits.cc @@ -93,6 +93,7 @@ bool StructTraits>(); out->trust_token_observer = data.TakeTrustTokenObserver< diff --git a/services/network/public/cpp/url_request_mojom_traits.h b/services/network/public/cpp/url_request_mojom_traits.h -index 30ed2e17dce5fb4edf2460e1ada2eb6224206908..1793afebe4b98c086932810bae6ed45df59d5ff7 100644 +index f6c5b4ac1080322100271ab79cee1f0c91991842..532cdbf4275db4c8ccc7ddae8ef6b8338d85662c 100644 --- a/services/network/public/cpp/url_request_mojom_traits.h +++ b/services/network/public/cpp/url_request_mojom_traits.h @@ -73,6 +73,10 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) @@ -76,7 +76,7 @@ index 30ed2e17dce5fb4edf2460e1ada2eb6224206908..1793afebe4b98c086932810bae6ed45d cookie_observer( const network::ResourceRequest::TrustedParams& trusted_params) { diff --git a/services/network/public/mojom/url_request.mojom b/services/network/public/mojom/url_request.mojom -index 40fa3f76df8e43d9d78232ea3d88efc77cf4a5ee..fa06e397abd87156e0a32da3629ec566444d0305 100644 +index f55d482a500ee65b8bb738032b6afd3201d26fb3..e6d21f25c63710f0615ec6dd29635173fd7b5dc9 100644 --- a/services/network/public/mojom/url_request.mojom +++ b/services/network/public/mojom/url_request.mojom @@ -74,6 +74,9 @@ struct TrustedUrlRequestParams { @@ -112,10 +112,10 @@ index d0df2913c2e5102cfd1e1ff140e6c95d168900bd..830f90a83774e32116757f8a3b959849 string mime_type; diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc -index 94298f56fdd0bfb354ecdbfb482fb5117191fdae..2b0492d9a5caa54bd5f7bf6b05d351fc8a376d8c 100644 +index 20aa446062cb39a22bbb78f3e11ec3c724a34882..b454c3b692296718bf1e35d8a1bd69b4989705d0 100644 --- a/services/network/url_loader.cc +++ b/services/network/url_loader.cc -@@ -662,6 +662,7 @@ URLLoader::URLLoader( +@@ -660,6 +660,7 @@ URLLoader::URLLoader( has_user_activation_ = request.trusted_params->has_user_activation; allow_cookies_from_browser_ = request.trusted_params->allow_cookies_from_browser; @@ -123,7 +123,7 @@ index 94298f56fdd0bfb354ecdbfb482fb5117191fdae..2b0492d9a5caa54bd5f7bf6b05d351fc } // Store any cookies passed from the browser process to later attach them to -@@ -741,7 +742,7 @@ URLLoader::URLLoader( +@@ -737,7 +738,7 @@ URLLoader::URLLoader( &URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this))); } @@ -132,7 +132,7 @@ index 94298f56fdd0bfb354ecdbfb482fb5117191fdae..2b0492d9a5caa54bd5f7bf6b05d351fc url_request_->SetResponseHeadersCallback(base::BindRepeating( &URLLoader::SetRawResponseHeaders, base::Unretained(this))); } -@@ -1680,6 +1681,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) { +@@ -1673,6 +1674,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) { } response_ = BuildResponseHead(); diff --git a/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch b/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch index e8fa1085114b7..d258cfc51b7be 100644 --- a/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch +++ b/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch @@ -6,10 +6,10 @@ Subject: fix: allow guest webcontents to enter fullscreen This can be upstreamed, a guest webcontents can't technically become the focused webContents. This DCHECK should allow all guest webContents to request fullscreen entrance. diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 1d80b423f5a3d5bdabb1195532fa78a6e5b2f1f7..ba7ad5ef92d266ee8325ac48faac9dd5f47a2e24 100644 +index 6a119a6179cc242a63cb6fcc7c4974dd15b721df..1ef7b6fc8de9200c88da456c7eda6de9c5eee9a4 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3665,7 +3665,7 @@ void WebContentsImpl::EnterFullscreenMode( +@@ -3705,7 +3705,7 @@ void WebContentsImpl::EnterFullscreenMode( OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode"); DCHECK(CanEnterFullscreenMode(requesting_frame, options)); DCHECK(requesting_frame->IsActive()); diff --git a/patches/chromium/fix_aspect_ratio_with_max_size.patch b/patches/chromium/fix_aspect_ratio_with_max_size.patch index 2f7e90e355d75..1937d2cce931b 100644 --- a/patches/chromium/fix_aspect_ratio_with_max_size.patch +++ b/patches/chromium/fix_aspect_ratio_with_max_size.patch @@ -11,7 +11,7 @@ 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 642945e5f30942088189c3085d9efe16d774999e..1676180ba1d1535b3cfb34f91c90da37a22f2334 100644 +index 812663feb8ba48dd170406bc463c8c286eec6882..27ae44f218befbfb5a8246dbabc05fe77a2b3baf 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -3798,14 +3798,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param, 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 17bedd7d858a8..2f71e41a60f9a 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 @@ -17,10 +17,10 @@ policy->CanCommitOriginAndUrl. 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 2f5bd34117ebb65c067d5d7fd1ebc79f1384139c..8a50f05c9a07a71125ec3dbd68f7e163f4e53a00 100644 +index 4c87713a727a2552ad4c8d06ad6ac08a4e92f89a..972f1b9152fc74ed34012971e7671a9b49ce3244 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -7373,10 +7373,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { +@@ -7383,10 +7383,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { if (IsForMhtmlSubframe()) return origin_with_debug_info; @@ -37,10 +37,10 @@ index 2f5bd34117ebb65c067d5d7fd1ebc79f1384139c..8a50f05c9a07a71125ec3dbd68f7e163 } diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h -index fad260b0c41f65daeb5ac07dfcf3ac5704aa0f85..f84481acba3d4c668fcd0c1cf4cdf341819ac5dc 100644 +index 93ebbbccba69fa1090feb8c02138f25471bf89d9..556ed4f9bb392de7e88519aa87a2a13a5158647d 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h -@@ -2951,6 +2951,17 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -2952,6 +2952,17 @@ class CONTENT_EXPORT RenderFrameHostImpl // last committed document. CookieChangeListener::CookieChangeInfo GetCookieChangeInfo(); @@ -58,7 +58,7 @@ index fad260b0c41f65daeb5ac07dfcf3ac5704aa0f85..f84481acba3d4c668fcd0c1cf4cdf341 // Sets a ResourceCache in the renderer. `this` must be active and there must // be no pending navigation. `remote` must have the same and process // isolation policy. -@@ -3342,17 +3353,6 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -3343,17 +3354,6 @@ class CONTENT_EXPORT RenderFrameHostImpl // relevant. void ResetWaitingState(); diff --git a/patches/chromium/fix_crash_on_nativetheme_change_during_context_menu_close.patch b/patches/chromium/fix_crash_on_nativetheme_change_during_context_menu_close.patch index 07dc831e9072d..6717c624823a8 100644 --- a/patches/chromium/fix_crash_on_nativetheme_change_during_context_menu_close.patch +++ b/patches/chromium/fix_crash_on_nativetheme_change_during_context_menu_close.patch @@ -15,10 +15,10 @@ This should be upstreamed, as other uses of MenuController in this file do check for menu controller being null. diff --git a/ui/views/controls/menu/menu_scroll_view_container.cc b/ui/views/controls/menu/menu_scroll_view_container.cc -index 76bb4863858fb1bde1288b3d1b1d07f151a2f801..dc0dd45da0097330612a0810fcd2bd18f5c42be4 100644 +index 715bdbc16aab70e7feccb45d920ad35852380be8..b9daba6e778f9756b2bec0fabecc03cd7be30041 100644 --- a/ui/views/controls/menu/menu_scroll_view_container.cc +++ b/ui/views/controls/menu/menu_scroll_view_container.cc -@@ -402,8 +402,7 @@ void MenuScrollViewContainer::CreateDefaultBorder() { +@@ -391,8 +391,7 @@ void MenuScrollViewContainer::CreateDefaultBorder() { MenuController* menu_controller = content_view_->GetMenuItem()->GetMenuController(); const MenuConfig& menu_config = MenuConfig::instance(); @@ -28,7 +28,7 @@ index 76bb4863858fb1bde1288b3d1b1d07f151a2f801..dc0dd45da0097330612a0810fcd2bd18 int padding = menu_config.use_outer_border && corner_radius_ > 0 ? kBorderPaddingDueToRoundedCorners : 0; -@@ -418,8 +417,9 @@ void MenuScrollViewContainer::CreateDefaultBorder() { +@@ -407,8 +406,9 @@ void MenuScrollViewContainer::CreateDefaultBorder() { int bottom_inset = GetFootnote() ? 0 : vertical_inset; if (menu_config.use_outer_border) { 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 761687c8d6b84..7cf35fd9e9d10 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 487404691947badb9e73e2553c4ed8fd6ab0a502..a588e1806e489e65eca0282af1bb08885bdcd73e 100644 +index b68423ffe09246ec7ba2935873774c7c452b5952..936ab4b4e12546ca93da27f264559c97f51509ae 100644 --- a/chrome/browser/resources/pdf/pdf_viewer.ts +++ b/chrome/browser/resources/pdf/pdf_viewer.ts -@@ -903,26 +903,12 @@ export class PdfViewerElement extends PdfViewerBaseElement { +@@ -895,26 +895,12 @@ export class PdfViewerElement extends PdfViewerBaseElement { dataArray = [result.dataToSave]; } @@ -48,7 +48,7 @@ index 487404691947badb9e73e2553c4ed8fd6ab0a502..a588e1806e489e65eca0282af1bb0888 } /** -@@ -1030,30 +1016,12 @@ export class PdfViewerElement extends PdfViewerBaseElement { +@@ -1022,30 +1008,12 @@ export class PdfViewerElement extends PdfViewerBaseElement { fileName = fileName + '.pdf'; } diff --git a/patches/chromium/fix_export_zlib_symbols.patch b/patches/chromium/fix_export_zlib_symbols.patch index dae5004d163b3..548608a59d68e 100644 --- a/patches/chromium/fix_export_zlib_symbols.patch +++ b/patches/chromium/fix_export_zlib_symbols.patch @@ -6,7 +6,7 @@ Subject: fix: export zlib symbols This patch sets ZLIB_DLL so that we properly export zlib symbols. diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn -index 074c2720fa460d9b7106e09eb7ee53efcb13af4c..b88649b77805d045f80a346a2d9a0a4438f0afa3 100644 +index ecf2a095bcb9b1443e299ecdf9eaa429afa3409b..39bd91489ee96b250cdb6a7f8bb4cea2af33f705 100644 --- a/third_party/zlib/BUILD.gn +++ b/third_party/zlib/BUILD.gn @@ -321,6 +321,10 @@ component("zlib") { 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 2a23182364f2e..1f9b6981c52bf 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 @@ -45,10 +45,10 @@ index ed0641b888c6421b1791c086466bd9c158e9109d..3760b3823d5af3325017bb53f5b1d38e // RenderFrameMetadataProvider::Observer implementation. void OnRenderFrameMetadataChangedBeforeActivation( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index ba7ad5ef92d266ee8325ac48faac9dd5f47a2e24..e869e6679df69bf0649cc4aa66f6875f0f881c36 100644 +index 1ef7b6fc8de9200c88da456c7eda6de9c5eee9a4..a784ffaf63b3b395ad2d0c8d712c434643066291 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -8206,7 +8206,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( +@@ -8268,7 +8268,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( "WebContentsImpl::OnFocusedElementChangedInFrame", "render_frame_host", frame); RenderWidgetHostViewBase* root_view = diff --git a/patches/chromium/fix_remove_caption-removing_style_call.patch b/patches/chromium/fix_remove_caption-removing_style_call.patch index 0d1343441f9fe..9f8881ba90a34 100644 --- a/patches/chromium/fix_remove_caption-removing_style_call.patch +++ b/patches/chromium/fix_remove_caption-removing_style_call.patch @@ -18,7 +18,7 @@ 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 1b35fd35d54aee39c486be83a6d30e922cf06325..7cf9f6b73757cf4ed189aefa6d32a25ed8cfb457 100644 +index 0d39d88d3084bd3f38231e476b215f29623ac1e7..bf967adcc74c1c97036e7f9d01e7afe3eb141a78 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -1873,7 +1873,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { 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 401cfba76a96e..74899f38cf91a 100644 --- a/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch +++ b/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch @@ -64,10 +64,10 @@ index 4cd668a127a50e5462e3878c3f1dcb7384926768..dfbec49249404df8f8ebdbd26e6e865c #endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc -index a0c8491cd204c74b9806ce2824f51126acdccb4c..2f296993a48c3ec7e32ce709ae73a960507f9db3 100644 +index 8cb40ed9c41d438463e18793ee6dd112b59d823c..5152b1ec34e2bcbec693ffa386f50dfcf8ff7656 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc -@@ -2781,6 +2781,7 @@ void LocalFrame::RequestExecuteScript( +@@ -2782,6 +2782,7 @@ void LocalFrame::RequestExecuteScript( mojom::blink::EvaluationTiming evaluation_timing, mojom::blink::LoadEventBlockingOption blocking_option, WebScriptExecutionCallback callback, @@ -75,7 +75,7 @@ index a0c8491cd204c74b9806ce2824f51126acdccb4c..2f296993a48c3ec7e32ce709ae73a960 BackForwardCacheAware back_forward_cache_aware, mojom::blink::WantResultOption want_result_option, mojom::blink::PromiseResultOption promise_behavior) { -@@ -2814,7 +2815,7 @@ void LocalFrame::RequestExecuteScript( +@@ -2815,7 +2816,7 @@ void LocalFrame::RequestExecuteScript( PausableScriptExecutor::CreateAndRun( script_state, std::move(script_sources), execute_script_policy, user_gesture, evaluation_timing, blocking_option, want_result_option, @@ -97,7 +97,7 @@ index 49c9b337166c5a677a0ebd7e494f539864771bce..8a34090a26df330bf46459b4dd3e9571 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 4a40473c167290328b6c2c0e9029c3d7c073fe44..f91e9eaab57aef9c202be8342281fa7d65fcbb8b 100644 +index 57e1e45f9c8aa0dbae982ab4e921d2a785841c22..e2cdf0c00cf165cbd8f7f2279ddffcd2b71c0fda 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 @@ -935,6 +935,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld( 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 f508dccd4ef59..3c123909125ab 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,10 +6,10 @@ 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 1bd7d23e8d95389ba1139fdf988d190c95dcb8a5..0670e389e88e354b86837e3263c4dab44cd61c04 100644 +index 8042e113c85f475d44463df93e8c80a19b322d16..3d6b6b45a142419379a574701a0629b5f061dbfd 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc -@@ -568,6 +568,7 @@ void MenuController::Run(Widget* parent, +@@ -564,6 +564,7 @@ void MenuController::Run(Widget* parent, MenuAnchorPosition position, bool context_menu, bool is_nested_drag, @@ -17,7 +17,7 @@ index 1bd7d23e8d95389ba1139fdf988d190c95dcb8a5..0670e389e88e354b86837e3263c4dab4 gfx::NativeView native_view_for_gestures) { exit_type_ = ExitType::kNone; possible_drag_ = false; -@@ -632,6 +633,14 @@ void MenuController::Run(Widget* parent, +@@ -628,6 +629,14 @@ void MenuController::Run(Widget* parent, // Set the selection, which opens the initial menu. SetSelection(root, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY); @@ -32,7 +32,7 @@ index 1bd7d23e8d95389ba1139fdf988d190c95dcb8a5..0670e389e88e354b86837e3263c4dab4 if (button_controller) { pressed_lock_ = button_controller->TakeLock( false, ui::LocatedEvent::FromIfValid(event)); -@@ -2256,19 +2265,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { +@@ -2251,19 +2260,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { } item->GetSubmenu()->ShowAt(params); @@ -58,10 +58,10 @@ index 1bd7d23e8d95389ba1139fdf988d190c95dcb8a5..0670e389e88e354b86837e3263c4dab4 item->GetSubmenu()->GetWidget()->SetNativeWindowProperty( diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h -index 1334ad5a759dd582b14711ef609e303613efad65..bf6653cff876205268b000e28b8f3ef0f7a29eb0 100644 +index 4c3cda2db04002c65d1a0055214f2775f5678134..3f11ce3d1f9d843b24aec3a028e5ea64ca402024 100644 --- a/ui/views/controls/menu/menu_controller.h +++ b/ui/views/controls/menu/menu_controller.h -@@ -140,6 +140,7 @@ class VIEWS_EXPORT MenuController +@@ -138,6 +138,7 @@ class VIEWS_EXPORT MenuController MenuAnchorPosition position, bool context_menu, bool is_nested_drag, @@ -83,7 +83,7 @@ index adb22671b94fa16854773baad0e6bff1322c6646..fae32722f1209151fa1da59d0c7892ab bool MenuRunner::IsRunning() const { diff --git a/ui/views/controls/menu/menu_runner_impl.cc b/ui/views/controls/menu/menu_runner_impl.cc -index c2513d2889a2baabb1464a53b6b0a32176d52d0c..54f4f863d9ecdf22e3087944f773a866e6c50024 100644 +index d4cf9df424f103680e07778f4fe3e3717bea860a..2b9cfa3d30c6341a941127c9f57983a5b6367b13 100644 --- a/ui/views/controls/menu/menu_runner_impl.cc +++ b/ui/views/controls/menu/menu_runner_impl.cc @@ -116,6 +116,7 @@ void MenuRunnerImpl::RunMenuAt(Widget* parent, diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index f5afde536a368..e692e0b11e8f0 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 058d0df9fefbc4f17f41fc873fd5207fabb84429..17f63f0910c3a65aeb931220cbc03bfbc8fcc53c 100644 +index 4cd7183825cadbc50c9e54bb11a174f26ef29858..8cf9b35580bdf925253e52db04bf3a2e1b6dbd61 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc -@@ -4042,6 +4042,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -4080,6 +4080,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request->ResetStateForSiteInstanceChange(); } @@ -20,10 +20,10 @@ index 058d0df9fefbc4f17f41fc873fd5207fabb84429..17f63f0910c3a65aeb931220cbc03bfb } diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index ce463cfe3bffbe34d567dcc154ef883a7ccbba73..08fe4fc404fe39413bc6c7a66ebfa222a51ea870 100644 +index e942f9cf1fb664591264e75e80d5d93ad70be070..45bfdcbda26db9d05d80465eccd17dd6cb4913c4 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -306,6 +306,11 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -308,6 +308,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 b183c1b6b97b6..3a840185c9302 100644 --- a/patches/chromium/gin_enable_disable_v8_platform.patch +++ b/patches/chromium/gin_enable_disable_v8_platform.patch @@ -24,7 +24,7 @@ index e8608bb868c82c9af5426cd6f8512ce6b18ff39f..6268851494a0bbc0b3e693782dae6171 g_reference_table = reference_table; g_fatal_error_callback = fatal_error_callback; diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h -index 39f3c07b4a3cae39106a27fb7f867f285b1d0562..6d9dfd15e0d0589b5974afa6bb7418e499954d87 100644 +index 2ec6d9820b4cb8d91d47ab319fe6bf89be60300c..12ddcc30397a02df78727f16a02b8e81fd1d9c8e 100644 --- a/gin/public/isolate_holder.h +++ b/gin/public/isolate_holder.h @@ -109,7 +109,8 @@ class GIN_EXPORT IsolateHolder { diff --git a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch index 5be79febfd9ea..f1e4a3116fa13 100644 --- a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch +++ b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch @@ -40,7 +40,7 @@ index c57305681efb469d296c90df68b6cdbea927580d..6dda1a5465e08df64b539ee203b7c403 // Called from BrowserMainLoop::PostCreateThreads(). // TODO(content/browser/gpu/OWNERS): This should probably use a diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc -index b57b9825e8747ccb1678f07693e346aefe22b261..0ede49c42cd03fa614f0982347967a5a62d4f08d 100644 +index 6b5d083400e10497a05b7813a453a3df03af1486..566bcdfe7241d0eb61ee1856fa6896a8fd408059 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -1195,6 +1195,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { diff --git a/patches/chromium/gritsettings_resource_ids.patch b/patches/chromium/gritsettings_resource_ids.patch index 655c8bb0bf804..c91d3ae7b7bb4 100644 --- a/patches/chromium/gritsettings_resource_ids.patch +++ b/patches/chromium/gritsettings_resource_ids.patch @@ -6,10 +6,10 @@ 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 36e9375a7b656a101027e0b15de79b0d592632c7..8973dba495cb70846820383aa48979a23a77d9a3 100644 +index 77800eeb69b67daa40685d85e0ef50a90cb0aab8..33176b70e23c39fec0be4086efee319ac159fbce 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec -@@ -1189,6 +1189,11 @@ +@@ -1193,6 +1193,11 @@ "includes": [7440], }, diff --git a/patches/chromium/gtk_visibility.patch b/patches/chromium/gtk_visibility.patch index 3da27386c55d7..92594424c47e1 100644 --- a/patches/chromium/gtk_visibility.patch +++ b/patches/chromium/gtk_visibility.patch @@ -18,7 +18,7 @@ index 355067ea178bee1466f9df5a3ed146e9f09f0768..1b385d12692deece9e10722fc70215e8 # on GTK. "//examples:peerconnection_client", diff --git a/ui/ozone/platform/x11/BUILD.gn b/ui/ozone/platform/x11/BUILD.gn -index 76f399cd766add88d96499dd1c15ae841a2273da..bd0382b148fdadafcfb32a26fc3ddbfa265fa512 100644 +index 0663efec8de1066ea312297693d6cc627584cd5a..14b7f333ad12b5c96bdb5ba4ad167f19abc39793 100644 --- a/ui/ozone/platform/x11/BUILD.gn +++ b/ui/ozone/platform/x11/BUILD.gn @@ -6,7 +6,7 @@ import("//build/config/chromeos/ui_mode.gni") diff --git a/patches/chromium/introduce_ozoneplatform_electron_can_call_x11_property.patch b/patches/chromium/introduce_ozoneplatform_electron_can_call_x11_property.patch index bf39df110f233..af52292a0e193 100644 --- a/patches/chromium/introduce_ozoneplatform_electron_can_call_x11_property.patch +++ b/patches/chromium/introduce_ozoneplatform_electron_can_call_x11_property.patch @@ -21,10 +21,10 @@ index fb665685e3539eb13cde9b213960156634f987b3..e95c5883df89ad119a7229198f628acd properties->supports_global_application_menus = true; properties->app_modal_dialogs_use_event_blocker = true; diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h -index 9b342b4b189530061dd77c9bf7ea3e4387a41da1..f6d378e90a0280ed1b1da009b966fa790bc24b1d 100644 +index 85bbebb5507540d00cff2b888c4f0700e6896184..d804753419204f71c94c650527d7fceedc0c0ee3 100644 --- a/ui/ozone/public/ozone_platform.h +++ b/ui/ozone/public/ozone_platform.h -@@ -121,6 +121,10 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform { +@@ -124,6 +124,10 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform { // Linux only: determines if Skia can fall back to the X11 output device. bool skia_can_fall_back_to_x11 = false; diff --git a/patches/chromium/isolate_holder.patch b/patches/chromium/isolate_holder.patch index db5ce6c69f4ff..559f61fba3a4f 100644 --- a/patches/chromium/isolate_holder.patch +++ b/patches/chromium/isolate_holder.patch @@ -57,7 +57,7 @@ index 6268851494a0bbc0b3e693782dae6171f6347657..87ae3db7aec96577856804aa3718e53e access_mode_, task_runner); // TODO(https://crbug.com/1347092): Refactor such that caller need not diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h -index 6d9dfd15e0d0589b5974afa6bb7418e499954d87..ea0b44b8e693fcbec3a2c8c0c0ed63780f8841e1 100644 +index 12ddcc30397a02df78727f16a02b8e81fd1d9c8e..6629c29328354c911679fc6bb2af982611ecce10 100644 --- a/gin/public/isolate_holder.h +++ b/gin/public/isolate_holder.h @@ -83,13 +83,15 @@ class GIN_EXPORT IsolateHolder { diff --git a/patches/chromium/mas_disable_remote_accessibility.patch b/patches/chromium/mas_disable_remote_accessibility.patch index 881075ab12e21..a61777141ebec 100644 --- a/patches/chromium/mas_disable_remote_accessibility.patch +++ b/patches/chromium/mas_disable_remote_accessibility.patch @@ -121,7 +121,7 @@ index b803e5f1e87b183d857195c007d7116ccc8e8ed7..71984ec1fe0b801041f3544c1b596a6f return false; } diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h -index 8ae8e06566ceab66bdb4226b02706df6f963e81a..b6570e0d051a021bfb5984b100712b8ec62988f3 100644 +index 43f288af24064365999da0904dcb63bd3157497d..ae67c1ab9a1d6ca8d3aa373b7ae73986ea4cf096 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h @@ -53,7 +53,9 @@ class ScopedPasswordInputEnabler; @@ -134,7 +134,7 @@ index 8ae8e06566ceab66bdb4226b02706df6f963e81a..b6570e0d051a021bfb5984b100712b8e @class RenderWidgetHostViewCocoa; namespace content { -@@ -668,9 +670,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac +@@ -669,9 +671,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac // EnsureSurfaceSynchronizedForWebTest(). uint32_t latest_capture_sequence_number_ = 0u; @@ -147,7 +147,7 @@ index 8ae8e06566ceab66bdb4226b02706df6f963e81a..b6570e0d051a021bfb5984b100712b8e // Used to force the NSApplication's focused accessibility element to be the // content::BrowserAccessibilityCocoa accessibility tree when the NSView for diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index 18c5ba6664280bcce962cc06c85984034e15345f..726d2c933c8f72ae364ce55c76abeec33caaa2b5 100644 +index be1cba15f2f1d219b9aa897c6af580e827f22211..f9d1b5d75d88eddc51bbabca4cb0571d8f5882ab 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -259,8 +259,10 @@ @@ -161,7 +161,7 @@ index 18c5ba6664280bcce962cc06c85984034e15345f..726d2c933c8f72ae364ce55c76abeec3 // Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling // pointers. `ns_view_` gets reinitialized later in this method. -@@ -1576,8 +1578,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1599,8 +1601,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, gfx::NativeViewAccessible RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() { @@ -172,7 +172,7 @@ index 18c5ba6664280bcce962cc06c85984034e15345f..726d2c933c8f72ae364ce55c76abeec3 return [GetInProcessNSView() window]; } -@@ -1621,9 +1625,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1644,9 +1648,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, } void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) { @@ -184,7 +184,7 @@ index 18c5ba6664280bcce962cc06c85984034e15345f..726d2c933c8f72ae364ce55c76abeec3 } bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame( -@@ -2125,12 +2131,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -2148,12 +2154,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken( const std::vector& window_token) { @@ -200,7 +200,7 @@ index 18c5ba6664280bcce962cc06c85984034e15345f..726d2c933c8f72ae364ce55c76abeec3 /////////////////////////////////////////////////////////////////////////////// diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index be8942dcde0a1d7832e9f5256e9f4f317f2ae9a7..7d0a002dba31c5e5bdc4bbec0ef396280f0f3d89 100644 +index 3b64831839a4c333dbb0c6c172344d6fd0d7b771..0d07c88cb9fec014b727b5294a03671d183943ea 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn @@ -372,6 +372,13 @@ component("base") { @@ -265,10 +265,10 @@ index 3dd3793920853cff31ce62c833aefff58826f88c..bc00d9099c9033a09d97e19df37ca38e // Used to force the NSApplication's focused accessibility element to be the // views::Views accessibility tree when the NSView for this is focused. diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm -index 71ac008cd085a60e8e6ea61ca26f6a5201dbfc78..f6708611f61f3006b31d3cb3a176be5415d0365e 100644 +index 5071b3625faecc8856d13227b2ec43eedca8e906..fdfaef4c1f2d4498134010d984cadb24999b4f87 100644 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm -@@ -370,7 +370,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -343,7 +343,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSView() const { if (in_process_ns_window_bridge_) return in_process_ns_window_bridge_->ns_view(); @@ -280,7 +280,7 @@ index 71ac008cd085a60e8e6ea61ca26f6a5201dbfc78..f6708611f61f3006b31d3cb3a176be54 } gfx::NativeViewAccessible -@@ -385,7 +389,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -358,7 +362,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, return [in_process_ns_window_bridge_->ns_view() window]; } @@ -292,7 +292,7 @@ index 71ac008cd085a60e8e6ea61ca26f6a5201dbfc78..f6708611f61f3006b31d3cb3a176be54 } remote_cocoa::mojom::NativeWidgetNSWindow* -@@ -1342,20 +1350,24 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -1330,20 +1338,24 @@ void HandleAccelerator(const ui::Accelerator& accelerator, void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens( const std::vector& window_token, const std::vector& view_token) { 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 07fae1fc5627c..b791a7862a508 100644 --- a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch +++ b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch @@ -7,7 +7,7 @@ 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 0018dae6caa01d9a79d23efe48bc6dbbdcc6f403..4d50f0bf3462d906f1a1820f8a04f5fc2885b0e0 100644 +index fcba565164b4879d198a03003269996e64571a96..a07eed86e0845bb63bb9b4f8f952c02a3cbaba1c 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc @@ -146,6 +146,11 @@ @@ -147,7 +147,7 @@ index 0018dae6caa01d9a79d23efe48bc6dbbdcc6f403..4d50f0bf3462d906f1a1820f8a04f5fc builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier( diff --git a/services/network/network_context.h b/services/network/network_context.h -index 4aab632d001f7839b19d00853b9b4d7538f58dda..253cbf3f2dd5c69e2bb03991cd75a8573a900c9e 100644 +index 5a6cfcf157071de3da5b485e43ef66c9feb89782..1f18813a6a27c24c915f7b0d40c1d4f5d88d062b 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h @@ -115,6 +115,7 @@ class URLMatcher; @@ -167,7 +167,7 @@ index 4aab632d001f7839b19d00853b9b4d7538f58dda..253cbf3f2dd5c69e2bb03991cd75a857 void ResetURLLoaderFactories() override; void GetViaObliviousHttp( mojom::ObliviousHttpRequestPtr request, -@@ -883,6 +886,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -887,6 +890,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext std::vector dismount_closures_; #endif // BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED) @@ -177,7 +177,7 @@ index 4aab632d001f7839b19d00853b9b4d7538f58dda..253cbf3f2dd5c69e2bb03991cd75a857 std::unique_ptr internal_host_resolver_; // Map values set to non-null only if that HostResolver has its own private diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 7829557f3088274b55677d445006ce0030543983..aae713bf0b77e22ec0c516da780df54a62b7ef72 100644 +index 17cac41687df6075647142d14fc7a5e6770afe98..055f212db4a53cd1283e4d5bed8377cb34aff81a 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom @@ -311,6 +311,17 @@ struct NetworkContextFilePaths { @@ -198,7 +198,7 @@ index 7829557f3088274b55677d445006ce0030543983..aae713bf0b77e22ec0c516da780df54a // Parameters for constructing a network context. struct NetworkContextParams { // The user agent string. -@@ -920,6 +931,9 @@ interface NetworkContext { +@@ -925,6 +936,9 @@ interface NetworkContext { // Sets a client for this network context. SetClient(pending_remote client); diff --git a/patches/chromium/notification_provenance.patch b/patches/chromium/notification_provenance.patch index 33e39ae84eb7b..a642b5f729d19 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -113,7 +113,7 @@ index 9814861ab18fa88bc781f83acb602129b6f3de1f..1c5a2efc2749697aa3d38247f491eabf } diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h -index 64de8c4a00a3297b34ca052db7ce7b4778e8407f..9742a4c069679900c3dbbe6e36e0e959f8445b42 100644 +index d0e0d10739b5daf99435a67e18dc51df8e670e09..704f3d6c2fdd27a84d1c4e1b7bf680f62c86c2d0 100644 --- a/content/browser/notifications/platform_notification_context_impl.h +++ b/content/browser/notifications/platform_notification_context_impl.h @@ -45,6 +45,7 @@ struct NotificationDatabaseData; diff --git a/patches/chromium/picture-in-picture.patch b/patches/chromium/picture-in-picture.patch index 25c41fad786ba..15b7ee0c0184a 100644 --- a/patches/chromium/picture-in-picture.patch +++ b/patches/chromium/picture-in-picture.patch @@ -9,7 +9,7 @@ don't get errors for Chrome's generated resources, which are non-existent because we don't generate them in our build. 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 311d0835a9a713b3e8ec6f0061ef0867baed730e..af182bb6aaa991cfd60d28aff56d8b95542fdc97 100644 +index 9e5e40c912c00b70d921d422ce141cd9d4a5bcd3..25b4b9cd6d4d9ff8c48fac7d04385963463d00f5 100644 --- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc @@ -14,9 +14,11 @@ diff --git a/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch b/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch index ff3dae5ed76c4..59c4c8ce44749 100644 --- a/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch +++ b/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch @@ -8,10 +8,10 @@ needed in chromium but our autofill implementation uses them. This patch can be our autofill implementation to work like Chromium's. diff --git a/ui/color/color_id.h b/ui/color/color_id.h -index 6c22af57ba0fd00d632c31778e7899d9a128b5ff..a4f476ca23d07592737649c0c9d3a8e803d17412 100644 +index d493cfc3d71338532bdaad72bae184d2e9f55280..e868644967e2bdb107eb28775b18e7f20c46ab73 100644 --- a/ui/color/color_id.h +++ b/ui/color/color_id.h -@@ -378,6 +378,10 @@ +@@ -379,6 +379,10 @@ E_CPONLY(kColorScrollbarThumbInactive) \ E_CPONLY(kColorScrollbarThumbPressed) \ E_CPONLY(kColorScrollbarTrack) \ @@ -22,7 +22,7 @@ index 6c22af57ba0fd00d632c31778e7899d9a128b5ff..a4f476ca23d07592737649c0c9d3a8e8 E_CPONLY(kColorSegmentedButtonBorder) \ E_CPONLY(kColorSegmentedButtonFocus) \ E_CPONLY(kColorSegmentedButtonForegroundChecked) \ -@@ -471,6 +475,7 @@ +@@ -472,6 +476,7 @@ E_CPONLY(kColorTreeNodeForeground) \ E_CPONLY(kColorTreeNodeForegroundSelectedFocused) \ E_CPONLY(kColorTreeNodeForegroundSelectedUnfocused) \ diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index 2ea4b2ae90136..ab24b50095189 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -11,10 +11,10 @@ majority of changes originally come from these PRs: This patch also fixes callback for manual user cancellation and success. diff --git a/BUILD.gn b/BUILD.gn -index acd08b3cc7ef4e6a8bf7836a38028d87e3e19710..2fb89b190051949a2605ae7f25567c1df6863fb5 100644 +index 357647127147f797663a7ae3b82449f58991c388..cbbb8bc6df74fb932bc669fad2dac950c9d8661f 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -973,7 +973,6 @@ if (is_win) { +@@ -971,7 +971,6 @@ if (is_win) { "//media:media_unittests", "//media/midi:midi_unittests", "//net:net_unittests", @@ -22,7 +22,7 @@ index acd08b3cc7ef4e6a8bf7836a38028d87e3e19710..2fb89b190051949a2605ae7f25567c1d "//sql:sql_unittests", "//third_party/breakpad:symupload($host_toolchain)", "//ui/base:ui_base_unittests", -@@ -982,6 +981,10 @@ if (is_win) { +@@ -980,6 +979,10 @@ if (is_win) { "//ui/views:views_unittests", "//url:url_unittests", ] @@ -705,10 +705,10 @@ index c97825d05cb7d132c9af489998f4ed8c32603c00..fde20b8a6c4811ce728abfee26b2ab7b // Tells the browser printing failed. 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 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263d30aea4e 100644 +index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad2997824a27 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc -@@ -45,6 +45,7 @@ +@@ -46,6 +46,7 @@ #include "printing/mojom/print.mojom.h" #include "printing/page_number.h" #include "printing/print_job_constants.h" @@ -716,7 +716,7 @@ index 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263 #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" -@@ -1344,7 +1345,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { +@@ -1382,7 +1383,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { if (!weak_this) return; @@ -726,7 +726,7 @@ index 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263 if (!weak_this) return; -@@ -1375,7 +1377,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( +@@ -1414,7 +1416,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( receivers_.Add(this, std::move(receiver)); } @@ -735,26 +735,26 @@ index 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263 ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr()); if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; -@@ -1390,7 +1392,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { +@@ -1430,7 +1432,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { // plugin node and print that instead. auto plugin = delegate_->GetPdfElement(frame); - Print(frame, plugin, PrintRequestType::kRegular); + Print(frame, plugin, PrintRequestType::kRegular, silent, std::move(settings)); - if (!render_frame_gone_) - frame->DispatchAfterPrintEvent(); -@@ -1469,7 +1471,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { + if (!render_frame_gone_) { + RecordBeforeAfterPrintEventForDebugging(__LINE__); +@@ -1514,7 +1516,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { } Print(frame, print_preview_context_.source_node(), - PrintRequestType::kRegular); + PrintRequestType::kRegular, false, + base::Value::Dict()); - if (!render_frame_gone_) + if (!render_frame_gone_) { + RecordBeforeAfterPrintEventForDebugging(__LINE__); print_preview_context_.DispatchAfterPrintEvent(); - // WARNING: |this| may be gone at this point. Do not do any more work here and -@@ -1520,6 +1523,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { +@@ -1567,6 +1570,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; @@ -763,7 +763,7 @@ index 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263 print_preview_context_.OnPrintPreview(); #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -2130,7 +2135,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -2183,7 +2188,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { return; Print(duplicate_node.GetDocument().GetFrame(), duplicate_node, @@ -773,7 +773,7 @@ index 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263 // Check if |this| is still valid. if (!weak_this) return; -@@ -2145,7 +2151,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -2199,7 +2205,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -784,7 +784,7 @@ index 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263 // If still not finished with earlier print request simply ignore. if (prep_frame_view_) return; -@@ -2153,7 +2161,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2207,7 +2215,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, FrameReference frame_ref(frame); uint32_t expected_page_count = 0; @@ -793,7 +793,7 @@ index 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263 DidFinishPrinting(FAIL_PRINT_INIT); return; // Failed to init print page settings. } -@@ -2172,8 +2180,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2226,8 +2234,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, print_pages_params_->params->print_scaling_option; auto self = weak_ptr_factory_.GetWeakPtr(); @@ -810,7 +810,7 @@ index 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263 // Check if |this| is still valid. if (!self) return; -@@ -2406,35 +2421,47 @@ void PrintRenderFrameHelper::IPCProcessed() { +@@ -2460,35 +2475,47 @@ void PrintRenderFrameHelper::IPCProcessed() { } } @@ -868,7 +868,7 @@ index 5d5144737eace87832ab5c44cd8e2bfdeda5dec2..d9a9b65da336f31f4d302f5363737263 return false; } -@@ -2538,7 +2565,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser( +@@ -2592,7 +2619,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser( std::move(params), base::BindOnce( [](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output, @@ -919,10 +919,10 @@ index 0fea424325081a0ef6720000841ea321b89024d0..c700de4b81fc0c157946e76faedaca6b #if BUILDFLAG(ENABLE_PRINT_PREVIEW) // Set options for print preset from source PDF document. diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 7a7bb8007ed736a44b6f5bf4318b3044c8ab6e89..0bda4e5d18a4d1a3e504a9ced4a6046f31a0a028 100644 +index e83a8746c00800ef8236a696ea1052a76ae6b2fb..183c520baa855d3065f34f3bc90c8c590237192c 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn -@@ -2911,8 +2911,9 @@ source_set("browser") { +@@ -2913,8 +2913,9 @@ source_set("browser") { "//ppapi/shared_impl", ] 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 c128aaef29b02..a3d3b459db942 100644 --- a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch +++ b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch @@ -44,10 +44,10 @@ index 7a84a4e6c65eb5b9373b0667166188d93948ad68..e621a92c42c5cd2d818bcbc99d9b3e7a void RenderWidgetHostImpl::ShowContextMenuAtPoint( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 90d2b872112c936ddfa8871575ac6124b88d778e..927350f823a4ed3581a1902ea3c1746baae92c37 100644 +index e262b0d1b1c50b81345d6333c5190769dd35c4a8..a41d8c314019ddd26e7c549149053bae25080d68 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4853,6 +4853,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { +@@ -4902,6 +4902,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { return text_input_manager_.get(); } @@ -60,7 +60,7 @@ index 90d2b872112c936ddfa8871575ac6124b88d778e..927350f823a4ed3581a1902ea3c1746b 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 6bd59cf8a582fc4204c2f5faf860310607bf7bf5..b5460de35a5e9d6242c7c8deebd896b90772f29a 100644 +index 5a95c202b96ee5e2e4a519e27c2a96b181248c07..9c55246c605adaa1f4edaa6f3396fab55328ac9e 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -994,6 +994,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, diff --git a/patches/chromium/refactor_restore_base_adaptcallbackforrepeating.patch b/patches/chromium/refactor_restore_base_adaptcallbackforrepeating.patch index 603ac7c84f4d3..4656d35f691c5 100644 --- a/patches/chromium/refactor_restore_base_adaptcallbackforrepeating.patch +++ b/patches/chromium/refactor_restore_base_adaptcallbackforrepeating.patch @@ -12,7 +12,7 @@ should be removed as soon as those have been updated. Patching because every instance is a FTBFS that prevents testing any one instance's fix. diff --git a/base/functional/callback_helpers.h b/base/functional/callback_helpers.h -index 97d181af4cefdbbfe515a61c68d090c89d718484..626113d6645d0c046ad2b7087fb5e9b618d18026 100644 +index a04ff2452a68096bee9673d08bfa66b2fca8e7ba..098ef69594f2450a937d658f8fa710877a04481d 100644 --- a/base/functional/callback_helpers.h +++ b/base/functional/callback_helpers.h @@ -98,6 +98,22 @@ class OnceCallbackHolder final { diff --git a/patches/chromium/render_widget_host_view_base.patch b/patches/chromium/render_widget_host_view_base.patch index 77d4f9333d5af..e53fb1ecd37bd 100644 --- a/patches/chromium/render_widget_host_view_base.patch +++ b/patches/chromium/render_widget_host_view_base.patch @@ -6,10 +6,10 @@ 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 f1d50fba17a0a7be9e183467863ad9555438d1f6..8ebc730affa1ecd09426aa23c22f55f95bf07162 100644 +index 74ec46063f18be47e9cc5ed35194e51dcc733ae8..923e1bfcb9a0f19aae8dc7d763b2472f34301417 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc -@@ -684,6 +684,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( +@@ -683,6 +683,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( return false; } @@ -24,7 +24,7 @@ index f1d50fba17a0a7be9e183467863ad9555438d1f6..8ebc730affa1ecd09426aa23c22f55f9 const blink::WebMouseEvent& event, const ui::LatencyInfo& latency) { diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h -index aed9a4aaa7c9fd320cc9527e5afa85676025ea60..af24500c65b7ecae80fd33c580d22b07876ab12b 100644 +index 6c1196ed1af86525e899fc0dfb7606a1e8666ccf..d0c9b6d927dc73bf8579ecebe2160f5d9119ced5 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -25,8 +25,11 @@ diff --git a/patches/chromium/resource_file_conflict.patch b/patches/chromium/resource_file_conflict.patch index bf3dd472d07b5..950e50fc115c1 100644 --- a/patches/chromium/resource_file_conflict.patch +++ b/patches/chromium/resource_file_conflict.patch @@ -52,7 +52,7 @@ 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 15beb12c5c9702c5f67fdc2bf127de7bc31631fa..9cb1abe75f29fbd1510968c1e571583563d18c29 100644 +index 75d9891502495a10262dad85f90f2c286b146be1..2153df7bef066da7851bd1cc6375faaeee2f4537 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -1617,7 +1617,7 @@ if (is_chrome_branded && !is_android) { diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index dde90ce81f672..6d6bc57adad67 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 f30fed3d18b215f0f0315bfe723791611aeb12fb..1d80b423f5a3d5bdabb1195532fa78a6e5b2f1f7 100644 +index c302ba2e69b71b58faf40bc3e622b22183b17f26..6a119a6179cc242a63cb6fcc7c4974dd15b721df 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3274,6 +3274,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3314,6 +3314,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 f30fed3d18b215f0f0315bfe723791611aeb12fb..1d80b423f5a3d5bdabb1195532fa78a6 std::unique_ptr delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -3284,6 +3291,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3324,6 +3331,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } diff --git a/patches/chromium/webview_cross_drag.patch b/patches/chromium/webview_cross_drag.patch index 0b9e3980dc705..0186c3be5bfde 100644 --- a/patches/chromium/webview_cross_drag.patch +++ b/patches/chromium/webview_cross_drag.patch @@ -8,10 +8,10 @@ This allows dragging and dropping between s. Originally landed in https://github.com/electron/libchromiumcontent/pull/267 diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc -index 18ad2b559dc7a19a75747f4a722b1df49f718990..5917786d2809860f2b1e6e302920e59e6e3b8414 100644 +index 8a6fd2e52b81f1f541d88c795fbc2697a58f0ea9..9d3efca9c19c9c97c636258017cc16c8bf94b5b1 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc -@@ -919,10 +919,7 @@ bool WebContentsViewAura::IsValidDragTarget( +@@ -884,10 +884,7 @@ bool WebContentsViewAura::IsValidDragTarget( // for the outermost view. Inner `WebContents` will have a // `WebContentsViewChildFrame` so when dragging between an inner // `WebContents` and its embedder the view IDs will be the same. diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index 178a3f2ab7699..5ffa32ab07f17 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -14,10 +14,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 15011d7efd9f1f239e425904c8c22511e49dff88..b9ecdb1d4fde213ea48133285a346557624d1e7f 100644 +index 587d3594c54bb395db7074b0c2e2f10fa61d682b..2a8fe8ef8381f93cf1b4f6a504ad4384fd5aa26e 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -7223,6 +7223,17 @@ void RenderFrameHostImpl::EnterFullscreen( +@@ -7255,6 +7255,17 @@ void RenderFrameHostImpl::EnterFullscreen( } } diff --git a/patches/node/.patches b/patches/node/.patches index 5b0d4b546ad02..2b2e03219c8be 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -38,3 +38,4 @@ fix_account_for_createexternalizablestring_v8_global.patch fix_wunreachable-code_warning_in_ares_init_rand_engine.patch fix_-wshadow_warning.patch fix_do_not_resolve_electron_entrypoints.patch +fix_adapt_generator_tostringtag_prototype_to_v8.patch diff --git a/patches/node/fix_adapt_generator_tostringtag_prototype_to_v8.patch b/patches/node/fix_adapt_generator_tostringtag_prototype_to_v8.patch new file mode 100644 index 0000000000000..668b5ed22c8f4 --- /dev/null +++ b/patches/node/fix_adapt_generator_tostringtag_prototype_to_v8.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shelley Vohr +Date: Mon, 31 Jul 2023 14:17:40 +0200 +Subject: fix: adapt generator toStringTag prototype to V8 + +https://chromium-review.googlesource.com/c/v8/v8/+/4670615 + +diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js +index 9b57fd4a99b10e6509eb319878283b7e24c7d7a3..1a972090cc9c5e174141108bf5b406cb57080ad2 100644 +--- a/test/parallel/test-util-inspect.js ++++ b/test/parallel/test-util-inspect.js +@@ -3212,7 +3212,7 @@ assert.strictEqual( + '[GeneratorFunction: generator] {\n' + + ' [length]: 0,\n' + + " [name]: 'generator',\n" + +- " [prototype]: Object [Generator] { [Symbol(Symbol.toStringTag)]: 'Generator' },\n" + // eslint-disable-line max-len ++ " [prototype]: Iterator [Generator] { [Symbol(Symbol.toStringTag)]: 'Generator' },\n" + // eslint-disable-line max-len + " [Symbol(Symbol.toStringTag)]: 'GeneratorFunction'\n" + + '}' + ); diff --git a/patches/v8/build_gn.patch b/patches/v8/build_gn.patch index b3297e4dedab6..ae54f79a4846d 100644 --- a/patches/v8/build_gn.patch +++ b/patches/v8/build_gn.patch @@ -9,10 +9,10 @@ necessary for native modules to load. Also change visibility on mksnapshot in order to target mksnapshot for mksnapshot zip. diff --git a/BUILD.gn b/BUILD.gn -index 3c028361414720636cdabbc585e4fa508614f661..6208a0544323a6b0fbae6b882d98ba2080acbf25 100644 +index 8242f2e7121568404723be5fba05a073ad1a157e..f2bfbef1d12e06bbe9e0fcf84d89bda46edcbb8b 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -737,7 +737,7 @@ config("internal_config") { +@@ -741,7 +741,7 @@ config("internal_config") { ":cppgc_header_features", ] @@ -21,7 +21,7 @@ index 3c028361414720636cdabbc585e4fa508614f661..6208a0544323a6b0fbae6b882d98ba20 defines += [ "BUILDING_V8_SHARED" ] } -@@ -6680,7 +6680,7 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -6698,7 +6698,7 @@ if (current_toolchain == v8_generator_toolchain) { "src/interpreter/bytecodes.h", ] @@ -30,7 +30,7 @@ index 3c028361414720636cdabbc585e4fa508614f661..6208a0544323a6b0fbae6b882d98ba20 deps = [ ":v8_libbase", -@@ -6692,7 +6692,6 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -6710,7 +6710,6 @@ if (current_toolchain == v8_generator_toolchain) { if (current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { diff --git a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch index 11fdeedf52f70..62635384c64cb 100644 --- a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch +++ b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch @@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not contain any standard C++ library exports (e.g. `std::ostringstream`). diff --git a/BUILD.gn b/BUILD.gn -index 6208a0544323a6b0fbae6b882d98ba2080acbf25..b5c3ff7fd42c26e473b13538f739a5d2eac394e4 100644 +index f2bfbef1d12e06bbe9e0fcf84d89bda46edcbb8b..6eb42a315950627a85ad55aa8d760e4cf3fda398 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -737,6 +737,10 @@ config("internal_config") { +@@ -741,6 +741,10 @@ config("internal_config") { ":cppgc_header_features", ] diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 9ae2f48d63abf..913a8de8c2b85 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -530,8 +530,7 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches( switches::kCORSSchemes, switches::kFetchSchemes, switches::kServiceWorkerSchemes, switches::kStreamingSchemes}; command_line->CopySwitchesFrom(*base::CommandLine::ForCurrentProcess(), - kCommonSwitchNames, - std::size(kCommonSwitchNames)); + kCommonSwitchNames); if (process_type == ::switches::kUtilityProcess || content::RenderProcessHost::FromID(process_id)) { MaybeAppendSecureOriginsAllowlistSwitch(command_line); diff --git a/shell/browser/net/proxying_url_loader_factory.cc b/shell/browser/net/proxying_url_loader_factory.cc index 7dc1ed77c4c56..c317ad7059d2e 100644 --- a/shell/browser/net/proxying_url_loader_factory.cc +++ b/shell/browser/net/proxying_url_loader_factory.cc @@ -809,8 +809,8 @@ void ProxyingURLLoaderFactory::CreateLoaderAndStart( bool bypass_custom_protocol_handlers = options & kBypassCustomProtocolHandlers; if (!bypass_custom_protocol_handlers) { - auto it = intercepted_handlers_.find(request.url.scheme()); - if (it != intercepted_handlers_.end()) { + auto it = intercepted_handlers_->find(request.url.scheme()); + if (it != intercepted_handlers_->end()) { mojo::PendingRemote loader_remote; this->Clone(loader_remote.InitWithNewPipeAndPassReceiver()); diff --git a/shell/browser/net/proxying_url_loader_factory.h b/shell/browser/net/proxying_url_loader_factory.h index e0231d9e36205..2e894e010714c 100644 --- a/shell/browser/net/proxying_url_loader_factory.h +++ b/shell/browser/net/proxying_url_loader_factory.h @@ -13,6 +13,7 @@ #include #include "base/memory/raw_ptr.h" +#include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/render_frame_host.h" @@ -257,7 +258,7 @@ class ProxyingURLLoaderFactory // reference is guaranteed to be valid. // // In this way we can avoid using code from api namespace in this file. - const HandlersMap& intercepted_handlers_; + const raw_ref intercepted_handlers_; const int render_process_id_; const int frame_routing_id_; diff --git a/shell/browser/ui/accelerator_util_unittests.cc b/shell/browser/ui/accelerator_util_unittests.cc index 99f179847874c..1fe48dab22ebc 100644 --- a/shell/browser/ui/accelerator_util_unittests.cc +++ b/shell/browser/ui/accelerator_util_unittests.cc @@ -4,13 +4,14 @@ #include "shell/browser/ui/accelerator_util.h" +#include "base/memory/raw_ref.h" #include "testing/gtest/include/gtest/gtest.h" namespace accelerator_util { TEST(AcceleratorUtilTest, StringToAccelerator) { struct { - const std::string& description; + const std::string description; bool expected_success; } keys[] = { {"♫♫♫♫♫♫♫", false}, {"Cmd+Plus", true}, {"Ctrl+Space", true}, diff --git a/shell/browser/ui/inspectable_web_contents.cc b/shell/browser/ui/inspectable_web_contents.cc index a8f29d9069743..a0406e8aeadf4 100644 --- a/shell/browser/ui/inspectable_web_contents.cc +++ b/shell/browser/ui/inspectable_web_contents.cc @@ -616,6 +616,9 @@ void InspectableWebContents::AddDevToolsExtensionsToClient() { extension_info.Set("exposeExperimentalAPIs", extension->permissions_data()->HasAPIPermission( extensions::mojom::APIPermissionID::kExperimental)); + extension_info.Set("allowFileAccess", + (extension->creation_flags() & + extensions::Extension::ALLOW_FILE_ACCESS) != 0); results.Append(std::move(extension_info)); } diff --git a/spec/webview-spec.ts b/spec/webview-spec.ts index 06ad8c527f1cc..aa91e56f7c08c 100644 --- a/spec/webview-spec.ts +++ b/spec/webview-spec.ts @@ -280,7 +280,9 @@ describe(' tag', function () { w.webContents.session.removeExtension('foo'); const extensionPath = path.join(__dirname, 'fixtures', 'devtools-extensions', 'foo'); - await w.webContents.session.loadExtension(extensionPath); + await w.webContents.session.loadExtension(extensionPath, { + allowFileAccess: true + }); w.loadFile(path.join(__dirname, 'fixtures', 'pages', 'webview-devtools.html')); loadWebView(w.webContents, { From 4de80724c3a516b882954c4768b1aed5787aeb18 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 31 Jul 2023 22:02:23 -0700 Subject: [PATCH 10/93] fix: initial dark mode title bar on Windows 10 (#39287) --- .../electron_desktop_window_tree_host_win.cc | 30 ++++++++++++++++++- .../electron_desktop_window_tree_host_win.h | 3 ++ shell/browser/win/dark_mode.cc | 10 ------- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc b/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc index 90420a95f2b77..dbed46d56e2c9 100644 --- a/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc +++ b/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc @@ -8,6 +8,7 @@ #include "electron/buildflags/buildflags.h" #include "shell/browser/ui/views/win_frame_view.h" #include "shell/browser/win/dark_mode.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/win/hwnd_metrics.h" #include "ui/base/win/shell.h" @@ -37,6 +38,14 @@ bool ElectronDesktopWindowTreeHostWin::PreHandleMSG(UINT message, return native_window_view_->PreHandleMSG(message, w_param, l_param, result); } +bool ElectronDesktopWindowTreeHostWin::ShouldPaintAsActive() const { + if (force_should_paint_as_active_.has_value()) { + return force_should_paint_as_active_.value(); + } + + return views::DesktopWindowTreeHostWin::ShouldPaintAsActive(); +} + bool ElectronDesktopWindowTreeHostWin::GetDwmFrameInsetsInPixels( gfx::Insets* insets) const { // Set DWMFrameInsets to prevent maximized frameless window from bleeding @@ -102,7 +111,26 @@ bool ElectronDesktopWindowTreeHostWin::HandleMouseEventForCaption( void ElectronDesktopWindowTreeHostWin::OnNativeThemeUpdated( ui::NativeTheme* observed_theme) { - win::SetDarkModeForWindow(GetAcceleratedWidget()); + HWND hWnd = GetAcceleratedWidget(); + win::SetDarkModeForWindow(hWnd); + + auto* os_info = base::win::OSInfo::GetInstance(); + auto const version = os_info->version(); + + // Toggle the nonclient area active state to force a redraw (Win10 workaround) + if (version < base::win::Version::WIN11) { + // When handling WM_NCACTIVATE messages, Chromium logical ORs the wParam and + // the value of ShouldPaintAsActive() - so if the latter is true, it's not + // possible to toggle the title bar to inactive. Force it to false while we + // send the message so that the wParam value will always take effect. Refs + // https://source.chromium.org/chromium/chromium/src/+/main:ui/views/win/hwnd_message_handler.cc;l=2332-2381;drc=e6361d070be0adc585ebbff89fec76e2df4ad768 + force_should_paint_as_active_ = false; + ::SendMessage(hWnd, WM_NCACTIVATE, hWnd != ::GetActiveWindow(), 0); + + // Clear forced value and tell Chromium the value changed to get a repaint + force_should_paint_as_active_.reset(); + PaintAsActiveChanged(); + } } } // namespace electron diff --git a/shell/browser/ui/win/electron_desktop_window_tree_host_win.h b/shell/browser/ui/win/electron_desktop_window_tree_host_win.h index 853eb975de177..1901cad02feb6 100644 --- a/shell/browser/ui/win/electron_desktop_window_tree_host_win.h +++ b/shell/browser/ui/win/electron_desktop_window_tree_host_win.h @@ -8,6 +8,7 @@ #include #include "shell/browser/native_window_views.h" +#include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/views/widget/desktop_aura/desktop_window_tree_host_win.h" namespace electron { @@ -31,6 +32,7 @@ class ElectronDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin, WPARAM w_param, LPARAM l_param, LRESULT* result) override; + bool ShouldPaintAsActive() const override; bool GetDwmFrameInsetsInPixels(gfx::Insets* insets) const override; bool GetClientAreaInsets(gfx::Insets* insets, HMONITOR monitor) const override; @@ -41,6 +43,7 @@ class ElectronDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin, private: raw_ptr native_window_view_; // weak ref + absl::optional force_should_paint_as_active_; }; } // namespace electron diff --git a/shell/browser/win/dark_mode.cc b/shell/browser/win/dark_mode.cc index 559c572ddac62..633eac49c8ab7 100644 --- a/shell/browser/win/dark_mode.cc +++ b/shell/browser/win/dark_mode.cc @@ -25,16 +25,6 @@ HRESULT TrySetWindowTheme(HWND hWnd, bool dark) { if (FAILED(result)) return result; - auto* os_info = base::win::OSInfo::GetInstance(); - auto const version = os_info->version(); - - // Toggle the nonclient area active state to force a redraw (Win10 workaround) - if (version < base::win::Version::WIN11) { - HWND activeWindow = GetActiveWindow(); - SendMessage(hWnd, WM_NCACTIVATE, hWnd != activeWindow, 0); - SendMessage(hWnd, WM_NCACTIVATE, hWnd == activeWindow, 0); - } - return S_OK; } From 57eeee568c5258840269e646b1d9da156fead8d5 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 1 Aug 2023 08:04:38 +0200 Subject: [PATCH 11/93] fix: Chrome Extensions service worker host registration (#39290) --- shell/browser/electron_browser_client.cc | 4 ++++ spec/extensions-spec.ts | 15 +++++++++++++++ .../extensions/mv3-service-worker/background.js | 8 +++++++- .../extensions/mv3-service-worker/main.js | 13 +++++++++++++ .../extensions/mv3-service-worker/manifest.json | 11 +++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 spec/fixtures/extensions/mv3-service-worker/main.js diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 913a8de8c2b85..b086e2dbb1408 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -162,6 +162,7 @@ #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h" #include "extensions/browser/process_manager.h" #include "extensions/browser/process_map.h" +#include "extensions/browser/service_worker/service_worker_host.h" #include "extensions/browser/url_loader_factory_manager.h" #include "extensions/common/api/mime_handler.mojom.h" #include "extensions/common/constants.h" @@ -1554,6 +1555,9 @@ void ElectronBrowserClient::ExposeInterfacesToRenderer( associated_registry->AddInterface( base::BindRepeating(&extensions::ExtensionsGuestView::CreateForExtensions, render_process_host->GetID())); + associated_registry->AddInterface( + base::BindRepeating(&extensions::ServiceWorkerHost::BindReceiver, + render_process_host->GetID())); #endif } diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index 5e048882497fd..69bb5768c34e8 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -711,5 +711,20 @@ describe('chrome extensions', () => { const scope = await registrationPromise; expect(scope).equals(extension.url); }); + + it('can run chrome extension APIs', async () => { + const customSession = session.fromPartition(`persist:${uuid.v4()}`); + const w = new BrowserWindow({ show: false, webPreferences: { session: customSession, nodeIntegration: true } }); + await customSession.loadExtension(path.join(fixtures, 'extensions', 'mv3-service-worker')); + + await w.loadURL(url); + + w.webContents.executeJavaScript('window.postMessage(\'fetch-confirmation\', \'*\')'); + + const [, , responseString] = await once(w.webContents, 'console-message'); + const { message } = JSON.parse(responseString); + + expect(message).to.equal('Hello from background.js'); + }); }); }); diff --git a/spec/fixtures/extensions/mv3-service-worker/background.js b/spec/fixtures/extensions/mv3-service-worker/background.js index c4d4a3003587d..411f03f8fbbb4 100644 --- a/spec/fixtures/extensions/mv3-service-worker/background.js +++ b/spec/fixtures/extensions/mv3-service-worker/background.js @@ -1 +1,7 @@ -console.log('service worker installed'); +/* global chrome */ + +chrome.runtime.onMessage.addListener((message, _sender, sendResponse) => { + if (message === 'fetch-confirmation') { + sendResponse({ message: 'Hello from background.js' }); + } +}); diff --git a/spec/fixtures/extensions/mv3-service-worker/main.js b/spec/fixtures/extensions/mv3-service-worker/main.js new file mode 100644 index 0000000000000..c7a37cd155bbf --- /dev/null +++ b/spec/fixtures/extensions/mv3-service-worker/main.js @@ -0,0 +1,13 @@ +/* global chrome */ + +chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { + sendResponse(message); +}); + +window.addEventListener('message', (event) => { + if (event.data === 'fetch-confirmation') { + chrome.runtime.sendMessage('fetch-confirmation', response => { + console.log(JSON.stringify(response)); + }); + } +}, false); diff --git a/spec/fixtures/extensions/mv3-service-worker/manifest.json b/spec/fixtures/extensions/mv3-service-worker/manifest.json index bc81e3a6a510b..e18a207e45cb9 100644 --- a/spec/fixtures/extensions/mv3-service-worker/manifest.json +++ b/spec/fixtures/extensions/mv3-service-worker/manifest.json @@ -3,6 +3,17 @@ "description": "Test for extension service worker support.", "version": "1.0", "manifest_version": 3, + "content_scripts": [ + { + "matches": [ + "" + ], + "js": [ + "main.js" + ], + "run_at": "document_start" + } + ], "background": { "service_worker": "background.js" } From b60c413951f0370139be1ee57fdeadf434b64554 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 1 Aug 2023 08:07:30 +0200 Subject: [PATCH 12/93] fix: potential crash calling `tray.popUpContextMenu()` (#39231) fix: potential crash calling tray.popUpContextMenu --- shell/browser/api/electron_api_tray.cc | 4 +++- shell/browser/ui/tray_icon.cc | 2 +- shell/browser/ui/tray_icon.h | 2 +- shell/browser/ui/tray_icon_cocoa.h | 6 +++--- shell/browser/ui/tray_icon_cocoa.mm | 20 ++++++++++++-------- shell/browser/ui/win/notify_icon.cc | 14 +++++++++----- shell/browser/ui/win/notify_icon.h | 3 ++- 7 files changed, 31 insertions(+), 20 deletions(-) diff --git a/shell/browser/api/electron_api_tray.cc b/shell/browser/api/electron_api_tray.cc index e1bcab8ffcc7f..8b729fb00e974 100644 --- a/shell/browser/api/electron_api_tray.cc +++ b/shell/browser/api/electron_api_tray.cc @@ -342,7 +342,9 @@ void Tray::PopUpContextMenu(gin::Arguments* args) { } } } - tray_icon_->PopUpContextMenu(pos, menu.IsEmpty() ? nullptr : menu->model()); + + tray_icon_->PopUpContextMenu( + pos, menu.IsEmpty() ? nullptr : menu->model()->GetWeakPtr()); } void Tray::CloseContextMenu() { diff --git a/shell/browser/ui/tray_icon.cc b/shell/browser/ui/tray_icon.cc index 07b801583fdeb..7f22f3b6da555 100644 --- a/shell/browser/ui/tray_icon.cc +++ b/shell/browser/ui/tray_icon.cc @@ -21,7 +21,7 @@ void TrayIcon::RemoveBalloon() {} void TrayIcon::Focus() {} void TrayIcon::PopUpContextMenu(const gfx::Point& pos, - raw_ptr menu_model) {} + base::WeakPtr menu_model) {} void TrayIcon::CloseContextMenu() {} diff --git a/shell/browser/ui/tray_icon.h b/shell/browser/ui/tray_icon.h index a8b4581a43c43..85a66163b622f 100644 --- a/shell/browser/ui/tray_icon.h +++ b/shell/browser/ui/tray_icon.h @@ -89,7 +89,7 @@ class TrayIcon { // Popups the menu. virtual void PopUpContextMenu(const gfx::Point& pos, - raw_ptr menu_model); + base::WeakPtr menu_model); virtual void CloseContextMenu(); diff --git a/shell/browser/ui/tray_icon_cocoa.h b/shell/browser/ui/tray_icon_cocoa.h index 6f6241df68590..d7a7904571ac2 100644 --- a/shell/browser/ui/tray_icon_cocoa.h +++ b/shell/browser/ui/tray_icon_cocoa.h @@ -32,11 +32,11 @@ class TrayIconCocoa : public TrayIcon { std::string GetTitle() override; void SetIgnoreDoubleClickEvents(bool ignore) override; bool GetIgnoreDoubleClickEvents() override; - void PopUpOnUI(ElectronMenuModel* menu_model); + void PopUpOnUI(base::WeakPtr menu_model); void PopUpContextMenu(const gfx::Point& pos, - raw_ptr) override; + base::WeakPtr menu_model) override; void CloseContextMenu() override; - void SetContextMenu(raw_ptr) override; + void SetContextMenu(raw_ptr menu_model) override; gfx::Rect GetBounds() override; private: diff --git a/shell/browser/ui/tray_icon_cocoa.mm b/shell/browser/ui/tray_icon_cocoa.mm index e0d5f5c6a4a22..9d6d6d4bd0f21 100644 --- a/shell/browser/ui/tray_icon_cocoa.mm +++ b/shell/browser/ui/tray_icon_cocoa.mm @@ -83,6 +83,11 @@ - (void)removeItem { [self removeTrackingArea:trackingArea_]; trackingArea_ = nil; } + + // Ensure any open menu is closed. + if ([statusItem_ menu]) + [[statusItem_ menu] cancelTracking]; + [[NSStatusBar systemStatusBar] removeStatusItem:statusItem_]; [self removeFromSuperview]; statusItem_ = nil; @@ -228,7 +233,6 @@ - (void)popUpContextMenu:(electron::ElectronMenuModel*)menu_model { if (menuController_ && ![menuController_ isMenuOpen]) { // Ensure the UI can update while the menu is fading out. base::ScopedPumpMessagesInPrivateModes pump_private; - [[statusItem_ button] performClick:self]; } } @@ -354,16 +358,16 @@ - (BOOL)performDragOperation:(id)sender { return [status_item_view_ getIgnoreDoubleClickEvents]; } -void TrayIconCocoa::PopUpOnUI(ElectronMenuModel* menu_model) { - [status_item_view_ popUpContextMenu:menu_model]; +void TrayIconCocoa::PopUpOnUI(base::WeakPtr menu_model) { + [status_item_view_ popUpContextMenu:menu_model.get()]; } -void TrayIconCocoa::PopUpContextMenu(const gfx::Point& pos, - raw_ptr menu_model) { +void TrayIconCocoa::PopUpContextMenu( + const gfx::Point& pos, + base::WeakPtr menu_model) { content::GetUIThreadTaskRunner({})->PostTask( - FROM_HERE, - base::BindOnce(&TrayIconCocoa::PopUpOnUI, weak_factory_.GetWeakPtr(), - base::Unretained(menu_model))); + FROM_HERE, base::BindOnce(&TrayIconCocoa::PopUpOnUI, + weak_factory_.GetWeakPtr(), menu_model)); } void TrayIconCocoa::CloseContextMenu() { diff --git a/shell/browser/ui/win/notify_icon.cc b/shell/browser/ui/win/notify_icon.cc index 4a5171328dc8e..195589f877d45 100644 --- a/shell/browser/ui/win/notify_icon.cc +++ b/shell/browser/ui/win/notify_icon.cc @@ -86,7 +86,7 @@ void NotifyIcon::HandleClickEvent(int modifiers, return; } else if (!double_button_click) { // single right click if (menu_model_) - PopUpContextMenu(gfx::Point(), menu_model_); + PopUpContextMenu(gfx::Point(), menu_model_->GetWeakPtr()); else NotifyRightClicked(bounds, modifiers); } @@ -191,7 +191,7 @@ void NotifyIcon::Focus() { } void NotifyIcon::PopUpContextMenu(const gfx::Point& pos, - raw_ptr menu_model) { + base::WeakPtr menu_model) { // Returns if context menu isn't set. if (menu_model == nullptr && menu_model_ == nullptr) return; @@ -209,9 +209,13 @@ void NotifyIcon::PopUpContextMenu(const gfx::Point& pos, if (pos.IsOrigin()) rect.set_origin(display::Screen::GetScreen()->GetCursorScreenPoint()); - menu_runner_ = std::make_unique( - menu_model != nullptr ? menu_model : menu_model_, - views::MenuRunner::HAS_MNEMONICS); + if (menu_model) { + menu_runner_ = std::make_unique( + menu_model.get(), views::MenuRunner::HAS_MNEMONICS); + } else { + menu_runner_ = std::make_unique( + menu_model_, views::MenuRunner::HAS_MNEMONICS); + } menu_runner_->RunMenuAt(nullptr, nullptr, rect, views::MenuAnchorPosition::kTopLeft, ui::MENU_SOURCE_MOUSE); diff --git a/shell/browser/ui/win/notify_icon.h b/shell/browser/ui/win/notify_icon.h index b0d0b78eb0aa5..ee45864292d6a 100644 --- a/shell/browser/ui/win/notify_icon.h +++ b/shell/browser/ui/win/notify_icon.h @@ -13,6 +13,7 @@ #include #include "base/compiler_specific.h" +#include "base/memory/weak_ptr.h" #include "base/win/scoped_gdi_object.h" #include "shell/browser/ui/tray_icon.h" #include "shell/browser/ui/win/notify_icon_host.h" @@ -65,7 +66,7 @@ class NotifyIcon : public TrayIcon { void RemoveBalloon() override; void Focus() override; void PopUpContextMenu(const gfx::Point& pos, - raw_ptr menu_model) override; + base::WeakPtr menu_model) override; void CloseContextMenu() override; void SetContextMenu(raw_ptr menu_model) override; gfx::Rect GetBounds() override; From 1e879afbd058119e82194d9a758c1dc5e79e263b Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 1 Aug 2023 01:02:20 -0700 Subject: [PATCH 13/93] docs: fix return type for ipcMain handle functions (#39237) --- docs/api/ipc-main.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/ipc-main.md b/docs/api/ipc-main.md index 6bcf88ee04cd8..65845218cd154 100644 --- a/docs/api/ipc-main.md +++ b/docs/api/ipc-main.md @@ -72,7 +72,7 @@ Removes listeners of the specified `channel`. ### `ipcMain.handle(channel, listener)` * `channel` string -* `listener` Function Date: Wed, 2 Aug 2023 10:23:21 +0200 Subject: [PATCH 14/93] build: update appveyor image to latest version e-117.0.5911.0. (#39318) build: update appveyor image to latest version Co-authored-by: jkleinsc --- appveyor-woa.yml | 29 ++--------------------------- appveyor.yml | 30 ++---------------------------- 2 files changed, 4 insertions(+), 55 deletions(-) diff --git a/appveyor-woa.yml b/appveyor-woa.yml index bf8ffa907e7bc..6478bc1656268 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-117.0.5897.0 +image: e-117.0.5911.0 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default @@ -205,32 +205,7 @@ for: on_finish: # Uncomment this lines to enable RDP # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - - ps: | - cd C:\projects\src - $missing_artifacts = $false - if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') { - Write-warning "Skipping artifact validation for doc-only PR" - } else { - $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') - foreach($artifact_name in $artifacts_to_upload) { - if ($artifact_name -eq 'ffmpeg.zip') { - $artifact_file = "out\ffmpeg\ffmpeg.zip" - } elseif ($artifact_name -eq 'node_headers.zip') { - $artifact_file = $artifact_name - } else { - $artifact_file = "out\Default\$artifact_name" - } - if (Test-Path $artifact_file) { - appveyor-retry appveyor PushArtifact $artifact_file - } else { - Write-warning "$artifact_name is missing and cannot be added to artifacts" - $missing_artifacts = $true - } - } - if ($missing_artifacts) { - throw "Build failed due to missing artifacts" - } - } + - ps: "cd C:\\projects\\src\n$missing_artifacts = $false\nif ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {\n Write-warning \"Skipping artifact validation for doc-only PR\"\n} else {\n $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip')\n foreach($artifact_name in $artifacts_to_upload) {\n if ($artifact_name -eq 'ffmpeg.zip') {\n $artifact_file = \"out\\ffmpeg\\ffmpeg.zip\"\n } elseif ($artifact_name -eq 'node_headers.zip') {\n $artifact_file = $artifact_name\n } else {\n $artifact_file = \"out\\Default\\$artifact_name\"\n }\n if (Test-Path $artifact_file) {\n appveyor-retry appveyor PushArtifact $artifact_file \n } else {\n Write-warning \"$artifact_name is missing and cannot be added to artifacts\"\n $missing_artifacts = $true\n }\n }\n if ($missing_artifacts) {\n throw \"Build failed due to missing artifacts\"\n }\n}\n" - ps: >- if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) { appveyor-retry appveyor PushArtifact pdb.zip diff --git a/appveyor.yml b/appveyor.yml index 85ac52b756c40..4ced279751265 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-117.0.5897.0 +image: e-117.0.5911.0 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default @@ -203,33 +203,7 @@ for: on_finish: # Uncomment this lines to enable RDP # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - - ps: | - cd C:\projects\src - $missing_artifacts = $false - - if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') { - Write-warning "Skipping artifact validation for doc-only PR" - } else { - $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip') - foreach($artifact_name in $artifacts_to_upload) { - if ($artifact_name -eq 'ffmpeg.zip') { - $artifact_file = "out\ffmpeg\ffmpeg.zip" - } elseif ($artifact_name -eq 'node_headers.zip') { - $artifact_file = $artifact_name - } else { - $artifact_file = "out\Default\$artifact_name" - } - if (Test-Path $artifact_file) { - appveyor-retry appveyor PushArtifact $artifact_file - } else { - Write-warning "$artifact_name is missing and cannot be added to artifacts" - $missing_artifacts = $true - } - } - if ($missing_artifacts) { - throw "Build failed due to missing artifacts" - } - } + - ps: "cd C:\\projects\\src\n$missing_artifacts = $false\n\nif ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {\n Write-warning \"Skipping artifact validation for doc-only PR\"\n} else {\n $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip')\n foreach($artifact_name in $artifacts_to_upload) {\n if ($artifact_name -eq 'ffmpeg.zip') {\n $artifact_file = \"out\\ffmpeg\\ffmpeg.zip\"\n } elseif ($artifact_name -eq 'node_headers.zip') {\n $artifact_file = $artifact_name\n } else {\n $artifact_file = \"out\\Default\\$artifact_name\"\n }\n if (Test-Path $artifact_file) {\n appveyor-retry appveyor PushArtifact $artifact_file \n } else {\n Write-warning \"$artifact_name is missing and cannot be added to artifacts\"\n $missing_artifacts = $true\n }\n }\n if ($missing_artifacts) {\n throw \"Build failed due to missing artifacts\"\n }\n}\n" - ps: >- if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) { appveyor-retry appveyor PushArtifact pdb.zip From 95be932e196befd617535504347abb6639ac8c4b Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 2 Aug 2023 11:02:16 +0200 Subject: [PATCH 15/93] fix: update `chrome.i18n` for Manifest v3 (#39291) fix: update chrome.i18n for Manifest v3 --- shell/common/extensions/api/i18n.json | 92 ++++++++++--------- spec/extensions-spec.ts | 92 ++++++++++++++++++- .../{ => v2}/_locales/en/messages.json | 0 .../extensions/chrome-i18n/{ => v2}/main.js | 0 .../chrome-i18n/{ => v2}/manifest.json | 0 .../chrome-i18n/v3/_locales/es/messages.json | 6 ++ .../extensions/chrome-i18n/v3/main.js | 36 ++++++++ .../extensions/chrome-i18n/v3/manifest.json | 17 ++++ 8 files changed, 197 insertions(+), 46 deletions(-) rename spec/fixtures/extensions/chrome-i18n/{ => v2}/_locales/en/messages.json (100%) rename spec/fixtures/extensions/chrome-i18n/{ => v2}/main.js (100%) rename spec/fixtures/extensions/chrome-i18n/{ => v2}/manifest.json (100%) create mode 100644 spec/fixtures/extensions/chrome-i18n/v3/_locales/es/messages.json create mode 100644 spec/fixtures/extensions/chrome-i18n/v3/main.js create mode 100644 spec/fixtures/extensions/chrome-i18n/v3/manifest.json diff --git a/shell/common/extensions/api/i18n.json b/shell/common/extensions/api/i18n.json index 01bc8b1759d87..41678f21e6a9f 100644 --- a/shell/common/extensions/api/i18n.json +++ b/shell/common/extensions/api/i18n.json @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright 2012 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -18,15 +18,20 @@ "name": "getAcceptLanguages", "type": "function", "description": "Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use $(ref:i18n.getUILanguage).", - "parameters": [ - { - "type": "function", - "name": "callback", - "parameters": [ - {"name": "languages", "type": "array", "items": {"$ref": "LanguageCode"}, "description": "Array of LanguageCode"} - ] - } - ] + "parameters": [], + "returns_async": { + "name": "callback", + "parameters": [ + { + "name": "languages", + "type": "array", + "items": { + "$ref": "LanguageCode" + }, + "description": "Array of LanguageCode" + } + ] + } }, { "name": "getMessage", @@ -85,44 +90,41 @@ "name": "text", "minimum": 0, "description": "User input string to be translated." - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "type": "object", - "name": "result", - "description": "LanguageDetectionResult object that holds detected language reliability and array of DetectedLanguage", - "properties": { - "isReliable": { "type": "boolean", "description": "CLD detected language reliability" }, - "languages": - { - "type": "array", - "description": "array of detectedLanguage", - "items": - { - "type": "object", - "description": "DetectedLanguage object that holds detected ISO language code and its percentage in the input string", - "properties": - { - "language": - { - "$ref": "LanguageCode" - }, - "percentage": - { - "type": "integer", - "description": "The percentage of the detected language" - } - } - } + } + ], + "returns_async": { + "name": "callback", + "parameters": [ + { + "type": "object", + "name": "result", + "description": "LanguageDetectionResult object that holds detected langugae reliability and array of DetectedLanguage", + "properties": { + "isReliable": { + "type": "boolean", + "description": "CLD detected language reliability" + }, + "languages": { + "type": "array", + "description": "array of detectedLanguage", + "items": { + "type": "object", + "description": "DetectedLanguage object that holds detected ISO language code and its percentage in the input string", + "properties": { + "language": { + "$ref": "LanguageCode" + }, + "percentage": { + "type": "integer", + "description": "The percentage of the detected language" + } } + } } } - ] - } - ] + } + ] + } } ], "events": [] diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index 69bb5768c34e8..b5a43fcd95fb1 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -208,7 +208,7 @@ describe('chrome extensions', () => { }; beforeEach(async () => { const customSession = session.fromPartition(`persist:${uuid.v4()}`); - extension = await customSession.loadExtension(path.join(fixtures, 'extensions', 'chrome-i18n')); + extension = await customSession.loadExtension(path.join(fixtures, 'extensions', 'chrome-i18n', 'v2')); w = new BrowserWindow({ show: false, webPreferences: { session: customSession, nodeIntegration: true, contextIsolation: false } }); await w.loadURL(url); }); @@ -726,5 +726,95 @@ describe('chrome extensions', () => { expect(message).to.equal('Hello from background.js'); }); + + describe('chrome.i18n', () => { + let customSession: Session; + let w = null as unknown as BrowserWindow; + + before(async () => { + customSession = session.fromPartition(`persist:${uuid.v4()}`); + await customSession.loadExtension(path.join(fixtures, 'extensions', 'chrome-i18n', 'v3')); + }); + + beforeEach(() => { + w = new BrowserWindow({ + show: false, + webPreferences: { + session: customSession, + nodeIntegration: true + } + }); + }); + + afterEach(closeAllWindows); + + it('getAcceptLanguages', async () => { + await w.loadURL(url); + + const message = { method: 'getAcceptLanguages' }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [,, responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + + expect(response).to.be.an('array').that.is.not.empty('languages array is empty'); + }); + + it('getUILanguage', async () => { + await w.loadURL(url); + + const message = { method: 'getUILanguage' }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [,, responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + + expect(response).to.be.a('string'); + }); + + it('getMessage', async () => { + await w.loadURL(url); + + const message = { method: 'getMessage' }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [, , responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + + expect(response).to.equal('Hola mundo!!'); + }); + + it('detectLanguage', async () => { + await w.loadURL(url); + + const greetings = [ + 'Ich liebe dich', // German + 'Mahal kita', // Filipino + '愛してます', // Japanese + 'دوستت دارم', // Persian + 'Minä rakastan sinua' // Finnish + ]; + const message = { method: 'detectLanguage', args: [greetings] }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [, , responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + + expect(response).to.be.an('array'); + + for (const item of response) { + expect(Object.keys(item)).to.deep.equal(['isReliable', 'languages']); + } + + const languages = response.map((r: { isReliable: boolean, languages: any[] }) => r.languages[0]); + expect(languages).to.deep.equal([ + { language: 'de', percentage: 100 }, + { language: 'fil', percentage: 100 }, + { language: 'ja', percentage: 100 }, + { language: 'ps', percentage: 100 }, + { language: 'fi', percentage: 100 } + ]); + }); + }); }); }); diff --git a/spec/fixtures/extensions/chrome-i18n/_locales/en/messages.json b/spec/fixtures/extensions/chrome-i18n/v2/_locales/en/messages.json similarity index 100% rename from spec/fixtures/extensions/chrome-i18n/_locales/en/messages.json rename to spec/fixtures/extensions/chrome-i18n/v2/_locales/en/messages.json diff --git a/spec/fixtures/extensions/chrome-i18n/main.js b/spec/fixtures/extensions/chrome-i18n/v2/main.js similarity index 100% rename from spec/fixtures/extensions/chrome-i18n/main.js rename to spec/fixtures/extensions/chrome-i18n/v2/main.js diff --git a/spec/fixtures/extensions/chrome-i18n/manifest.json b/spec/fixtures/extensions/chrome-i18n/v2/manifest.json similarity index 100% rename from spec/fixtures/extensions/chrome-i18n/manifest.json rename to spec/fixtures/extensions/chrome-i18n/v2/manifest.json diff --git a/spec/fixtures/extensions/chrome-i18n/v3/_locales/es/messages.json b/spec/fixtures/extensions/chrome-i18n/v3/_locales/es/messages.json new file mode 100644 index 0000000000000..088a39cc522d8 --- /dev/null +++ b/spec/fixtures/extensions/chrome-i18n/v3/_locales/es/messages.json @@ -0,0 +1,6 @@ +{ + "extName": { + "message": "Hola mundo!!", + "description": "Nombre de extensión" + } +} \ No newline at end of file diff --git a/spec/fixtures/extensions/chrome-i18n/v3/main.js b/spec/fixtures/extensions/chrome-i18n/v3/main.js new file mode 100644 index 0000000000000..3d0c389d6fdcf --- /dev/null +++ b/spec/fixtures/extensions/chrome-i18n/v3/main.js @@ -0,0 +1,36 @@ +/* global chrome */ + +chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { + sendResponse(request); +}); + +const map = { + getAcceptLanguages () { + chrome.i18n.getAcceptLanguages().then((languages) => { + console.log(JSON.stringify(languages)); + }); + }, + getMessage () { + const message = chrome.i18n.getMessage('extName'); + console.log(JSON.stringify(message)); + }, + getUILanguage () { + const language = chrome.i18n.getUILanguage(); + console.log(JSON.stringify(language)); + }, + async detectLanguage (texts) { + const result = []; + for (const text of texts) { + const language = await chrome.i18n.detectLanguage(text); + result.push(language); + } + console.log(JSON.stringify(result)); + } +}; + +const dispatchTest = (event) => { + const { method, args = [] } = JSON.parse(event.data); + map[method](...args); +}; + +window.addEventListener('message', dispatchTest, false); diff --git a/spec/fixtures/extensions/chrome-i18n/v3/manifest.json b/spec/fixtures/extensions/chrome-i18n/v3/manifest.json new file mode 100644 index 0000000000000..e7ae09d39b405 --- /dev/null +++ b/spec/fixtures/extensions/chrome-i18n/v3/manifest.json @@ -0,0 +1,17 @@ +{ + "name": "chrome-i18n", + "version": "1.0", + "default_locale": "es", + "content_scripts": [ + { + "matches": [ + "" + ], + "js": [ + "main.js" + ], + "run_at": "document_start" + } + ], + "manifest_version": 3 +} From 89cf84532fa78ed55615781388a4bc685e589468 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 2 Aug 2023 11:39:40 +0200 Subject: [PATCH 16/93] docs: correct `powerSaveBlocker.stop(id)` return type (#39320) doc: correct powerSaveBlocker.stop return type --- docs/api/power-save-blocker.md | 2 ++ spec/ts-smoke/electron/main.ts | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/api/power-save-blocker.md b/docs/api/power-save-blocker.md index 257fc76f3da54..1ba95f0aab079 100644 --- a/docs/api/power-save-blocker.md +++ b/docs/api/power-save-blocker.md @@ -49,6 +49,8 @@ is used. Stops the specified power save blocker. +Returns `boolean` - Whether the specified `powerSaveBlocker` has been stopped. + ### `powerSaveBlocker.isStarted(id)` * `id` Integer - The power save blocker id returned by `powerSaveBlocker.start`. diff --git a/spec/ts-smoke/electron/main.ts b/spec/ts-smoke/electron/main.ts index 27ea0da6c3cd1..a81377cbe1651 100644 --- a/spec/ts-smoke/electron/main.ts +++ b/spec/ts-smoke/electron/main.ts @@ -904,7 +904,8 @@ app.whenReady().then(() => { const id = powerSaveBlocker.start('prevent-display-sleep'); console.log(powerSaveBlocker.isStarted(id)); -powerSaveBlocker.stop(id); +const stopped = powerSaveBlocker.stop(id); +console.log(`The powerSaveBlocker is ${stopped ? 'stopped' : 'not stopped'}`); // protocol // https://github.com/electron/electron/blob/main/docs/api/protocol.md From 330b66bbb1c7125732167303dbdbfb1ef1e4d83b Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 2 Aug 2023 19:43:45 +0200 Subject: [PATCH 17/93] refactor: use more appropriate array methods (#39321) --- spec/api-app-spec.ts | 6 +++--- spec/api-subframe-spec.ts | 2 +- spec/lib/video-helpers.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/api-app-spec.ts b/spec/api-app-spec.ts index 10c931126b7d8..97857464ef75e 100644 --- a/spec/api-app-spec.ts +++ b/spec/api-app-spec.ts @@ -1184,7 +1184,7 @@ describe('app module', () => { app.setAsDefaultProtocolClient(protocol); const keys = await promisify(classesKey.keys).call(classesKey) as any[]; - const exists = !!keys.find(key => key.key.includes(protocol)); + const exists = keys.some(key => key.key.includes(protocol)); expect(exists).to.equal(true); }); @@ -1193,7 +1193,7 @@ describe('app module', () => { app.removeAsDefaultProtocolClient(protocol); const keys = await promisify(classesKey.keys).call(classesKey) as any[]; - const exists = !!keys.find(key => key.key.includes(protocol)); + const exists = keys.some(key => key.key.includes(protocol)); expect(exists).to.equal(false); }); @@ -1209,7 +1209,7 @@ describe('app module', () => { app.removeAsDefaultProtocolClient(protocol); const keys = await promisify(classesKey.keys).call(classesKey) as any[]; - const exists = !!keys.find(key => key.key.includes(protocol)); + const exists = keys.some(key => key.key.includes(protocol)); expect(exists).to.equal(true); }); diff --git a/spec/api-subframe-spec.ts b/spec/api-subframe-spec.ts index c14803c0a25cd..c5e5b50302e38 100644 --- a/spec/api-subframe-spec.ts +++ b/spec/api-subframe-spec.ts @@ -253,7 +253,7 @@ ifdescribe(process.platform !== 'linux')('cross-site frame sandboxing', () => { const metrics = app.getAppMetrics(); const isProcessSandboxed = function (pid: number) { - const entry = metrics.filter(metric => metric.pid === pid)[0]; + const entry = metrics.find(metric => metric.pid === pid); return entry && entry.sandboxed; }; diff --git a/spec/lib/video-helpers.js b/spec/lib/video-helpers.js index edb89e040caf8..c376b1598db93 100644 --- a/spec/lib/video-helpers.js +++ b/spec/lib/video-helpers.js @@ -442,7 +442,7 @@ function parseRIFF (string) { // basically, the only purpose is for encoding "Duration", which is encoded as // a double (considerably more difficult to encode than an integer) function doubleToString (num) { - return [].slice.call( + return Array.prototype.slice.call( new Uint8Array( ( new Float64Array([num]) // create a float64 array From fc42088c4ae5e674354f6d98ffa57d1ea14d33ac Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 3 Aug 2023 14:29:57 +0200 Subject: [PATCH 18/93] refactor: use Set instead of Array when appropriate (#39324) --- lib/browser/init.ts | 4 ++-- lib/browser/parse-features-string.ts | 4 ++-- script/nan-spec-runner.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/browser/init.ts b/lib/browser/init.ts index db29322a5e6dd..19fc26c4f859f 100644 --- a/lib/browser/init.ts +++ b/lib/browser/init.ts @@ -146,14 +146,14 @@ require('@electron/internal/browser/api/web-frame-main'); // Set main startup script of the app. const mainStartupScript = packageJson.main || 'index.js'; -const KNOWN_XDG_DESKTOP_VALUES = ['Pantheon', 'Unity:Unity7', 'pop:GNOME']; +const KNOWN_XDG_DESKTOP_VALUES = new Set(['Pantheon', 'Unity:Unity7', 'pop:GNOME']); function currentPlatformSupportsAppIndicator () { if (process.platform !== 'linux') return false; const currentDesktop = process.env.XDG_CURRENT_DESKTOP; if (!currentDesktop) return false; - if (KNOWN_XDG_DESKTOP_VALUES.includes(currentDesktop)) return true; + if (KNOWN_XDG_DESKTOP_VALUES.has(currentDesktop)) return true; // ubuntu based or derived session (default ubuntu one, communitheme…) supports // indicator too. if (/ubuntu/ig.test(currentDesktop)) return true; diff --git a/lib/browser/parse-features-string.ts b/lib/browser/parse-features-string.ts index 47b3f06a0b764..a6d451ea938a5 100644 --- a/lib/browser/parse-features-string.ts +++ b/lib/browser/parse-features-string.ts @@ -26,7 +26,7 @@ const keysOfTypeNumberCompileTimeCheck: { [K in IntegerBrowserWindowOptionKeys] }; // Note `top` / `left` are special cases from the browser which we later convert // to y / x. -const keysOfTypeNumber = ['top', 'left', ...Object.keys(keysOfTypeNumberCompileTimeCheck)]; +const keysOfTypeNumber = new Set(['top', 'left', ...Object.keys(keysOfTypeNumberCompileTimeCheck)]); /** * Note that we only allow "0" and "1" boolean conversion when the type is known @@ -37,7 +37,7 @@ const keysOfTypeNumber = ['top', 'left', ...Object.keys(keysOfTypeNumberCompileT */ type CoercedValue = string | number | boolean; function coerce (key: string, value: string): CoercedValue { - if (keysOfTypeNumber.includes(key)) { + if (keysOfTypeNumber.has(key)) { return parseInt(value, 10); } diff --git a/script/nan-spec-runner.js b/script/nan-spec-runner.js index 2889f3290b3ab..d8f8a644ed450 100644 --- a/script/nan-spec-runner.js +++ b/script/nan-spec-runner.js @@ -108,12 +108,12 @@ async function main () { const onlyTests = args.only && args.only.split(','); - const DISABLED_TESTS = [ + const DISABLED_TESTS = new Set([ 'nannew-test.js', 'buffer-test.js' - ]; + ]); const testsToRun = fs.readdirSync(path.resolve(NAN_DIR, 'test', 'js')) - .filter(test => !DISABLED_TESTS.includes(test)) + .filter(test => !DISABLED_TESTS.has(test)) .filter(test => { return !onlyTests || onlyTests.includes(test) || onlyTests.includes(test.replace('.js', '')) || onlyTests.includes(test.replace('-test.js', '')); }) From f1068a5ad37953709e61b3f11be5e59f16ecb705 Mon Sep 17 00:00:00 2001 From: Robo Date: Thu, 3 Aug 2023 21:30:19 +0900 Subject: [PATCH 19/93] fix: destroy message port backend when JS env exits (#39335) --- shell/browser/api/message_port.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shell/browser/api/message_port.h b/shell/browser/api/message_port.h index 2f4cb3480caa4..70fe2add2de8b 100644 --- a/shell/browser/api/message_port.h +++ b/shell/browser/api/message_port.h @@ -11,6 +11,7 @@ #include "gin/wrappable.h" #include "mojo/public/cpp/bindings/connector.h" #include "mojo/public/cpp/bindings/message.h" +#include "shell/common/gin_helper/cleaned_up_at_exit.h" #include "third_party/blink/public/common/messaging/message_port_channel.h" #include "third_party/blink/public/common/messaging/message_port_descriptor.h" @@ -23,7 +24,9 @@ class Handle; namespace electron { // A non-blink version of blink::MessagePort. -class MessagePort : public gin::Wrappable, mojo::MessageReceiver { +class MessagePort : public gin::Wrappable, + public gin_helper::CleanedUpAtExit, + public mojo::MessageReceiver { public: ~MessagePort() override; static gin::Handle Create(v8::Isolate* isolate); From 55283b0c6ac026e378d7c050c6cf8ede14ddfa9c Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 3 Aug 2023 05:40:29 -0700 Subject: [PATCH 20/93] docs: clean up removed systemPreferences methods (#39334) --- docs/api/system-preferences.md | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/docs/api/system-preferences.md b/docs/api/system-preferences.md index 105e11da14363..e66e5d0d4e9b3 100644 --- a/docs/api/system-preferences.md +++ b/docs/api/system-preferences.md @@ -6,7 +6,7 @@ Process: [Main](../glossary.md#main-process) ```javascript const { systemPreferences } = require('electron') -console.log(systemPreferences.isDarkMode()) +console.log(systemPreferences.isAeroGlassEnabled()) ``` ## Events @@ -47,12 +47,6 @@ Returns: ## Methods -### `systemPreferences.isDarkMode()` _macOS_ _Windows_ _Deprecated_ - -Returns `boolean` - Whether the system is in Dark Mode. - -**Deprecated:** Should use the new [`nativeTheme.shouldUseDarkColors`](native-theme.md#nativethemeshouldusedarkcolors-readonly) API. - ### `systemPreferences.isSwipeTrackingFromScrollEventsEnabled()` _macOS_ Returns `boolean` - Whether the Swipe between pages setting is on. @@ -356,18 +350,6 @@ Returns `string` - The standard system color formatted as `#RRGGBBAA`. Returns one of several standard system colors that automatically adapt to vibrancy and changes in accessibility settings like 'Increase contrast' and 'Reduce transparency'. See [Apple Documentation](https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#system-colors) for more details. -### `systemPreferences.isInvertedColorScheme()` _Windows_ _Deprecated_ - -Returns `boolean` - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is active, `false` otherwise. - -**Deprecated:** Should use the new [`nativeTheme.shouldUseInvertedColorScheme`](native-theme.md#nativethemeshoulduseinvertedcolorscheme-macos-windows-readonly) API. - -### `systemPreferences.isHighContrastColorScheme()` _macOS_ _Windows_ _Deprecated_ - -Returns `boolean` - `true` if a high contrast theme is active, `false` otherwise. - -**Deprecated:** Should use the new [`nativeTheme.shouldUseHighContrastColors`](native-theme.md#nativethemeshouldusehighcontrastcolors-macos-windows-readonly) API. - ### `systemPreferences.getEffectiveAppearance()` _macOS_ Returns `string` - Can be `dark`, `light` or `unknown`. From d47b40fe9aa80efa2fea19bb2353fdbd7eb99771 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 3 Aug 2023 17:38:31 +0200 Subject: [PATCH 21/93] feat: support `minimum_chrome_version` manifest key (#39256) feat: support minimum_chrome_version extension key --- electron_paks.gni | 2 ++ .../extensions/api/_manifest_features.json | 4 ++++ .../electron_extensions_api_provider.cc | 3 +++ spec/extensions-spec.ts | 19 +++++++++++++++++++ .../extensions/chrome-too-low-version/main.js | 1 + .../chrome-too-low-version/manifest.json | 14 ++++++++++++++ 6 files changed, 43 insertions(+) create mode 100644 spec/fixtures/extensions/chrome-too-low-version/main.js create mode 100644 spec/fixtures/extensions/chrome-too-low-version/manifest.json diff --git a/electron_paks.gni b/electron_paks.gni index 1ee2e1663980e..c3a257ab0f62f 100644 --- a/electron_paks.gni +++ b/electron_paks.gni @@ -174,6 +174,7 @@ template("electron_paks") { } source_patterns = [ + "${root_gen_dir}/chrome/chromium_strings_", "${root_gen_dir}/chrome/locale_settings_", "${root_gen_dir}/chrome/platform_locale_settings_", "${root_gen_dir}/chrome/generated_resources_", @@ -189,6 +190,7 @@ template("electron_paks") { "${root_gen_dir}/ui/strings/ui_strings_", ] deps = [ + "//chrome/app:chromium_strings", "//chrome/app:generated_resources", "//chrome/app/resources:locale_settings", "//chrome/app/resources:platform_locale_settings", diff --git a/shell/common/extensions/api/_manifest_features.json b/shell/common/extensions/api/_manifest_features.json index 7fdabc8a37dc7..b860cc40e2391 100644 --- a/shell/common/extensions/api/_manifest_features.json +++ b/shell/common/extensions/api/_manifest_features.json @@ -14,5 +14,9 @@ "devtools_page": { "channel": "stable", "extension_types": ["extension"] + }, + "minimum_chrome_version": { + "channel": "stable", + "extension_types": ["extension"] } } diff --git a/shell/common/extensions/electron_extensions_api_provider.cc b/shell/common/extensions/electron_extensions_api_provider.cc index a5aea27f0d776..36cf3f8957f26 100644 --- a/shell/common/extensions/electron_extensions_api_provider.cc +++ b/shell/common/extensions/electron_extensions_api_provider.cc @@ -10,6 +10,7 @@ #include "base/containers/span.h" #include "base/strings/utf_string_conversions.h" #include "chrome/common/extensions/chrome_manifest_url_handlers.h" +#include "chrome/common/extensions/manifest_handlers/minimum_chrome_version_checker.h" #include "electron/buildflags/buildflags.h" #include "electron/shell/common/extensions/api/generated_schemas.h" #include "extensions/common/alias.h" @@ -99,6 +100,8 @@ void ElectronExtensionsAPIProvider::RegisterManifestHandlers() { extensions::ManifestHandlerRegistry::Get(); registry->RegisterHandler( std::make_unique()); + registry->RegisterHandler( + std::make_unique()); } } // namespace electron diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index b5a43fcd95fb1..5a0f5ddff2cb2 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -69,6 +69,25 @@ describe('chrome extensions', () => { `)).to.eventually.have.property('id'); }); + it('supports minimum_chrome_version manifest key', async () => { + const customSession = session.fromPartition(`persist:${require('uuid').v4()}`); + const w = new BrowserWindow({ + show: false, + webPreferences: { + session: customSession, + sandbox: true + } + }); + + await w.loadURL('about:blank'); + + const extPath = path.join(fixtures, 'extensions', 'chrome-too-low-version'); + const load = customSession.loadExtension(extPath); + await expect(load).to.eventually.be.rejectedWith( + `Loading extension at ${extPath} failed with: This extension requires Chromium version 999 or greater.` + ); + }); + it('can open WebSQLDatabase in a background page', async () => { const customSession = session.fromPartition(`persist:${require('uuid').v4()}`); const w = new BrowserWindow({ show: false, webPreferences: { session: customSession, sandbox: true } }); diff --git a/spec/fixtures/extensions/chrome-too-low-version/main.js b/spec/fixtures/extensions/chrome-too-low-version/main.js new file mode 100644 index 0000000000000..d58117c501c1e --- /dev/null +++ b/spec/fixtures/extensions/chrome-too-low-version/main.js @@ -0,0 +1 @@ +document.documentElement.style.backgroundColor = 'blue'; diff --git a/spec/fixtures/extensions/chrome-too-low-version/manifest.json b/spec/fixtures/extensions/chrome-too-low-version/manifest.json new file mode 100644 index 0000000000000..c65bced2f5f38 --- /dev/null +++ b/spec/fixtures/extensions/chrome-too-low-version/manifest.json @@ -0,0 +1,14 @@ +{ + "name": "chrome-too-low-version", + "version": "1.0", + "minimum_chrome_version": "999", + "content_scripts": [ + { + "matches": [""], + "js": ["main.js"], + "run_at": "document_start" + } + ], + "permissions": ["storage"], + "manifest_version": 3 +} From 5a9a728c3d0ed670292c7da97b0058e775e7ddc6 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 3 Aug 2023 18:34:02 +0200 Subject: [PATCH 22/93] fix: update `chrome.tabs` for Manifest v3 (#39317) --- shell/common/extensions/api/tabs.json | 376 ++++++++++++------ spec/extensions-spec.ts | 118 +++++- spec/fixtures/extensions/chrome-api/main.js | 1 + .../extensions/tabs-api-async/background.js | 52 +++ .../extensions/tabs-api-async/main.js | 45 +++ .../extensions/tabs-api-async/manifest.json | 15 + 6 files changed, 481 insertions(+), 126 deletions(-) create mode 100644 spec/fixtures/extensions/tabs-api-async/background.js create mode 100644 spec/fixtures/extensions/tabs-api-async/main.js create mode 100644 spec/fixtures/extensions/tabs-api-async/manifest.json diff --git a/shell/common/extensions/api/tabs.json b/shell/common/extensions/api/tabs.json index 14d83b015a805..c39e67a88c733 100644 --- a/shell/common/extensions/api/tabs.json +++ b/shell/common/extensions/api/tabs.json @@ -3,13 +3,23 @@ "namespace": "tabs", "description": "Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.", "types": [ - { "id": "MutedInfoReason", + { + "id": "MutedInfoReason", "type": "string", "description": "An event that caused a muted state change.", "enum": [ - {"name": "user", "description": "A user input action set the muted state."}, - {"name": "capture", "description": "Tab capture was started, forcing a muted state change."}, - {"name": "extension", "description": "An extension, identified by the extensionId field, set the muted state."} + { + "name": "user", + "description": "A user input action set the muted state." + }, + { + "name": "capture", + "description": "Tab capture was started, forcing a muted state change." + }, + { + "name": "extension", + "description": "An extension, identified by the extensionId field, set the muted state." + } ] }, { @@ -37,29 +47,112 @@ "id": "Tab", "type": "object", "properties": { - "id": {"type": "integer", "minimum": -1, "optional": true, "description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a tab may not be assigned an ID; for example, when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present. Tab ID can also be set to chrome.tabs.TAB_ID_NONE for apps and devtools windows."}, - // TODO(kalman): Investigate how this is ending up as -1 (based on window type? a bug?) and whether it should be optional instead. - "index": {"type": "integer", "minimum": -1, "description": "The zero-based index of the tab within its window."}, - "groupId": {"type": "integer", "minimum": -1, "description": "The ID of the group that the tab belongs to."}, - "windowId": {"type": "integer", "minimum": 0, "description": "The ID of the window that contains the tab."}, - "openerTabId": {"type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."}, - "selected": {"type": "boolean", "description": "Whether the tab is selected.", "deprecated": "Please use $(ref:tabs.Tab.highlighted)."}, - "highlighted": {"type": "boolean", "description": "Whether the tab is highlighted."}, - "active": {"type": "boolean", "description": "Whether the tab is active in its window. Does not necessarily mean the window is focused."}, - "pinned": {"type": "boolean", "description": "Whether the tab is pinned."}, - "audible": {"type": "boolean", "optional": true, "description": "Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the 'speaker audio' indicator is showing."}, - "discarded": {"type": "boolean", "description": "Whether the tab is discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content is reloaded the next time it is activated."}, - "autoDiscardable": {"type": "boolean", "description": "Whether the tab can be discarded automatically by the browser when resources are low."}, - "mutedInfo": {"$ref": "MutedInfo", "optional": true, "description": "The tab's muted state and the reason for the last state change."}, - "url": {"type": "string", "optional": true, "description": "The last committed URL of the main frame of the tab. This property is only present if the extension's manifest includes the \"tabs\" permission and may be an empty string if the tab has not yet committed. See also $(ref:Tab.pendingUrl)."}, - "pendingUrl": {"type": "string", "optional": true, "description": "The URL the tab is navigating to, before it has committed. This property is only present if the extension's manifest includes the \"tabs\" permission and there is a pending navigation."}, - "title": {"type": "string", "optional": true, "description": "The title of the tab. This property is only present if the extension's manifest includes the \"tabs\" permission."}, - "favIconUrl": {"type": "string", "optional": true, "description": "The URL of the tab's favicon. This property is only present if the extension's manifest includes the \"tabs\" permission. It may also be an empty string if the tab is loading."}, - "status": {"type": "string", "optional": true, "description": "Either loading or complete."}, - "incognito": {"type": "boolean", "description": "Whether the tab is in an incognito window."}, - "width": {"type": "integer", "optional": true, "description": "The width of the tab in pixels."}, - "height": {"type": "integer", "optional": true, "description": "The height of the tab in pixels."}, - "sessionId": {"type": "string", "optional": true, "description": "The session ID used to uniquely identify a tab obtained from the $(ref:sessions) API."} + "id": { + "type": "integer", + "minimum": -1, + "optional": true, + "description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a tab may not be assigned an ID; for example, when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present. Tab ID can also be set to chrome.tabs.TAB_ID_NONE for apps and devtools windows." + }, + "index": { + "type": "integer", + "minimum": -1, + "description": "The zero-based index of the tab within its window." + }, + "groupId": { + "type": "integer", + "minimum": -1, + "description": "The ID of the group that the tab belongs to." + }, + "windowId": { + "type": "integer", + "minimum": 0, + "description": "The ID of the window that contains the tab." + }, + "openerTabId": { + "type": "integer", + "minimum": 0, + "optional": true, + "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists." + }, + "selected": { + "type": "boolean", + "description": "Whether the tab is selected.", + "deprecated": "Please use $(ref:tabs.Tab.highlighted)." + }, + "highlighted": { + "type": "boolean", + "description": "Whether the tab is highlighted." + }, + "active": { + "type": "boolean", + "description": "Whether the tab is active in its window. Does not necessarily mean the window is focused." + }, + "pinned": { + "type": "boolean", + "description": "Whether the tab is pinned." + }, + "audible": { + "type": "boolean", + "optional": true, + "description": "Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the 'speaker audio' indicator is showing." + }, + "discarded": { + "type": "boolean", + "description": "Whether the tab is discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content is reloaded the next time it is activated." + }, + "autoDiscardable": { + "type": "boolean", + "description": "Whether the tab can be discarded automatically by the browser when resources are low." + }, + "mutedInfo": { + "$ref": "MutedInfo", + "optional": true, + "description": "The tab's muted state and the reason for the last state change." + }, + "url": { + "type": "string", + "optional": true, + "description": "The last committed URL of the main frame of the tab. This property is only present if the extension's manifest includes the \"tabs\" permission and may be an empty string if the tab has not yet committed. See also $(ref:Tab.pendingUrl)." + }, + "pendingUrl": { + "type": "string", + "optional": true, + "description": "The URL the tab is navigating to, before it has committed. This property is only present if the extension's manifest includes the \"tabs\" permission and there is a pending navigation." + }, + "title": { + "type": "string", + "optional": true, + "description": "The title of the tab. This property is only present if the extension's manifest includes the \"tabs\" permission." + }, + "favIconUrl": { + "type": "string", + "optional": true, + "description": "The URL of the tab's favicon. This property is only present if the extension's manifest includes the \"tabs\" permission. It may also be an empty string if the tab is loading." + }, + "status": { + "type": "string", + "optional": true, + "description": "Either loading or complete." + }, + "incognito": { + "type": "boolean", + "description": "Whether the tab is in an incognito window." + }, + "width": { + "type": "integer", + "optional": true, + "description": "The width of the tab in pixels." + }, + "height": { + "type": "integer", + "optional": true, + "description": "The height of the tab in pixels." + }, + "sessionId": { + "type": "string", + "optional": true, + "description": "The session ID used to uniquely identify a tab obtained from the $(ref:sessions) API." + } } }, { @@ -125,7 +218,13 @@ "type": "function", "description": "Reload a tab.", "parameters": [ - {"type": "integer", "name": "tabId", "minimum": 0, "optional": true, "description": "The ID of the tab to reload; defaults to the selected tab of the current window."}, + { + "type": "integer", + "name": "tabId", + "minimum": 0, + "optional": true, + "description": "The ID of the tab to reload; defaults to the selected tab of the current window." + }, { "type": "object", "name": "reloadProperties", @@ -134,12 +233,16 @@ "bypassCache": { "type": "boolean", "optional": true, - "description": "Whether using any local cache. Default is false." + "description": "Whether to bypass local caching. Defaults to false." } } - }, - {"type": "function", "name": "callback", "optional": true, "parameters": []} - ] + } + ], + "returns_async": { + "name": "callback", + "optional": true, + "parameters": [] + } }, { "name": "get", @@ -150,15 +253,17 @@ "type": "integer", "name": "tabId", "minimum": 0 - }, - { - "type": "function", - "name": "callback", - "parameters": [ - {"name": "tab", "$ref": "Tab"} - ] } - ] + ], + "returns_async": { + "name": "callback", + "parameters": [ + { + "name": "tab", + "$ref": "Tab" + } + ] + } }, { "name": "connect", @@ -175,12 +280,21 @@ "type": "object", "name": "connectInfo", "properties": { - "name": { "type": "string", "optional": true, "description": "Is passed into onConnect for content scripts that are listening for the connection event." }, + "name": { + "type": "string", + "optional": true, + "description": "Is passed into onConnect for content scripts that are listening for the connection event." + }, "frameId": { "type": "integer", "optional": true, "minimum": 0, "description": "Open a port to a specific frame identified by frameId instead of all frames in the tab." + }, + "documentId": { + "type": "string", + "optional": true, + "description": "Open a port to a specific document identified by documentId instead of all frames in the tab." } }, "optional": true @@ -193,7 +307,9 @@ }, { "name": "executeScript", + "deprecated": "Replaced by $(ref:scripting.executeScript) in Manifest V3.", "type": "function", + "description": "Injects JavaScript code into a page. For details, see the programmatic injection section of the content scripts doc.", "parameters": [ { "type": "integer", @@ -206,26 +322,25 @@ "$ref": "extensionTypes.InjectDetails", "name": "details", "description": "Details of the script to run. Either the code or the file property must be set, but both may not be set at the same time." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "description": "Called after all the JavaScript has been executed.", - "parameters": [ - { - "name": "result", - "optional": true, - "type": "array", - "items": { - "type": "any", - "minimum": 0 - }, - "description": "The result of the script in every injected frame." - } - ] } - ] + ], + "returns_async": { + "name": "callback", + "optional": true, + "description": "Called after all the JavaScript has been executed.", + "parameters": [ + { + "name": "result", + "optional": true, + "type": "array", + "items": { + "type": "any", + "minimum": 0 + }, + "description": "The result of the script in every injected frame." + } + ] + } }, { "name": "sendMessage", @@ -252,23 +367,27 @@ "optional": true, "minimum": 0, "description": "Send a message to a specific frame identified by frameId instead of all frames in the tab." + }, + "documentId": { + "type": "string", + "optional": true, + "description": "Send a message to a specific document identified by documentId instead of all frames in the tab." } }, "optional": true - }, - { - "type": "function", - "name": "responseCallback", - "optional": true, - "parameters": [ - { - "name": "response", - "type": "any", - "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback is called with no arguments and $(ref:runtime.lastError) is set to the error message." - } - ] } - ] + ], + "returns_async": { + "name": "callback", + "optional": true, + "parameters": [ + { + "name": "response", + "type": "any", + "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback is called with no arguments and $(ref:runtime.lastError) is set to the error message." + } + ] + } }, { "name": "setZoom", @@ -286,15 +405,14 @@ "type": "number", "name": "zoomFactor", "description": "The new zoom factor. A value of 0 sets the tab to its current default zoom factor. Values greater than 0 specify a (possibly non-default) zoom factor for the tab." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "description": "Called after the zoom factor has been changed.", - "parameters": [] } - ] + ], + "returns_async": { + "name": "callback", + "optional": true, + "description": "Called after the zoom factor has been changed.", + "parameters": [] + } }, { "name": "getZoom", @@ -307,20 +425,19 @@ "minimum": 0, "optional": true, "description": "The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window." - }, - { - "type": "function", - "name": "callback", - "description": "Called with the tab's current zoom factor after it has been fetched.", - "parameters": [ - { - "type": "number", - "name": "zoomFactor", - "description": "The tab's current zoom factor." - } - ] } - ] + ], + "returns_async": { + "name": "callback", + "description": "Called with the tab's current zoom factor after it has been fetched.", + "parameters": [ + { + "type": "number", + "name": "zoomFactor", + "description": "The tab's current zoom factor." + } + ] + } }, { "name": "setZoomSettings", @@ -338,15 +455,14 @@ "$ref": "ZoomSettings", "name": "zoomSettings", "description": "Defines how zoom changes are handled and at what scope." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "description": "Called after the zoom settings are changed.", - "parameters": [] } - ] + ], + "returns_async": { + "name": "callback", + "optional": true, + "description": "Called after the zoom settings are changed.", + "parameters": [] + } }, { "name": "getZoomSettings", @@ -359,20 +475,19 @@ "optional": true, "minimum": 0, "description": "The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window." - }, - { - "type": "function", - "name": "callback", - "description": "Called with the tab's current zoom settings.", - "parameters": [ - { - "$ref": "ZoomSettings", - "name": "zoomSettings", - "description": "The tab's current zoom settings." - } - ] } - ] + ], + "returns_async": { + "name": "callback", + "description": "Called with the tab's current zoom settings.", + "parameters": [ + { + "$ref": "ZoomSettings", + "name": "zoomSettings", + "description": "The tab's current zoom settings." + } + ] + } }, { "name": "update", @@ -454,17 +569,28 @@ "name": "onZoomChange", "type": "function", "description": "Fired when a tab is zoomed.", - "parameters": [{ - "type": "object", - "name": "ZoomChangeInfo", - "properties": { - "tabId": {"type": "integer", "minimum": 0}, - "oldZoomFactor": {"type": "number"}, - "newZoomFactor": {"type": "number"}, - "zoomSettings": {"$ref": "ZoomSettings"} + "parameters": [ + { + "type": "object", + "name": "ZoomChangeInfo", + "properties": { + "tabId": { + "type": "integer", + "minimum": 0 + }, + "oldZoomFactor": { + "type": "number" + }, + "newZoomFactor": { + "type": "number" + }, + "zoomSettings": { + "$ref": "ZoomSettings" + } + } } - }] + ] } ] } -] +] \ No newline at end of file diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index 5a0f5ddff2cb2..cc8b49c6c2825 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -373,7 +373,7 @@ describe('chrome extensions', () => { const message = { method: 'executeScript', args: ['1 + 2'] }; w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [, , responseString] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); expect(response).to.equal(3); @@ -835,5 +835,121 @@ describe('chrome extensions', () => { ]); }); }); + + describe('chrome.tabs', () => { + let customSession: Session; + let w = null as unknown as BrowserWindow; + + before(async () => { + customSession = session.fromPartition(`persist:${uuid.v4()}`); + await customSession.loadExtension(path.join(fixtures, 'extensions', 'tabs-api-async')); + }); + + beforeEach(() => { + w = new BrowserWindow({ + show: false, + webPreferences: { + session: customSession, + nodeIntegration: true + } + }); + }); + + afterEach(closeAllWindows); + + it('getZoom', async () => { + await w.loadURL(url); + + const message = { method: 'getZoom' }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [,, responseString] = await once(w.webContents, 'console-message'); + + const response = JSON.parse(responseString); + expect(response).to.equal(1); + }); + + it('setZoom', async () => { + await w.loadURL(url); + + const message = { method: 'setZoom', args: [2] }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [,, responseString] = await once(w.webContents, 'console-message'); + + const response = JSON.parse(responseString); + expect(response).to.deep.equal(2); + }); + + it('getZoomSettings', async () => { + await w.loadURL(url); + + const message = { method: 'getZoomSettings' }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [,, responseString] = await once(w.webContents, 'console-message'); + + const response = JSON.parse(responseString); + expect(response).to.deep.equal({ + defaultZoomFactor: 1, + mode: 'automatic', + scope: 'per-origin' + }); + }); + + it('setZoomSettings', async () => { + await w.loadURL(url); + + const message = { method: 'setZoomSettings', args: [{ mode: 'disabled' }] }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [,, responseString] = await once(w.webContents, 'console-message'); + + const response = JSON.parse(responseString); + expect(response).to.deep.equal({ + defaultZoomFactor: 1, + mode: 'disabled', + scope: 'per-tab' + }); + }); + + it('get', async () => { + await w.loadURL(url); + + const message = { method: 'get' }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [,, responseString] = await once(w.webContents, 'console-message'); + + const response = JSON.parse(responseString); + expect(response).to.have.property('active').that.is.a('boolean'); + expect(response).to.have.property('autoDiscardable').that.is.a('boolean'); + expect(response).to.have.property('discarded').that.is.a('boolean'); + expect(response).to.have.property('groupId').that.is.a('number'); + expect(response).to.have.property('highlighted').that.is.a('boolean'); + expect(response).to.have.property('id').that.is.a('number'); + expect(response).to.have.property('incognito').that.is.a('boolean'); + expect(response).to.have.property('index').that.is.a('number'); + expect(response).to.have.property('pinned').that.is.a('boolean'); + expect(response).to.have.property('selected').that.is.a('boolean'); + expect(response).to.have.property('url').that.is.a('string'); + expect(response).to.have.property('windowId').that.is.a('number'); + }); + + it('reload', async () => { + await w.loadURL(url); + + const message = { method: 'reload' }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const consoleMessage = once(w.webContents, 'console-message'); + const finish = once(w.webContents, 'did-finish-load'); + + await Promise.all([consoleMessage, finish]).then(([[,, responseString]]) => { + const response = JSON.parse(responseString); + expect(response.status).to.equal('reloaded'); + }); + }); + }); }); }); diff --git a/spec/fixtures/extensions/chrome-api/main.js b/spec/fixtures/extensions/chrome-api/main.js index 14331534b7f91..e24784d9fbeac 100644 --- a/spec/fixtures/extensions/chrome-api/main.js +++ b/spec/fixtures/extensions/chrome-api/main.js @@ -49,4 +49,5 @@ const dispatchTest = (event) => { const { method, args = [] } = JSON.parse(event.data); testMap[method](...args); }; + window.addEventListener('message', dispatchTest, false); diff --git a/spec/fixtures/extensions/tabs-api-async/background.js b/spec/fixtures/extensions/tabs-api-async/background.js new file mode 100644 index 0000000000000..32290c36fb789 --- /dev/null +++ b/spec/fixtures/extensions/tabs-api-async/background.js @@ -0,0 +1,52 @@ +/* global chrome */ + +const handleRequest = (request, sender, sendResponse) => { + const { method, args = [] } = request; + const tabId = sender.tab.id; + + switch (method) { + case 'getZoom': { + chrome.tabs.getZoom(tabId).then(sendResponse); + break; + } + + case 'setZoom': { + const [zoom] = args; + chrome.tabs.setZoom(tabId, zoom).then(async () => { + const updatedZoom = await chrome.tabs.getZoom(tabId); + sendResponse(updatedZoom); + }); + break; + } + + case 'getZoomSettings': { + chrome.tabs.getZoomSettings(tabId).then(sendResponse); + break; + } + + case 'setZoomSettings': { + const [settings] = args; + chrome.tabs.setZoomSettings(tabId, { mode: settings.mode }).then(async () => { + const zoomSettings = await chrome.tabs.getZoomSettings(tabId); + sendResponse(zoomSettings); + }); + break; + } + + case 'get': { + chrome.tabs.get(tabId).then(sendResponse); + break; + } + + case 'reload': { + chrome.tabs.reload(tabId).then(() => { + sendResponse({ status: 'reloaded' }); + }); + } + } +}; + +chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { + handleRequest(request, sender, sendResponse); + return true; +}); diff --git a/spec/fixtures/extensions/tabs-api-async/main.js b/spec/fixtures/extensions/tabs-api-async/main.js new file mode 100644 index 0000000000000..8c23bb00d0a18 --- /dev/null +++ b/spec/fixtures/extensions/tabs-api-async/main.js @@ -0,0 +1,45 @@ +/* global chrome */ + +chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { + sendResponse(request); +}); + +const testMap = { + getZoomSettings () { + chrome.runtime.sendMessage({ method: 'getZoomSettings' }, response => { + console.log(JSON.stringify(response)); + }); + }, + setZoomSettings (settings) { + chrome.runtime.sendMessage({ method: 'setZoomSettings', args: [settings] }, response => { + console.log(JSON.stringify(response)); + }); + }, + getZoom () { + chrome.runtime.sendMessage({ method: 'getZoom', args: [] }, response => { + console.log(JSON.stringify(response)); + }); + }, + setZoom (zoom) { + chrome.runtime.sendMessage({ method: 'setZoom', args: [zoom] }, response => { + console.log(JSON.stringify(response)); + }); + }, + get () { + chrome.runtime.sendMessage({ method: 'get' }, response => { + console.log(JSON.stringify(response)); + }); + }, + reload () { + chrome.runtime.sendMessage({ method: 'reload' }, response => { + console.log(JSON.stringify(response)); + }); + } +}; + +const dispatchTest = (event) => { + const { method, args = [] } = JSON.parse(event.data); + testMap[method](...args); +}; + +window.addEventListener('message', dispatchTest, false); diff --git a/spec/fixtures/extensions/tabs-api-async/manifest.json b/spec/fixtures/extensions/tabs-api-async/manifest.json new file mode 100644 index 0000000000000..58081152decfd --- /dev/null +++ b/spec/fixtures/extensions/tabs-api-async/manifest.json @@ -0,0 +1,15 @@ +{ + "name": "tabs-api-async", + "version": "1.0", + "content_scripts": [ + { + "matches": [ ""], + "js": ["main.js"], + "run_at": "document_start" + } + ], + "background": { + "service_worker": "background.js" + }, + "manifest_version": 3 +} From eba82f02d08853a0c15ee4225dff755301480476 Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Fri, 4 Aug 2023 10:47:29 +0200 Subject: [PATCH 23/93] chore: bump chromium to 117.0.5923.0 (main) (#39304) * chore: bump chromium in DEPS to 117.0.5921.0 * chore: update chromium patches * 4721409: Remove redundant ARC configuration in /components | https://chromium-review.googlesource.com/c/chromium/src/+/4721409 * 4643750: Add V8_LOW_PRIORITY_TQ for main thread | https://chromium-review.googlesource.com/c/chromium/src/+/4643750 * 4022621: Re-register status item when owner of status watcher is changed | https://chromium-review.googlesource.com/c/chromium/src/+/4022621 * chore: update V8/boringssl patches * fixup! 4643750: Add V8_LOW_PRIORITY_TQ for main thread | https://chromium-review.googlesource.com/c/chromium/src/+/4643750 * chore: bump chromium in DEPS to 117.0.5923.0 * build [debug]: remove assert 4722125: Update enterprise content analysis buildflags usage | https://chromium-review.googlesource.com/c/chromium/src/+/4722125 * chore: manually rollback to 117.0.5921.0 * build [arc]: ARC conversion in auto_updater * build [arc]: ARC conversion in browser/api * build [arc]: ARC conversion in notifications/mac * build [arc]: ARC conversion in in_app_purchase * build [arc]: ARC conversion in browser/ui * build [arc]: ARC conversion in ui/cocoa * build [arc]: ARC conversion in shell/common * build [arc]: ARC conversion in OSR * build [arc]: ARC conversion in login_helper * build [arc]: ARC conversion in app_mas * build [arc]: fix up ARC syntax (thanks @codebytere!) * 4726946: [Extensions] Work around dangling BrowserContext pointer. | https://chromium-review.googlesource.com/c/chromium/src/+/4726946 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Keeley Hammond Co-authored-by: VerteDinde --- DEPS | 2 +- build/args/all.gn | 4 + ...ack_ssl_error_zero_return_explicitly.patch | 4 +- patches/chromium/.patches | 2 +- .../add_didinstallconditionalfeatures.patch | 6 +- ...lectron_deps_to_license_credits_file.patch | 4 +- patches/chromium/blink_file_path.patch | 4 +- patches/chromium/blink_local_frame.patch | 2 +- patches/chromium/boringssl_build_gn.patch | 2 +- .../build_add_electron_tracing_category.patch | 2 +- ...ld_allow_electron_to_use_exec_script.patch | 4 +- ...build_disable_partition_alloc_on_mac.patch | 2 +- ...build_disable_print_content_analysis.patch | 2 +- ..._depend_on_packed_resource_integrity.patch | 18 ++-- patches/chromium/build_gn.patch | 2 +- ...ld_config_in_the_required_components.patch | 85 +++++++-------- ...d_remove_ent_content_analysis_assert.patch | 20 ++++ patches/chromium/can_create_window.patch | 20 ++-- ...d_buildflag_guard_around_new_include.patch | 2 +- ...hore_add_electron_deps_to_gitignores.patch | 8 +- ...rofile_methods_in_chrome_browser_pdf.patch | 6 +- ...screationoverridden_with_full_params.patch | 8 +- .../disable_compositor_recycling.patch | 4 +- ...locator_for_usage_outside_of_the_gin.patch | 4 +- ...egenerationcheckcallbackinmainthread.patch | 2 +- ...e_launch_options_for_service_process.patch | 18 ++-- ...screen_rendering_with_viz_compositor.patch | 2 +- ..._raw_response_headers_from_urlloader.patch | 2 +- ...uest_webcontents_to_enter_fullscreen.patch | 2 +- ...ding_non-standard_schemes_in_iframes.patch | 10 +- ...board_hides_on_input_blur_in_webview.patch | 2 +- ...from_localframe_requestexecutescript.patch | 6 +- ...t_menu_item_when_opened_via_keyboard.patch | 4 +- .../fix_tray_icon_gone_on_lock_screen.patch | 61 ----------- patches/chromium/frame_host_manager.patch | 4 +- .../gin_enable_disable_v8_platform.patch | 8 +- ...gpu_notify_when_dxdiag_request_fails.patch | 6 +- .../chromium/gritsettings_resource_ids.patch | 4 +- ...sync_with_host_os_mac_on_linux_in_ci.patch | 4 +- patches/chromium/isolate_holder.patch | 55 +++++----- .../mas_disable_custom_window_frame.patch | 14 +-- .../mas_disable_remote_accessibility.patch | 16 +-- patches/chromium/printing.patch | 102 +++++++++--------- ...r_changes_to_the_webcontentsobserver.patch | 4 +- patches/chromium/resource_file_conflict.patch | 6 +- patches/chromium/scroll_bounce_flag.patch | 4 +- patches/chromium/web_contents.patch | 4 +- patches/chromium/webview_fullscreen.patch | 4 +- patches/v8/build_gn.patch | 8 +- ...export_private_v8_symbols_on_windows.patch | 4 +- shell/app/electron_login_helper.mm | 17 +-- shell/browser/api/electron_api_app_mas.mm | 4 - .../api/electron_api_power_monitor_mac.mm | 1 - shell/browser/auto_updater_mac.mm | 4 +- shell/browser/javascript_environment.cc | 2 +- shell/browser/mac/in_app_purchase.mm | 8 +- shell/browser/mac/in_app_purchase_observer.mm | 3 +- shell/browser/mac/in_app_purchase_product.mm | 5 - .../notifications/mac/cocoa_notification.h | 3 +- .../notifications/mac/cocoa_notification.mm | 7 +- .../mac/notification_presenter_mac.h | 4 +- .../browser/osr/osr_web_contents_view_mac.mm | 7 +- shell/browser/ui/certificate_trust_mac.mm | 4 - shell/browser/ui/cocoa/NSString+ANSI.mm | 22 ++-- .../browser/ui/cocoa/electron_bundle_mover.mm | 6 +- .../ui/cocoa/electron_native_widget_mac.mm | 7 +- .../browser/ui/cocoa/window_buttons_proxy.mm | 1 - shell/browser/ui/drag_util_mac.mm | 4 +- shell/browser/ui/file_dialog_mac.mm | 9 +- shell/browser/ui/message_box_mac.mm | 9 +- .../api/electron_api_native_image_mac.mm | 17 ++- shell/common/application_info_mac.mm | 3 +- shell/common/platform_util_mac.mm | 2 +- 73 files changed, 323 insertions(+), 399 deletions(-) create mode 100644 patches/chromium/build_remove_ent_content_analysis_assert.patch delete mode 100644 patches/chromium/fix_tray_icon_gone_on_lock_screen.patch diff --git a/DEPS b/DEPS index 6c89ee897f9c9..743a01fa3c931 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ gclient_gn_args_from = 'src' vars = { 'chromium_version': - '117.0.5911.0', + '117.0.5921.0', 'node_version': 'v18.16.1', 'nan_version': diff --git a/build/args/all.gn b/build/args/all.gn index 6755a47d28eb8..e9e2d01120eeb 100644 --- a/build/args/all.gn +++ b/build/args/all.gn @@ -52,3 +52,7 @@ use_perfetto_client_library = false # Disables the builtins PGO for V8 v8_builtins_profiling_log_file = "" + +# https://chromium.googlesource.com/chromium/src/+/main/docs/dangling_ptr.md +# TODO(vertedinde): hunt down dangling pointers on Linux +enable_dangling_raw_ptr_checks = false 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 f26bf51de7412..56e2c2c07fca0 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 2ca14efae5ea478f43794a81883b00dfdb1a37b0..d73055fbf39334925ef4b4804bbaca57 case ssl_open_record_error: diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc -index 26ffd5036cb9b15b741d20d83fc9143f1bb4e835..5446aecd69a7bac07f8f9d9d8c88e3ae881ac830 100644 +index 5a2ac2a8f586f2b90e4eb2989b05406a5e434769..2cac586039713df70e57eee5ecedbfc9f8d33510 100644 --- a/ssl/ssl_lib.cc +++ b/ssl/ssl_lib.cc @@ -1333,7 +1333,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) { @@ -32,7 +32,7 @@ index 26ffd5036cb9b15b741d20d83fc9143f1bb4e835..5446aecd69a7bac07f8f9d9d8c88e3ae return SSL_ERROR_ZERO_RETURN; } // An EOF was observed which violates the protocol, and the underlying -@@ -2695,13 +2695,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) { +@@ -2697,13 +2697,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) { return CRYPTO_get_ex_data(&ctx->ex_data, idx); } diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 767054b15cde0..c3f6701b5dfd0 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -116,7 +116,6 @@ preconnect_manager.patch fix_remove_caption-removing_style_call.patch build_allow_electron_to_use_exec_script.patch build_only_use_the_mas_build_config_in_the_required_components.patch -fix_tray_icon_gone_on_lock_screen.patch chore_introduce_blocking_api_for_electron.patch chore_patch_out_partition_attribute_dcheck_for_webviews.patch expose_v8initializer_codegenerationcheckcallbackinmainthread.patch @@ -132,3 +131,4 @@ fix_return_v8_value_from_localframe_requestexecutescript.patch fix_harden_blink_scriptstate_maybefrom.patch chore_add_buildflag_guard_around_new_include.patch fix_use_delegated_generic_capturer_when_available.patch +build_remove_ent_content_analysis_assert.patch diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index 69409308c0419..8268d162c7577 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -23,10 +23,10 @@ index 103a9d9fb17e954ecaf0acecaa3eeafc23e39c94..de299316216dba204decba3b0eb57f5c int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 6aecc6c215cb33bf4b0f2cd38a79ebeef6be527d..a1a8cde301a8ea24bae61f816cb0325a04f4994f 100644 +index abaf6b2c59058b670d1989be3693d7d69557e850..8866b3d54dc8c044a4bb08c6e233701207597cbb 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4474,6 +4474,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, +@@ -4476,6 +4476,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, observer.DidCreateScriptContext(context, world_id); } @@ -40,7 +40,7 @@ index 6aecc6c215cb33bf4b0f2cd38a79ebeef6be527d..a1a8cde301a8ea24bae61f816cb0325a int world_id) { for (auto& observer : observers_) diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h -index 8c1f15b99b3b41b97d8ba54699b0ee77fbf35735..0db3fc212093fbf372c569db3db8d9ef1042fb32 100644 +index 91a8fdd2b9b931b21f725208cfc78a2fd4c0818e..26758f9fefd09ad75841b5fcba0c7aeabcbd3ce2 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h @@ -611,6 +611,8 @@ class CONTENT_EXPORT RenderFrameImpl 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 0fbe2ff77c776..68fe06de84b71 100644 --- a/patches/chromium/add_electron_deps_to_license_credits_file.patch +++ b/patches/chromium/add_electron_deps_to_license_credits_file.patch @@ -7,12 +7,12 @@ 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 c728df1b5421b749af10a076fdbd8ffe691114b9..51c538ad91482f2b164016e2de8946aba2bb6ac9 100755 +index 81dd367a1a3f0b59832406e97e3eb0b869741a34..2fbe3091c32dd1b3771711b84c86eaab67fd7a0e 100755 --- a/tools/licenses/licenses.py +++ b/tools/licenses/licenses.py @@ -424,6 +424,31 @@ SPECIAL_CASES = { "License": "Apache 2.0", - "License File": ["/third_party/selenium-atoms/LICENSE.closure"], + "License File": ["//third_party/selenium-atoms/LICENSE.closure"], }, + os.path.join('third_party', 'electron_node'): { + "Name": "Node.js", diff --git a/patches/chromium/blink_file_path.patch b/patches/chromium/blink_file_path.patch index 36134ca982cbc..d6cf91e2e37e7 100644 --- a/patches/chromium/blink_file_path.patch +++ b/patches/chromium/blink_file_path.patch @@ -7,10 +7,10 @@ This is used by editors to obtain the filesystem path from a dragged file. See documentation at https://electronjs.org/docs/api/file-object diff --git a/third_party/blink/renderer/core/fileapi/file.h b/third_party/blink/renderer/core/fileapi/file.h -index 2cc436a725f13d3fdf5b5eed6af73695d3c19953..b11c146fc86e55324b61a057d45b96e8c96b304b 100644 +index 355ce2e090c60a38cd22750958710e138009d1f5..a9b1b7307f7f91d50d9a750455503381961c7cf7 100644 --- a/third_party/blink/renderer/core/fileapi/file.h +++ b/third_party/blink/renderer/core/fileapi/file.h -@@ -206,6 +206,9 @@ class CORE_EXPORT File final : public Blob { +@@ -215,6 +215,9 @@ class CORE_EXPORT File final : public Blob { } const String& name() const { return name_; } diff --git a/patches/chromium/blink_local_frame.patch b/patches/chromium/blink_local_frame.patch index 1ebeebd0cbb49..5172fdef270d1 100644 --- a/patches/chromium/blink_local_frame.patch +++ b/patches/chromium/blink_local_frame.patch @@ -49,7 +49,7 @@ index 22c4d4e9718a503d9c7ca26a40c97149b0f8986a..6bdc2757c96a28022fda9e6f5e3b74a0 // its owning reference back to our owning LocalFrame. client_->Detached(type); diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc -index 5f5b127adaa95894722768a3300455f6c086bba7..8cb40ed9c41d438463e18793ee6dd112b59d823c 100644 +index 84372d274225a4ef5787def680fecf6e50ef7c96..280fbb5608ffcd5bec33483c99a1a112a16a0c24 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc @@ -665,10 +665,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) { diff --git a/patches/chromium/boringssl_build_gn.patch b/patches/chromium/boringssl_build_gn.patch index 68022ed90e6dc..6a74c4280d7da 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 eb2393eb9a6459a2d7dfdcfe6379817be3139074..ef99c6bc6c1cd16cc8ef1bd88da55bf6961f31fd 100644 +index db3cf20b2951445986474e9f54981715ad3cd613..ab2bf2dbb35d6360a773881cb619507405222e81 100644 --- a/third_party/boringssl/BUILD.gn +++ b/third_party/boringssl/BUILD.gn @@ -49,6 +49,20 @@ config("no_asm_config") { diff --git a/patches/chromium/build_add_electron_tracing_category.patch b/patches/chromium/build_add_electron_tracing_category.patch index 2f4cfdfe4b4da..a819a4fa7e388 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 da966a58b11be318770fccdd14986efd2a92ccf8..2a7ea1edd970a205ec5f16c66b5722282f2bcf59 100644 +index 1ddaeafd2779a40a56c11b2e0b22e057c578bd0a..0f52af2a437c548fd85b82b313cf2826f4dea590 100644 --- a/base/trace_event/builtin_categories.h +++ b/base/trace_event/builtin_categories.h @@ -80,6 +80,8 @@ 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 f7883ecc74b15..4cadfbbbde505 100644 --- a/patches/chromium/build_allow_electron_to_use_exec_script.patch +++ b/patches/chromium/build_allow_electron_to_use_exec_script.patch @@ -6,10 +6,10 @@ 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 a9b0a5a827fc831f73ea9866d2411a05a3783144..58c13358cac40340f4fa51c9fce531c334a68fb0 100644 +index 16bf620b7c2ee2d2a850f892ad232f7c888f2649..8a428da676bfb993cf8f6c85cd966fa79925011d 100644 --- a/.gn +++ b/.gn -@@ -165,4 +165,6 @@ exec_script_whitelist = +@@ -159,4 +159,6 @@ exec_script_whitelist = "//tools/grit/grit_rule.gni", "//tools/gritsettings/BUILD.gn", diff --git a/patches/chromium/build_disable_partition_alloc_on_mac.patch b/patches/chromium/build_disable_partition_alloc_on_mac.patch index 4ac4286c05040..7a5a29fff360b 100644 --- a/patches/chromium/build_disable_partition_alloc_on_mac.patch +++ b/patches/chromium/build_disable_partition_alloc_on_mac.patch @@ -9,7 +9,7 @@ and can be removed when the crash in fork is resolved. Related issue: https://github.com/electron/electron/issues/32718 diff --git a/build_overrides/partition_alloc.gni b/build_overrides/partition_alloc.gni -index 161dfbb8ab6071417202daeaa859951c3e59719b..94182390984fd2d4e8384b2476862373fc97afd0 100644 +index 622af2267251b3161f500e10ec667c184139285a..0c1a4e12483838ae3cbfb425173d8cd892eeee94 100644 --- a/build_overrides/partition_alloc.gni +++ b/build_overrides/partition_alloc.gni @@ -46,7 +46,7 @@ _disable_partition_alloc_everywhere = diff --git a/patches/chromium/build_disable_print_content_analysis.patch b/patches/chromium/build_disable_print_content_analysis.patch index 6161b6585b396..90786e5345d47 100644 --- a/patches/chromium/build_disable_print_content_analysis.patch +++ b/patches/chromium/build_disable_print_content_analysis.patch @@ -13,7 +13,7 @@ This patch can be removed when enable_print_content_analysis can be more easily enabled or disabled by default with buildflags. diff --git a/printing/buildflags/buildflags.gni b/printing/buildflags/buildflags.gni -index a826dfe8918d70293b001acfd4fc7f4af83e5cdb..436e19e7f0ebc77440583fd16ba2aa740be044ae 100644 +index 8d1aa0153c7b33066fbeb2679fcf1a32549389c3..a96831301d9e60e73092a095d42fecc0a8019144 100644 --- a/printing/buildflags/buildflags.gni +++ b/printing/buildflags/buildflags.gni @@ -48,7 +48,7 @@ declare_args() { 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 d3a867b9bcbb9..b1d5ed3b371b3 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 2153df7bef066da7851bd1cc6375faaeee2f4537..1c138a0f3dfc9c99333aababe4d36b215992e731 100644 +index 7e99d7493ac1f9281668eb3283f7475769245021..3b11f490c77fb667e40c30e7d61e484df1e9972f 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -202,11 +202,16 @@ if (!is_android && !is_mac) { @@ -33,10 +33,10 @@ index 2153df7bef066da7851bd1cc6375faaeee2f4537..1c138a0f3dfc9c99333aababe4d36b21 "//base", "//build:branding_buildflags", diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 07f0f0f97e0dc608513e7f532746f0f9a78e6a94..2dcfb98422d580908882540c01efc3cd05f164ae 100644 +index 20c93fe2fff92b9cb3989ce6d0639f018f121c33..85df12f08f7b5a131d00b871ae533c0bc88f1634 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -4652,7 +4652,7 @@ static_library("browser") { +@@ -4651,7 +4651,7 @@ static_library("browser") { # On Windows, the hashes are embedded in //chrome:chrome_initial rather # than here in :chrome_dll. @@ -46,10 +46,10 @@ index 07f0f0f97e0dc608513e7f532746f0f9a78e6a94..2dcfb98422d580908882540c01efc3cd sources += [ "certificate_viewer_stub.cc" ] } diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index 974ec1a5cd3f06d63b4453dc719446c8b1af5787..1fe92ce6472ef393716d75ec17ee9e56d043ec4e 100644 +index c72ffb36b34ae3c7b2939a316e9d960a079a70fe..3056493bad516a97d4b4678ca7ff68918a27c150 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -6716,7 +6716,6 @@ test("unit_tests") { +@@ -6715,7 +6715,6 @@ test("unit_tests") { deps += [ "//chrome:other_version", @@ -57,7 +57,7 @@ index 974ec1a5cd3f06d63b4453dc719446c8b1af5787..1fe92ce6472ef393716d75ec17ee9e56 "//chrome//services/util_win:unit_tests", "//chrome/app:chrome_dll_resources", "//chrome/app:win_unit_tests", -@@ -6742,6 +6741,10 @@ test("unit_tests") { +@@ -6741,6 +6740,10 @@ test("unit_tests") { "//ui/resources", ] @@ -68,7 +68,7 @@ index 974ec1a5cd3f06d63b4453dc719446c8b1af5787..1fe92ce6472ef393716d75ec17ee9e56 ldflags = [ "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll", "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll", -@@ -7695,7 +7698,6 @@ test("unit_tests") { +@@ -7696,7 +7699,6 @@ test("unit_tests") { } deps += [ @@ -76,7 +76,7 @@ index 974ec1a5cd3f06d63b4453dc719446c8b1af5787..1fe92ce6472ef393716d75ec17ee9e56 "//chrome/browser/apps:icon_standardizer", "//chrome/browser/apps/app_service", "//chrome/browser/apps/app_service:test_support", -@@ -7781,6 +7783,10 @@ test("unit_tests") { +@@ -7782,6 +7784,10 @@ test("unit_tests") { "//ui/webui/resources/js/browser_command:mojo_bindings", ] @@ -86,4 +86,4 @@ index 974ec1a5cd3f06d63b4453dc719446c8b1af5787..1fe92ce6472ef393716d75ec17ee9e56 + data += [ "//ash/components/arc/test/data/icons/" ] - if (include_js_tests) { + if (include_js2gtest_tests) { diff --git a/patches/chromium/build_gn.patch b/patches/chromium/build_gn.patch index 7d9a8cb297018..6645361e63804 100644 --- a/patches/chromium/build_gn.patch +++ b/patches/chromium/build_gn.patch @@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will rebuild the entire tree. diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index 6ee83a41a05488f016f86f90b026835f4b19ea54..63b32e52a11af599dbc5154ed353e2bf7250e9d3 100644 +index b7c498f5b29a7fe8f674257dc9c912514a25253a..968276e781288e92ed87eaba43dba67b4475115c 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -123,6 +123,9 @@ if (current_os == "") { diff --git a/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch b/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch index d2a1de3c08ce7..da7b179f2f351 100644 --- a/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch +++ b/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch @@ -6,7 +6,7 @@ Subject: build: only use the mas build config in the required components Before landing this patch should be split into the relevant MAS patches, or at least the patch this one partially reverts diff --git a/base/BUILD.gn b/base/BUILD.gn -index 173283fa984ed8a6d4fc24287e70450d2806a321..2f5b2b23a33924d8d80d2bc3ce5d9d9f550df3bf 100644 +index ac26cc76c6e78a241b8fb29aa98250b2b99c76cd..8671ecc36caff3a253b2f097f5912298b6ebdf8d 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn @@ -1034,6 +1034,7 @@ component("base") { @@ -18,7 +18,7 @@ index 173283fa984ed8a6d4fc24287e70450d2806a321..2f5b2b23a33924d8d80d2bc3ce5d9d9f deps = [ diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index 63b32e52a11af599dbc5154ed353e2bf7250e9d3..fc6ed0cdbe211cb29dd5a1dded36b3b0a6912ce9 100644 +index 968276e781288e92ed87eaba43dba67b4475115c..05f2f3084cac5bf3e806a03401475667848afd04 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -355,7 +355,6 @@ default_compiler_configs = [ @@ -30,20 +30,19 @@ index 63b32e52a11af599dbc5154ed353e2bf7250e9d3..fc6ed0cdbe211cb29dd5a1dded36b3b0 if (is_win) { diff --git a/components/os_crypt/sync/BUILD.gn b/components/os_crypt/sync/BUILD.gn -index 7ed10085264af6f50b05e51dd93c49e3828d5b3b..d8c77f52376a13af7636e64ff0b5cf58f4fbcf97 100644 +index f3e2ea6d0430df493fcebab6d6271299a2307b69..d01a9f2cbd5aa8de768c9c1e765c464bd31a115a 100644 --- a/components/os_crypt/sync/BUILD.gn +++ b/components/os_crypt/sync/BUILD.gn -@@ -48,6 +48,8 @@ component("os_crypt") { +@@ -47,6 +47,7 @@ component("os_crypt") { + "keychain_password_mac.mm", "os_crypt_mac.mm", ] - configs += [ "//build/config/compiler:enable_arc" ] -+ + configs += ["//electron/build/config:mas_build"] } if (is_win) { diff --git a/components/remote_cocoa/app_shim/BUILD.gn b/components/remote_cocoa/app_shim/BUILD.gn -index c52c741205d140fbe8b3be02974c89ea22c2365f..9460c656f71e24044ffccc55053a04b8f23f15e9 100644 +index 0625f07f317de46af619fdb279be78d9ecdc0029..5897820839d6d57ada22a83fe753e3a6b3d752de 100644 --- a/components/remote_cocoa/app_shim/BUILD.gn +++ b/components/remote_cocoa/app_shim/BUILD.gn @@ -16,6 +16,7 @@ component("app_shim") { @@ -55,10 +54,10 @@ index c52c741205d140fbe8b3be02974c89ea22c2365f..9460c656f71e24044ffccc55053a04b8 "alert.h", "alert.mm", diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn -index fa72a9170a7e41ae475b05653be99af59d4eaebb..b5c39b57a61a6595b842c52da8489bdbf2420b2c 100644 +index 440fa0b3ff9b08016ff19ab54c70a453dc8c5f86..2e2f358829bf0492fd3e44173eeb7d0b5507b388 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn -@@ -332,6 +332,7 @@ viz_component("service") { +@@ -331,6 +331,7 @@ viz_component("service") { "frame_sinks/external_begin_frame_source_mac.h", ] } @@ -66,17 +65,16 @@ index fa72a9170a7e41ae475b05653be99af59d4eaebb..b5c39b57a61a6595b842c52da8489bdb } if (is_android || use_ozone) { -@@ -590,6 +591,8 @@ viz_source_set("unit_tests") { +@@ -588,6 +589,7 @@ viz_source_set("unit_tests") { + "display_embedder/software_output_device_mac_unittest.mm", ] - configs += [ "//build/config/compiler:enable_arc" ] frameworks = [ "IOSurface.framework" ] -+ + configs += ["//electron/build/config:mas_build"] } if (is_win) { diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 183c520baa855d3065f34f3bc90c8c590237192c..7f587f6e743e312898ca81908d1f85856ef3bd09 100644 +index 88eca71122353752154a29e4f54693c3ac13f930..4540aff3ac4a06f76d332322fe87618f8a5cb6d0 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -56,6 +56,7 @@ source_set("browser") { @@ -88,7 +86,7 @@ index 183c520baa855d3065f34f3bc90c8c590237192c..7f587f6e743e312898ca81908d1f8585 libs = [] frameworks = [] diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn -index aa1ae523aee045fb1db412a42af8aadb97e9ee2a..e5fe6c0212721a67d67b17ee8871eb92e339f845 100644 +index dce27cfa39b52e39a95cee658584ed80ab1953ef..366edd2e86edcdbb30ae4c0fa952b5d9aab38f8a 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn @@ -174,6 +174,7 @@ source_set("common") { @@ -100,10 +98,10 @@ index aa1ae523aee045fb1db412a42af8aadb97e9ee2a..e5fe6c0212721a67d67b17ee8871eb92 public_deps = [ ":mojo_bindings", diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn -index 65714a5dca013794527640645d8eb2ce36049ac6..b2df50b4cd64816ddf9c5b7e222c47b60304f01e 100644 +index 62117d9c83972003d0483ed9fc6efad6a4490a75..246d7289fd5727886054e182e17520c5ce5a7916 100644 --- a/content/renderer/BUILD.gn +++ b/content/renderer/BUILD.gn -@@ -228,6 +228,7 @@ target(link_target_type, "renderer") { +@@ -224,6 +224,7 @@ target(link_target_type, "renderer") { } configs += [ "//content:content_implementation" ] @@ -112,10 +110,10 @@ index 65714a5dca013794527640645d8eb2ce36049ac6..b2df50b4cd64816ddf9c5b7e222c47b6 public_deps = [ diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn -index a779b02aefe3d26e5193d6cecef1675ef5937a4d..34ddd9c1b0ef8cd6ed866cd1ba1e033b9fef6023 100644 +index 23b9f9008046f957c19bc169cc87defa49af46b3..72a11a958c3aecec43737d41d3a2219ac7416f8a 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn -@@ -475,6 +475,7 @@ static_library("test_support") { +@@ -477,6 +477,7 @@ static_library("test_support") { configs += [ "//build/config:precompiled_headers", "//v8:external_startup_data", @@ -124,7 +122,7 @@ index a779b02aefe3d26e5193d6cecef1675ef5937a4d..34ddd9c1b0ef8cd6ed866cd1ba1e033b public_deps = [ diff --git a/content/web_test/BUILD.gn b/content/web_test/BUILD.gn -index 382a502c61183862bc2c943f7f8ac3958311754d..79610173fa83cc4d2c2041bd6e8a124836b3a844 100644 +index 5fcb135fdcdee5022e5caed46dece4e304495bfe..83cc95b1086b0619be019d7b797f3395910884b7 100644 --- a/content/web_test/BUILD.gn +++ b/content/web_test/BUILD.gn @@ -145,6 +145,8 @@ static_library("web_test_browser") { @@ -133,26 +131,26 @@ index 382a502c61183862bc2c943f7f8ac3958311754d..79610173fa83cc4d2c2041bd6e8a1248 + configs += ["//electron/build/config:mas_build"] + - if (is_apple) { - configs += [ "//build/config/compiler:enable_arc" ] - } + if (is_mac) { + sources += [ + "browser/web_test_browser_main_platform_support_mac.mm", diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn -index f619de1d332d7f0c5d6d30be17f5c6b94dadf6a3..4b1bbe5a804ef0d844eaf246942129e7753ea0f5 100644 +index 1a8164c2ef7d6b24c4feb19ce3f3b5e970885541..e9122ac24b7b5f9359a89953fa24364a0115bdf6 100644 --- a/device/bluetooth/BUILD.gn +++ b/device/bluetooth/BUILD.gn -@@ -242,6 +242,7 @@ component("bluetooth") { +@@ -241,6 +241,7 @@ component("bluetooth") { + "IOKit.framework", "Foundation.framework", ] - configs += [ "//build/config/compiler:enable_arc" ] + configs += ["//electron/build/config:mas_build"] } if (is_mac) { diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn -index 911cc3f4764a7a61e599a41a2dd2812d07b867f7..1257e7de947195ed6f8a9906b5a9e26a7bd6216b 100644 +index 550cf601dcb65e710e9dab6fb5023119b52b5278..18e60732057a3695858b17d6faef13927f869726 100644 --- a/gpu/ipc/service/BUILD.gn +++ b/gpu/ipc/service/BUILD.gn -@@ -139,6 +139,7 @@ component("service") { +@@ -138,6 +138,7 @@ component("service") { "QuartzCore.framework", ] defines += [ "GL_SILENCE_DEPRECATION" ] @@ -161,10 +159,10 @@ index 911cc3f4764a7a61e599a41a2dd2812d07b867f7..1257e7de947195ed6f8a9906b5a9e26a if (is_ios) { sources += [ "image_transport_surface_ios.mm" ] diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn -index fbed855d14713ec3507b62d86d37b7be9969581e..b08bdea30ad4e5caf26f59c66c34fd63cd6207e4 100644 +index 93cf87a37792691f41d7c611104a378d9af45195..2d3a0f923f4991be41534e7f951fe5dfcceda5c9 100644 --- a/media/audio/BUILD.gn +++ b/media/audio/BUILD.gn -@@ -203,6 +203,7 @@ source_set("audio") { +@@ -199,6 +199,7 @@ source_set("audio") { "mac/coreaudio_dispatch_override.h", ] frameworks += [ "AudioUnit.framework" ] @@ -214,10 +212,10 @@ index 5e9fc18352d1bf0939f8366d2282b49aeb307994..69dcc2cafa27b3d8bdf3fe8d0a22a980 source_set("sandbox_unittests") { diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn -index 6c01341efc1e8a7f3ae13ea5c0abab5f757b104c..2299d118d763193a2500978541d12d5f1aa712ab 100644 +index 7b327be8a003ae01f79f71f00979ef0b2f45ac2a..ab84abb8c6ad1250de2beac0370427f84e1cbb41 100644 --- a/third_party/blink/renderer/core/BUILD.gn +++ b/third_party/blink/renderer/core/BUILD.gn -@@ -307,6 +307,7 @@ component("core") { +@@ -308,6 +308,7 @@ component("core") { configs -= core_config_remove configs += core_config_add configs += [ "//v8:external_startup_data" ] @@ -226,10 +224,10 @@ index 6c01341efc1e8a7f3ae13ea5c0abab5f757b104c..2299d118d763193a2500978541d12d5f public_deps = [ ":core_generated", diff --git a/ui/accelerated_widget_mac/BUILD.gn b/ui/accelerated_widget_mac/BUILD.gn -index d361b9686e66014f2333f8a4f6b6819bb52ececd..a67c517acbd1d25fe1ac114ef3ca8d481b2184ad 100644 +index 3ead42e14ad9d41a30c5637678a3ac49296ce2a6..8dec61ee6a62e54ec3c8c5dd5e08601c28d04dfe 100644 --- a/ui/accelerated_widget_mac/BUILD.gn +++ b/ui/accelerated_widget_mac/BUILD.gn -@@ -35,6 +35,8 @@ component("accelerated_widget_mac") { +@@ -33,6 +33,8 @@ component("accelerated_widget_mac") { "QuartzCore.framework", ] @@ -239,10 +237,10 @@ index d361b9686e66014f2333f8a4f6b6819bb52ececd..a67c517acbd1d25fe1ac114ef3ca8d48 sources += [ "ca_layer_frame_sink_provider.h" ] } diff --git a/ui/accessibility/platform/BUILD.gn b/ui/accessibility/platform/BUILD.gn -index 0d3fdc9b8cdff853b54e413de98800142be332d2..de65225a25ce6d6d3ff531c5c53d225993f7170a 100644 +index 4e23c38763184840a393589b3f55dcabb0db8121..e4ad30d0d7acecdca3a22fe05935a3406d784a95 100644 --- a/ui/accessibility/platform/BUILD.gn +++ b/ui/accessibility/platform/BUILD.gn -@@ -253,6 +253,7 @@ component("platform") { +@@ -251,6 +251,7 @@ component("platform") { weak_frameworks = [ "Accessibility.framework", # macOS 11 ] @@ -251,7 +249,7 @@ index 0d3fdc9b8cdff853b54e413de98800142be332d2..de65225a25ce6d6d3ff531c5c53d2259 if (use_atk) { diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index 0d07c88cb9fec014b727b5294a03671d183943ea..0d869fbc084773630f63380bb87e2ae6ee5b1ea9 100644 +index 614ae2d72c934f0f6650a501b7d132f5745f767e..ff4302c344ede0021c7379efeb17e2a1111cdce0 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn @@ -355,6 +355,7 @@ component("base") { @@ -263,7 +261,7 @@ index 0d07c88cb9fec014b727b5294a03671d183943ea..0d869fbc084773630f63380bb87e2ae6 if (is_apple) { diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn -index e37e8a6f980a9eb522eea2191be2691d49a9638d..8fcfcfdec68e0c591abd58dbde957d2dbccf491f 100644 +index 7e17546f658ce0e6908f7dea499eac31e5295895..85c5fe7e25a84de5342d3d9b8cd20d195dd2b159 100644 --- a/ui/display/BUILD.gn +++ b/ui/display/BUILD.gn @@ -67,6 +67,10 @@ component("display") { @@ -278,7 +276,7 @@ index e37e8a6f980a9eb522eea2191be2691d49a9638d..8fcfcfdec68e0c591abd58dbde957d2d if (is_win) { diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn -index e66e2339ea3cb8b2b80ef3f0b09dcc53a2240339..07e11afb172ecbb24c04f25f87c11bdc5c91cd58 100644 +index 0829ee9a58400dea171c99e0784607305092aa92..eaa938d159ed43539ca29c863318cd35b94a5531 100644 --- a/ui/gfx/BUILD.gn +++ b/ui/gfx/BUILD.gn @@ -194,6 +194,7 @@ component("gfx") { @@ -290,10 +288,10 @@ index e66e2339ea3cb8b2b80ef3f0b09dcc53a2240339..07e11afb172ecbb24c04f25f87c11bdc if (is_win) { sources += [ diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn -index 002c180d97ced4c5711f6d432c2c09108bcbc69c..6d52e99b6f9414a907fa3b74fc2930795510d086 100644 +index 06cc420c752d1690ef2864b203721ba4c38e7f89..0fe2cb7ea7f15edd31db9e047fcb0cd9ddb5d1ed 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn -@@ -686,6 +686,7 @@ component("views") { +@@ -685,6 +685,7 @@ component("views") { "IOSurface.framework", "QuartzCore.framework", ] @@ -301,7 +299,7 @@ index 002c180d97ced4c5711f6d432c2c09108bcbc69c..6d52e99b6f9414a907fa3b74fc293079 } if (is_win) { -@@ -1105,6 +1106,8 @@ source_set("test_support") { +@@ -1104,6 +1105,8 @@ source_set("test_support") { "//testing/gtest", ] @@ -311,14 +309,13 @@ index 002c180d97ced4c5711f6d432c2c09108bcbc69c..6d52e99b6f9414a907fa3b74fc293079 sources += [ "test/desktop_window_tree_host_win_test_api.cc", diff --git a/ui/views/controls/webview/BUILD.gn b/ui/views/controls/webview/BUILD.gn -index 349d94b5b14e346d5bb73b53567fbfee12198dc6..998178845e241c8b45a3ef8ad542d10a4e687831 100644 +index e3dd4fab3a1cac0138f8dac60247e0ea3343e87e..998178845e241c8b45a3ef8ad542d10a4e687831 100644 --- a/ui/views/controls/webview/BUILD.gn +++ b/ui/views/controls/webview/BUILD.gn -@@ -19,7 +19,10 @@ component("webview") { +@@ -19,6 +19,10 @@ component("webview") { if (is_mac) { sources += [ "unhandled_keyboard_event_handler_mac.mm" ] -- configs += [ "//build/config/compiler:enable_arc" ] + configs += [ + "//build/config/compiler:enable_arc", + "//electron/build/config:mas_build", diff --git a/patches/chromium/build_remove_ent_content_analysis_assert.patch b/patches/chromium/build_remove_ent_content_analysis_assert.patch new file mode 100644 index 0000000000000..5dea5d5bb7d29 --- /dev/null +++ b/patches/chromium/build_remove_ent_content_analysis_assert.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Keeley Hammond +Date: Tue, 1 Aug 2023 11:27:30 -0700 +Subject: build: remove enterprise content analysis assert + +Chromium is using enterprise content analysis, which is something +Electron is not concerned with. Remove this assert before building. +This patch can be removed when we decide how we want to handle +enterprise content analysis. + +diff --git a/components/enterprise/buildflags/buildflags.gni b/components/enterprise/buildflags/buildflags.gni +index 7653c1c9e8fb18ce2c471af11468583d2da0cfb0..f63c1c7263b40d4344ef4b8468acb77d9718e19c 100644 +--- a/components/enterprise/buildflags/buildflags.gni ++++ b/components/enterprise/buildflags/buildflags.gni +@@ -31,4 +31,4 @@ declare_args() { + # These two flags are equivalent, but `enable_print_content_analysis` still + # needs to exist separately as it lives under //printing which cannot depend + # on //components. +-assert(enterprise_content_analysis == enable_print_content_analysis) ++# assert(enterprise_content_analysis == enable_print_content_analysis) diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index e68f891e55d8a..b749a81b00a84 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 337c990b8a5fcce3526be405500b538ea62c2dba..587d3594c54bb395db7074b0c2e2f10fa61d682b 100644 +index 00b57b62ce1d6de6fd12accb082282c1325ad801..81b495cce7891a30c3ea1acc9160566d66acaef0 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -8034,6 +8034,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -8042,6 +8042,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,7 +21,7 @@ index 337c990b8a5fcce3526be405500b538ea62c2dba..587d3594c54bb395db7074b0c2e2f10f &no_javascript_access); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index cd8824f971af6fd092e3ac3ea2ffc80a9dc3aa44..e262b0d1b1c50b81345d6333c5190769dd35c4a8 100644 +index 9a2acf6b3a661705c740de6bd84cc0abcba7973f..f362dc586802e47f45558b0cc068e2bf44cb796e 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -4301,6 +4301,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( @@ -51,7 +51,7 @@ index cd8824f971af6fd092e3ac3ea2ffc80a9dc3aa44..e262b0d1b1c50b81345d6333c5190769 new_contents_impl, opener, params.target_url, params.referrer.To(), params.disposition, diff --git a/content/common/frame.mojom b/content/common/frame.mojom -index b0b0236d58b97bae0c80998c5eff4ede5879de00..c92546b9853219bf601f550416ce392aad399bbf 100644 +index a1757960b139dea126e34776e9ec7768d9e3d89d..a3226c9a8080537daa2454b8014a691967bde058 100644 --- a/content/common/frame.mojom +++ b/content/common/frame.mojom @@ -619,6 +619,10 @@ struct CreateNewWindowParams { @@ -100,10 +100,10 @@ index 738cf91eca91de2732d1b3d2cfef7a482a768db3..e942f9cf1fb664591264e75e80d5d93a bool opener_suppressed, bool* no_javascript_access); diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc -index 0e348f7ca57e3004c1f85435ecd0c66896c5a8fb..8019a5c687a87a4257f9f7c0581781095fc20043 100644 +index 688fac1fd874438ad9bc6494691b0eadca7e5bb2..db12930a449b38966e63c2274275b1157f38bea7 100644 --- a/content/public/browser/web_contents_delegate.cc +++ b/content/public/browser/web_contents_delegate.cc -@@ -28,6 +28,17 @@ namespace content { +@@ -29,6 +29,17 @@ namespace content { WebContentsDelegate::WebContentsDelegate() = default; @@ -122,7 +122,7 @@ index 0e348f7ca57e3004c1f85435ecd0c66896c5a8fb..8019a5c687a87a4257f9f7c058178109 const OpenURLParams& params) { return nullptr; diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h -index c5bda327264c330345baf7b44b4ba5c478e58952..989778079d5dc91127989e43f3ce6b25a9df56d4 100644 +index 5a764b2f531e79bf31ab4c3c24b0f8adca241985..413419ac25d62f5058003480bc79d7a75c32a410 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -16,6 +16,7 @@ @@ -148,10 +148,10 @@ index c5bda327264c330345baf7b44b4ba5c478e58952..989778079d5dc91127989e43f3ce6b25 // 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 f8e6dce7f67424322a6d14c0a188e5ebb7daea7d..6aecc6c215cb33bf4b0f2cd38a79ebeef6be527d 100644 +index 9acd28becf42c2d25f6863df365003b0367e09ae..abaf6b2c59058b670d1989be3693d7d69557e850 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -6371,6 +6371,10 @@ WebView* RenderFrameImpl::CreateNewWindow( +@@ -6373,6 +6373,10 @@ WebView* RenderFrameImpl::CreateNewWindow( request.HasUserGesture(), GetWebFrame()->IsAdFrame(), GetWebFrame()->IsAdScriptInStack()); @@ -210,7 +210,7 @@ index bef5a989bac50c177f15f52fe87ac3790d553e85..65dcd2e3b51929400c8bfb6a98a4fb59 } // 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 22811c82015f2ab2b7715ac503c9b5106cfd9d73..cd2336506d5826c827ce0e0fd8e17ad28217e6f7 100644 +index efeac59aa515706fd4b3c0e5654d60f3185b62fd..c99c355f52a84256286ca0cd130085b4e54d356a 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc @@ -2192,6 +2192,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, diff --git a/patches/chromium/chore_add_buildflag_guard_around_new_include.patch b/patches/chromium/chore_add_buildflag_guard_around_new_include.patch index 4173334632847..b9d3333760d88 100644 --- a/patches/chromium/chore_add_buildflag_guard_around_new_include.patch +++ b/patches/chromium/chore_add_buildflag_guard_around_new_include.patch @@ -9,7 +9,7 @@ This is an experimental commit; but if it's successful, This patch should be upstreamed and then removed from electron's code. diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h -index 4aca3728a4a3a49d41bbb1b8f036024b2afec52a..ab8f07dafa915be32fe4cc93aa6c1c8ae3801b2a 100644 +index 502c0a7ffc25f1b9c1077734a77b16dd23f7942a..c4ecee6f375a1dc5adbd87023ff4130f29636553 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -43,7 +43,6 @@ diff --git a/patches/chromium/chore_add_electron_deps_to_gitignores.patch b/patches/chromium/chore_add_electron_deps_to_gitignores.patch index 16ab82bdd7e3f..9750a1df77bb4 100644 --- a/patches/chromium/chore_add_electron_deps_to_gitignores.patch +++ b/patches/chromium/chore_add_electron_deps_to_gitignores.patch @@ -18,10 +18,10 @@ index 6241dd501bd423350accd2a2f0b69b5d8b7e45bd..08befddc25e17bfde46bb11e94b646e8 /google_apis/internal /googleurl diff --git a/third_party/.gitignore b/third_party/.gitignore -index 414cd656ba3c210d346f0b2e84aa7a414a3754c3..c2a18f684fb82fea298b11d946946d685c23e753 100644 +index 5464e9e25c767ceefef15553c546687d2ab5fdd3..1b82a4e3e9763b59cba4efc4044abcaa7e6c956f 100644 --- a/third_party/.gitignore +++ b/third_party/.gitignore -@@ -94,6 +94,7 @@ +@@ -95,6 +95,7 @@ /directxsdk /dom_distiller_js/dist /eigen3/src @@ -29,7 +29,7 @@ index 414cd656ba3c210d346f0b2e84aa7a414a3754c3..c2a18f684fb82fea298b11d946946d68 /elfutils/src /emoji-metadata/src /emoji-segmenter/src -@@ -204,6 +205,7 @@ +@@ -205,6 +206,7 @@ /mocha /mockito/src /nacl_sdk_binaries/ @@ -37,7 +37,7 @@ index 414cd656ba3c210d346f0b2e84aa7a414a3754c3..c2a18f684fb82fea298b11d946946d68 /nasm /nearby/src /neon_2_sse/src -@@ -271,6 +273,7 @@ +@@ -272,6 +274,7 @@ /speex /sqlite/src /sqlite4java/lib/ diff --git a/patches/chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch b/patches/chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch index eb21bacb8eac2..b192e56dc4319 100644 --- a/patches/chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch +++ b/patches/chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch @@ -9,10 +9,10 @@ Electron does not support Profiles, so this Profile::FromBrowserContext() call is not needed and will not link. This change patches it out. diff --git a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc -index 080e5b64e5fbbe9c126996549dddf7ce312998ee..47a026798a6be7ec8b7cde5b55b29d505d4f2e4c 100644 +index 33efdcfbc8ae731440f53ea270db4718f54b167a..139ef2300a521ed9552c3849e8836a4ee83a53eb 100644 --- a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc +++ b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc -@@ -39,6 +39,7 @@ namespace { +@@ -41,6 +41,7 @@ namespace { // hierarchy is: enterprise policy > user choice > finch experiment. bool ShouldEnableSkiaRenderer(content::WebContents* contents) { CHECK(contents); @@ -20,7 +20,7 @@ index 080e5b64e5fbbe9c126996549dddf7ce312998ee..47a026798a6be7ec8b7cde5b55b29d50 const PrefService* prefs = Profile::FromBrowserContext(contents->GetBrowserContext())->GetPrefs(); -@@ -46,6 +47,7 @@ bool ShouldEnableSkiaRenderer(content::WebContents* contents) { +@@ -48,6 +49,7 @@ bool ShouldEnableSkiaRenderer(content::WebContents* contents) { if (prefs->IsManagedPreference(prefs::kPdfUseSkiaRendererEnabled)) { return prefs->GetBoolean(prefs::kPdfUseSkiaRendererEnabled); } diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index 26ab5864d8f3b..d47e825e67b10 100644 --- a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch +++ b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch @@ -218,7 +218,7 @@ index 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7 void AddNewContents(content::WebContents* source, std::unique_ptr new_contents, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index a41d8c314019ddd26e7c549149053bae25080d68..c302ba2e69b71b58faf40bc3e622b22183b17f26 100644 +index d95743b1ab3461f69326ca904448636de88ea070..a32f963654763cc0c706f752eca96e8cf5d0be54 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -4208,8 +4208,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( @@ -232,10 +232,10 @@ index a41d8c314019ddd26e7c549149053bae25080d68..c302ba2e69b71b58faf40bc3e622b221 static_cast(delegate_->CreateCustomWebContents( opener, source_site_instance, is_new_browsing_instance, diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc -index 8019a5c687a87a4257f9f7c0581781095fc20043..d7ccb0f7a7b15fb19640b1b0491750b179a77693 100644 +index db12930a449b38966e63c2274275b1157f38bea7..2d770e9c0c88e5ad1fac15fd13b70e6b5be824c8 100644 --- a/content/public/browser/web_contents_delegate.cc +++ b/content/public/browser/web_contents_delegate.cc -@@ -136,8 +136,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden( +@@ -137,8 +137,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden( SiteInstance* source_site_instance, mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -246,7 +246,7 @@ index 8019a5c687a87a4257f9f7c0581781095fc20043..d7ccb0f7a7b15fb19640b1b0491750b1 } diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h -index 989778079d5dc91127989e43f3ce6b25a9df56d4..71b5a7c30f6546e3172ea31f9b0572c0e6a9f660 100644 +index 413419ac25d62f5058003480bc79d7a75c32a410..009a3d55f59a1ac80402327b43de45b13d5d8cfe 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -322,8 +322,7 @@ class CONTENT_EXPORT WebContentsDelegate { diff --git a/patches/chromium/disable_compositor_recycling.patch b/patches/chromium/disable_compositor_recycling.patch index cb04037544c41..06cb3b9190b95 100644 --- a/patches/chromium/disable_compositor_recycling.patch +++ b/patches/chromium/disable_compositor_recycling.patch @@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron. diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index f9d1b5d75d88eddc51bbabca4cb0571d8f5882ab..9bcc38946c670b807e8835be5bf28c00bb0c2668 100644 +index a9b4caaa4da3bee1a22db976a8ec71dc7d5400ed..4dda552f4dc50e6e3a184e95e771b7141e19e736 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -532,7 +532,11 @@ +@@ -540,7 +540,11 @@ return; host()->WasHidden(); diff --git a/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch b/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch index fe808f9b142f2..39043f625d4e4 100644 --- a/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch +++ b/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch @@ -9,7 +9,7 @@ correctly tagged with MAP_JIT we need to use gins page allocator instead of the default V8 allocator. This probably can't be usptreamed. diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h -index 565f531328041edaac847d02881cce6e1e4f7d54..5a40be3acb11c5851daa9f8001e6a176c2d20ab1 100644 +index df59829cbb31a5a7d8aa72df6dd8a9e623cbf60a..841cf5877f199bd77e4c84921ddddf83bf849d8a 100644 --- a/gin/public/v8_platform.h +++ b/gin/public/v8_platform.h @@ -32,6 +32,7 @@ class GIN_EXPORT V8Platform : public v8::Platform { @@ -21,7 +21,7 @@ index 565f531328041edaac847d02881cce6e1e4f7d54..5a40be3acb11c5851daa9f8001e6a176 ThreadIsolatedAllocator* GetThreadIsolatedAllocator() override; #endif diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc -index a0bc00a3d1397934276517c19e0a76098b7099f5..7432989344148480bc4ff5f8808cf588ec45b868 100644 +index 2491bf34cffd22f580d1c18bedfcf061e84abc4c..73469c926f69b4a7b7e982263307b2aab24c81a6 100644 --- a/gin/v8_platform.cc +++ b/gin/v8_platform.cc @@ -338,6 +338,10 @@ ThreadIsolatedAllocator* V8Platform::GetThreadIsolatedAllocator() { diff --git a/patches/chromium/expose_v8initializer_codegenerationcheckcallbackinmainthread.patch b/patches/chromium/expose_v8initializer_codegenerationcheckcallbackinmainthread.patch index cd81458194480..088cac67923c6 100644 --- a/patches/chromium/expose_v8initializer_codegenerationcheckcallbackinmainthread.patch +++ b/patches/chromium/expose_v8initializer_codegenerationcheckcallbackinmainthread.patch @@ -6,7 +6,7 @@ Subject: expose V8Initializer::CodeGenerationCheckCallbackInMainThread This is needed to blend Blink and Node's policy for code generation policy. 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 4a0ae5a492e35b8f11d9f4f98083a63050e0bbe0..653eaaddb8bd69de392695894fabfdacddc7de90 100644 +index 60e8ed950dad31a220bbe8a9197fbe25f429fe83..b8b20d8c8340c63bd3039a0683446ef1eb4fdf0d 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc @@ -439,8 +439,9 @@ TrustedTypesCodeGenerationCheck(v8::Local context, 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 a762065fba43c..099f1efbf4e3f 100644 --- a/patches/chromium/feat_configure_launch_options_for_service_process.patch +++ b/patches/chromium/feat_configure_launch_options_for_service_process.patch @@ -183,7 +183,7 @@ index 01e62d7e8df65efb900e9cd0d34bcd8e0ed3e7da..9af6784707f125046d9a734165fc2b08 host->GetChildProcess()->BindServiceInterface(std::move(receiver)); } diff --git a/content/browser/utility_process_host.cc b/content/browser/utility_process_host.cc -index 8a132fc9721ca1145249e0ccfaf019c3babf2739..411662674b0ad47e273957aacc80ddcafe0e84ab 100644 +index c54b0c7b80a95564a30672784ee3ba2edbbf0a87..0336b15775e3bb96f54c776d673601931cce7d8a 100644 --- a/content/browser/utility_process_host.cc +++ b/content/browser/utility_process_host.cc @@ -156,11 +156,13 @@ const ChildProcessData& UtilityProcessHost::GetData() { @@ -227,7 +227,7 @@ index 8a132fc9721ca1145249e0ccfaf019c3babf2739..411662674b0ad47e273957aacc80ddca mojom::ChildProcess* UtilityProcessHost::GetChildProcess() { return static_cast(process_->GetHost()) ->child_process(); -@@ -445,9 +465,22 @@ bool UtilityProcessHost::StartProcess() { +@@ -443,9 +463,22 @@ bool UtilityProcessHost::StartProcess() { } #endif // BUILDFLAG(IS_LINUX) @@ -627,10 +627,10 @@ index cb43aa14c9742f3788ae58c3e49b890cd532f327..6a738f7aade504f2ff3bb6647a0da8f8 #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 8a130451b14772e2f4280403576b4d3d3d5827ff..c5aab674d99f7c8b38e477eea56dad33bc234930 100644 +index 2ee0182088f41846f352fae0b67fc90448855355..9dc5630e1e858ef4de91680ad119e5bf5696e1e3 100644 --- a/sandbox/policy/win/sandbox_win.cc +++ b/sandbox/policy/win/sandbox_win.cc -@@ -697,11 +697,9 @@ ResultCode GenerateConfigForSandboxedProcess(const base::CommandLine& cmd_line, +@@ -706,11 +706,9 @@ base::win::ScopedHandle CreateUnsandboxedJob() { // command line flag. ResultCode LaunchWithoutSandbox( const base::CommandLine& cmd_line, @@ -643,7 +643,7 @@ index 8a130451b14772e2f4280403576b4d3d3d5827ff..c5aab674d99f7c8b38e477eea56dad33 // Network process runs in a job even when unsandboxed. This is to ensure it // does not outlive the browser, which could happen if there is a lot of I/O // on process shutdown, in which case TerminateProcess can fail. See -@@ -930,7 +928,7 @@ bool SandboxWin::InitTargetServices(TargetServices* target_services) { +@@ -938,7 +936,7 @@ bool SandboxWin::InitTargetServices(TargetServices* target_services) { ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( const base::CommandLine& cmd_line, const std::string& process_type, @@ -652,7 +652,7 @@ index 8a130451b14772e2f4280403576b4d3d3d5827ff..c5aab674d99f7c8b38e477eea56dad33 SandboxDelegate* delegate, TargetPolicy* policy) { const base::CommandLine& launcher_process_command_line = -@@ -944,7 +942,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( +@@ -952,7 +950,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( } // Add any handles to be inherited to the policy. @@ -661,7 +661,7 @@ index 8a130451b14772e2f4280403576b4d3d3d5827ff..c5aab674d99f7c8b38e477eea56dad33 policy->AddHandleToShare(handle); if (!policy->GetConfig()->IsConfigured()) { -@@ -959,6 +957,13 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( +@@ -967,6 +965,13 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( // have no effect. These calls can fail with SBOX_ERROR_BAD_PARAMS. policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE)); policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE)); @@ -675,7 +675,7 @@ index 8a130451b14772e2f4280403576b4d3d3d5827ff..c5aab674d99f7c8b38e477eea56dad33 #endif if (!delegate->PreSpawnTarget(policy)) -@@ -971,7 +976,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( +@@ -979,7 +984,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess( ResultCode SandboxWin::StartSandboxedProcess( const base::CommandLine& cmd_line, const std::string& process_type, @@ -684,7 +684,7 @@ index 8a130451b14772e2f4280403576b4d3d3d5827ff..c5aab674d99f7c8b38e477eea56dad33 SandboxDelegate* delegate, base::Process* process) { const base::ElapsedTimer timer; -@@ -979,13 +984,13 @@ ResultCode SandboxWin::StartSandboxedProcess( +@@ -987,13 +992,13 @@ ResultCode SandboxWin::StartSandboxedProcess( // Avoid making a policy if we won't use it. if (IsUnsandboxedProcess(delegate->GetSandboxType(), cmd_line, *base::CommandLine::ForCurrentProcess())) { 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 0fd30f2e3b9ba..2e138bc40b3a9 100644 --- a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch +++ b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch @@ -87,7 +87,7 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217 private: const HWND hwnd_; diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn -index 7d16c747af4b807b9084ff8f9d00e576ed83949b..fa72a9170a7e41ae475b05653be99af59d4eaebb 100644 +index ade4e4973a0e9bd47604262c76bfbd0ee3c9dc38..440fa0b3ff9b08016ff19ab54c70a453dc8c5f86 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn @@ -141,6 +141,8 @@ viz_component("service") { 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 b14a00b8e205a..5599666ca4593 100644 --- a/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch +++ b/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch @@ -37,7 +37,7 @@ index d5239af9a83d408ed8e6e71daa3e2458318ed0df..2fdaf6813ccec6e7cba074ffd7e3c01f allow_cookies_from_browser == other.allow_cookies_from_browser && client_security_state == other.client_security_state; diff --git a/services/network/public/cpp/resource_request.h b/services/network/public/cpp/resource_request.h -index 9ccc46def23013c59a7e32a8395976896d313fac..1dc6a0b40d5790bc5491c2e530536297d5dd2ced 100644 +index bf16ec49862bd3c13e052a737ffd1a7f258cb124..5d7f4708b41bc40eacd3a1a6282cf62aa72c65f8 100644 --- a/services/network/public/cpp/resource_request.h +++ b/services/network/public/cpp/resource_request.h @@ -69,6 +69,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest { diff --git a/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch b/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch index d258cfc51b7be..0ac5be9fe9646 100644 --- a/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch +++ b/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch @@ -6,7 +6,7 @@ Subject: fix: allow guest webcontents to enter fullscreen This can be upstreamed, a guest webcontents can't technically become the focused webContents. This DCHECK should allow all guest webContents to request fullscreen entrance. diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 6a119a6179cc242a63cb6fcc7c4974dd15b721df..1ef7b6fc8de9200c88da456c7eda6de9c5eee9a4 100644 +index 998357b01a55def3d9c1e37d09f52d61b5ecd6f2..3872ee9b4e3182b8a39c51f13d577776eeccd2b1 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -3705,7 +3705,7 @@ void WebContentsImpl::EnterFullscreenMode( 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 2f71e41a60f9a..33a5f520723b0 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 @@ -17,10 +17,10 @@ policy->CanCommitOriginAndUrl. 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 4c87713a727a2552ad4c8d06ad6ac08a4e92f89a..972f1b9152fc74ed34012971e7671a9b49ce3244 100644 +index a051e2465abbd3efcad566e8dbb57f4e97555817..20a6765d68405b365217eba5b6fa8cd7f331470f 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -7383,10 +7383,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { +@@ -7450,10 +7450,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { if (IsForMhtmlSubframe()) return origin_with_debug_info; @@ -37,10 +37,10 @@ index 4c87713a727a2552ad4c8d06ad6ac08a4e92f89a..972f1b9152fc74ed34012971e7671a9b } diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h -index 93ebbbccba69fa1090feb8c02138f25471bf89d9..556ed4f9bb392de7e88519aa87a2a13a5158647d 100644 +index cf2e1594a41c95d7ac1bffc06df6331cb6dd31e0..aaebfc7fe6f06114b3bc6accceefdba0d3f97408 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h -@@ -2952,6 +2952,17 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -2959,6 +2959,17 @@ class CONTENT_EXPORT RenderFrameHostImpl // last committed document. CookieChangeListener::CookieChangeInfo GetCookieChangeInfo(); @@ -58,7 +58,7 @@ index 93ebbbccba69fa1090feb8c02138f25471bf89d9..556ed4f9bb392de7e88519aa87a2a13a // Sets a ResourceCache in the renderer. `this` must be active and there must // be no pending navigation. `remote` must have the same and process // isolation policy. -@@ -3343,17 +3354,6 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -3350,17 +3361,6 @@ class CONTENT_EXPORT RenderFrameHostImpl // relevant. void ResetWaitingState(); 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 1f9b6981c52bf..96d450d95a05b 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 @@ -45,7 +45,7 @@ index ed0641b888c6421b1791c086466bd9c158e9109d..3760b3823d5af3325017bb53f5b1d38e // RenderFrameMetadataProvider::Observer implementation. void OnRenderFrameMetadataChangedBeforeActivation( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 1ef7b6fc8de9200c88da456c7eda6de9c5eee9a4..a784ffaf63b3b395ad2d0c8d712c434643066291 100644 +index 3872ee9b4e3182b8a39c51f13d577776eeccd2b1..0a583dce74161eb5a4543a2678ccc80aefd3582b 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -8268,7 +8268,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( 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 74899f38cf91a..2f7f6d8b79dc9 100644 --- a/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch +++ b/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch @@ -64,10 +64,10 @@ index 4cd668a127a50e5462e3878c3f1dcb7384926768..dfbec49249404df8f8ebdbd26e6e865c #endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc -index 8cb40ed9c41d438463e18793ee6dd112b59d823c..5152b1ec34e2bcbec693ffa386f50dfcf8ff7656 100644 +index 280fbb5608ffcd5bec33483c99a1a112a16a0c24..8232e87607f9af31e7608d3385c6853e87efa5e2 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc -@@ -2782,6 +2782,7 @@ void LocalFrame::RequestExecuteScript( +@@ -2809,6 +2809,7 @@ void LocalFrame::RequestExecuteScript( mojom::blink::EvaluationTiming evaluation_timing, mojom::blink::LoadEventBlockingOption blocking_option, WebScriptExecutionCallback callback, @@ -75,7 +75,7 @@ index 8cb40ed9c41d438463e18793ee6dd112b59d823c..5152b1ec34e2bcbec693ffa386f50dfc BackForwardCacheAware back_forward_cache_aware, mojom::blink::WantResultOption want_result_option, mojom::blink::PromiseResultOption promise_behavior) { -@@ -2815,7 +2816,7 @@ void LocalFrame::RequestExecuteScript( +@@ -2842,7 +2843,7 @@ void LocalFrame::RequestExecuteScript( PausableScriptExecutor::CreateAndRun( script_state, std::move(script_sources), execute_script_policy, user_gesture, evaluation_timing, blocking_option, want_result_option, 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 3c123909125ab..c72a6f8386b23 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 8042e113c85f475d44463df93e8c80a19b322d16..3d6b6b45a142419379a574701a0629b5f061dbfd 100644 +index 7abc296e283f15eeec32de1e94b66c24d71ebe13..c0053ae1abb38be03611cf5246d482c6391bd3bc 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc @@ -564,6 +564,7 @@ void MenuController::Run(Widget* parent, @@ -32,7 +32,7 @@ index 8042e113c85f475d44463df93e8c80a19b322d16..3d6b6b45a142419379a574701a0629b5 if (button_controller) { pressed_lock_ = button_controller->TakeLock( false, ui::LocatedEvent::FromIfValid(event)); -@@ -2251,19 +2260,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { +@@ -2266,19 +2275,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { } item->GetSubmenu()->ShowAt(params); diff --git a/patches/chromium/fix_tray_icon_gone_on_lock_screen.patch b/patches/chromium/fix_tray_icon_gone_on_lock_screen.patch deleted file mode 100644 index 5900771e00f7f..0000000000000 --- a/patches/chromium/fix_tray_icon_gone_on_lock_screen.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Cheng Zhao -Date: Tue, 15 Nov 2022 09:38:25 +0900 -Subject: Re-register status item when owner of status watcher is changed - -https://chromium-review.googlesource.com/c/chromium/src/+/4022621 - -diff --git a/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.cc b/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.cc -index e7e710d58e2bdf1f0bc042f479add048f3aa1ffb..dc0d69a726f389e4925001fc2c817fe0f0f83508 100644 ---- a/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.cc -+++ b/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.cc -@@ -361,6 +361,13 @@ void StatusIconLinuxDbus::OnInitialized(bool success) { - return; - } - -+ watcher_->SetNameOwnerChangedCallback( -+ base::BindRepeating(&StatusIconLinuxDbus::NameOwnerChangedReceived, -+ weak_factory_.GetWeakPtr())); -+ RegisterStatusNotifierItem(); -+} -+ -+void StatusIconLinuxDbus::RegisterStatusNotifierItem() { - dbus::MethodCall method_call(kInterfaceStatusNotifierWatcher, - kMethodRegisterStatusNotifierItem); - dbus::MessageWriter writer(&method_call); -@@ -376,6 +383,14 @@ void StatusIconLinuxDbus::OnRegistered(dbus::Response* response) { - delegate_->OnImplInitializationFailed(); - } - -+void StatusIconLinuxDbus::NameOwnerChangedReceived( -+ const std::string& old_owner, -+ const std::string& new_owner) { -+ // Re-register the item when the StatusNotifierWatcher has a new owner. -+ if (!new_owner.empty()) -+ RegisterStatusNotifierItem(); -+} -+ - void StatusIconLinuxDbus::OnActivate( - dbus::MethodCall* method_call, - dbus::ExportedObject::ResponseSender sender) { -diff --git a/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h b/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h -index 2c0df96d2840e6198604041fe1e1b63c89251208..09df6bb9fab6cffbab6302a04b7343b75568cdc3 100644 ---- a/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h -+++ b/chrome/browser/ui/views/status_icons/status_icon_linux_dbus.h -@@ -71,10 +71,16 @@ class StatusIconLinuxDbus : public ui::StatusIconLinux, - const std::string& method_name, - bool success); - void OnInitialized(bool success); -+ void RegisterStatusNotifierItem(); - - // Step 5: register the StatusNotifierItem with the StatusNotifierWatcher. - void OnRegistered(dbus::Response* response); - -+ // Called when the name owner of StatusNotifierWatcher has changed, which -+ // can happen when lock/unlock screen. -+ void NameOwnerChangedReceived(const std::string& old_owner, -+ const std::string& new_owner); -+ - // DBus methods. - // Action -> KDE behavior: - // Left-click -> Activate diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index e692e0b11e8f0..0fc95a12235e1 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 4cd7183825cadbc50c9e54bb11a174f26ef29858..8cf9b35580bdf925253e52db04bf3a2e1b6dbd61 100644 +index cf0cc0d010cdd38272a5262e2cbb0719b4595039..190c46d245f32d2ba093390cab7477165785e1ed 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc -@@ -4080,6 +4080,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -4082,6 +4082,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request->ResetStateForSiteInstanceChange(); } diff --git a/patches/chromium/gin_enable_disable_v8_platform.patch b/patches/chromium/gin_enable_disable_v8_platform.patch index 3a840185c9302..ea28d60ecc1aa 100644 --- a/patches/chromium/gin_enable_disable_v8_platform.patch +++ b/patches/chromium/gin_enable_disable_v8_platform.patch @@ -7,10 +7,10 @@ We don't use gin to create the V8 platform, because we need to inject Node things. diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc -index e8608bb868c82c9af5426cd6f8512ce6b18ff39f..6268851494a0bbc0b3e693782dae6171f6347657 100644 +index 4cb88241eeaaacdd1c1e419759fd56bc003dbaf3..1c3536a183aad1965e834b1681e36a3fc46ae419 100644 --- a/gin/isolate_holder.cc +++ b/gin/isolate_holder.cc -@@ -136,9 +136,10 @@ void IsolateHolder::Initialize(ScriptMode mode, +@@ -140,9 +140,10 @@ void IsolateHolder::Initialize(ScriptMode mode, const intptr_t* reference_table, const std::string js_command_line_flags, v8::FatalErrorCallback fatal_error_callback, @@ -24,10 +24,10 @@ index e8608bb868c82c9af5426cd6f8512ce6b18ff39f..6268851494a0bbc0b3e693782dae6171 g_reference_table = reference_table; g_fatal_error_callback = fatal_error_callback; diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h -index 2ec6d9820b4cb8d91d47ab319fe6bf89be60300c..12ddcc30397a02df78727f16a02b8e81fd1d9c8e 100644 +index c19eb72e8d37fe8145b813d07875addf793e12dc..a5db8841773618814ac90f740201d4d7e9057b3c 100644 --- a/gin/public/isolate_holder.h +++ b/gin/public/isolate_holder.h -@@ -109,7 +109,8 @@ class GIN_EXPORT IsolateHolder { +@@ -113,7 +113,8 @@ class GIN_EXPORT IsolateHolder { const intptr_t* reference_table = nullptr, const std::string js_command_line_flags = {}, v8::FatalErrorCallback fatal_error_callback = nullptr, diff --git a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch index f1e4a3116fa13..ab5594576ebee 100644 --- a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch +++ b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch @@ -40,10 +40,10 @@ index c57305681efb469d296c90df68b6cdbea927580d..6dda1a5465e08df64b539ee203b7c403 // Called from BrowserMainLoop::PostCreateThreads(). // TODO(content/browser/gpu/OWNERS): This should probably use a diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc -index 6b5d083400e10497a05b7813a453a3df03af1486..566bcdfe7241d0eb61ee1856fa6896a8fd408059 100644 +index 019554cca7d25be443b75271278865e09a763a31..cc7e01260891c5d42ef590b040209f01943e1feb 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc -@@ -1195,6 +1195,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { +@@ -1199,6 +1199,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { if (host) host->ForceShutdown(); } @@ -57,7 +57,7 @@ index 6b5d083400e10497a05b7813a453a3df03af1486..566bcdfe7241d0eb61ee1856fa6896a8 void GpuDataManagerImplPrivate::PostCreateThreads() { diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h -index cc93bb117b67c8dc656c1850c3c5f41b5bc31c82..c3a5c24ac664bf4701612f7c7f2e1586625c5b78 100644 +index 790e72f12c7f1cf6e49d2a51949769a5d14bd4db..e02c3033231f93792fe2b456c08cfc2ac0f3d49e 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.h +++ b/content/browser/gpu/gpu_data_manager_impl_private.h @@ -86,6 +86,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { diff --git a/patches/chromium/gritsettings_resource_ids.patch b/patches/chromium/gritsettings_resource_ids.patch index c91d3ae7b7bb4..e81fb621f3aaa 100644 --- a/patches/chromium/gritsettings_resource_ids.patch +++ b/patches/chromium/gritsettings_resource_ids.patch @@ -6,10 +6,10 @@ 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 77800eeb69b67daa40685d85e0ef50a90cb0aab8..33176b70e23c39fec0be4086efee319ac159fbce 100644 +index a327136986b82869f394f47e4609e431c9f3a3ac..28cca57152b6168b008c27c1e82f560ba16b56b4 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec -@@ -1193,6 +1193,11 @@ +@@ -1197,6 +1197,11 @@ "includes": [7440], }, 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 7957316abb536..c2d79c26f64ba 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,10 +11,10 @@ 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 f6c143483a9bdc5e5b320786356d329d40feba4f..2288deb727523171438ac0b2f636e3dd62d79756 100755 +index 134f0a172751c2e0aa769f10965a21895d8b1b8f..a86b25f708292bade341bbf25b94ab7e14bed995 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py -@@ -306,6 +306,8 @@ def GetDefaultHostOs(): +@@ -307,6 +307,8 @@ def GetDefaultHostOs(): 'win32': 'win', } default_host_os = _PLATFORM_HOST_OS_MAP.get(sys.platform, sys.platform) diff --git a/patches/chromium/isolate_holder.patch b/patches/chromium/isolate_holder.patch index 559f61fba3a4f..1bcc8c480a534 100644 --- a/patches/chromium/isolate_holder.patch +++ b/patches/chromium/isolate_holder.patch @@ -15,65 +15,68 @@ for us to register the isolate in between Isolate::Allocate and Isolate::Initialize. diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc -index 6268851494a0bbc0b3e693782dae6171f6347657..87ae3db7aec96577856804aa3718e53e3ccf66d3 100644 +index 1c3536a183aad1965e834b1681e36a3fc46ae419..1923f18cf2d4fff5094e6fe60bbef06b3e2cb06b 100644 --- a/gin/isolate_holder.cc +++ b/gin/isolate_holder.cc -@@ -72,7 +72,8 @@ IsolateHolder::IsolateHolder( - IsolateType isolate_type, +@@ -73,7 +73,8 @@ IsolateHolder::IsolateHolder( IsolateCreationMode isolate_creation_mode, v8::CreateHistogramCallback create_histogram_callback, -- v8::AddHistogramSampleCallback add_histogram_sample_callback) -+ v8::AddHistogramSampleCallback add_histogram_sample_callback, + v8::AddHistogramSampleCallback add_histogram_sample_callback, +- scoped_refptr low_priority_task_runner) ++ scoped_refptr low_priority_task_runner, + v8::Isolate* isolate) - : IsolateHolder(task_runner, + : IsolateHolder(std::move(task_runner), access_mode, isolate_type, -@@ -80,14 +81,16 @@ IsolateHolder::IsolateHolder( - atomics_wait_mode, +@@ -82,7 +83,8 @@ IsolateHolder::IsolateHolder( create_histogram_callback, add_histogram_sample_callback), -- isolate_creation_mode) {} -+ isolate_creation_mode, + isolate_creation_mode, +- std::move(low_priority_task_runner)) {} ++ std::move(low_priority_task_runner), + isolate) {} IsolateHolder::IsolateHolder( scoped_refptr task_runner, - AccessMode access_mode, +@@ -90,7 +92,8 @@ IsolateHolder::IsolateHolder( IsolateType isolate_type, std::unique_ptr params, -- IsolateCreationMode isolate_creation_mode) -+ IsolateCreationMode isolate_creation_mode, + IsolateCreationMode isolate_creation_mode, +- scoped_refptr low_priority_task_runner) ++ scoped_refptr low_priority_task_runner, + v8::Isolate* isolate) : access_mode_(access_mode), isolate_type_(isolate_type) { CHECK(Initialized()) << "You need to invoke gin::IsolateHolder::Initialize first"; -@@ -98,7 +101,7 @@ IsolateHolder::IsolateHolder( +@@ -101,7 +104,7 @@ IsolateHolder::IsolateHolder( v8::ArrayBuffer::Allocator* allocator = params->array_buffer_allocator; DCHECK(allocator); - isolate_ = v8::Isolate::Allocate(); + isolate_ = isolate ? isolate : v8::Isolate::Allocate(); - isolate_data_ = std::make_unique(isolate_, allocator, - access_mode_, task_runner); - // TODO(https://crbug.com/1347092): Refactor such that caller need not + isolate_data_ = std::make_unique( + isolate_, allocator, access_mode_, task_runner, + std::move(low_priority_task_runner)); diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h -index 12ddcc30397a02df78727f16a02b8e81fd1d9c8e..6629c29328354c911679fc6bb2af982611ecce10 100644 +index a5db8841773618814ac90f740201d4d7e9057b3c..1368ab8bfbf9e69437b394a8376bf7c956ca13ce 100644 --- a/gin/public/isolate_holder.h +++ b/gin/public/isolate_holder.h -@@ -83,13 +83,15 @@ class GIN_EXPORT IsolateHolder { - IsolateType isolate_type, - IsolateCreationMode isolate_creation_mode = IsolateCreationMode::kNormal, +@@ -85,7 +85,8 @@ class GIN_EXPORT IsolateHolder { v8::CreateHistogramCallback create_histogram_callback = nullptr, -- v8::AddHistogramSampleCallback add_histogram_sample_callback = nullptr); -+ v8::AddHistogramSampleCallback add_histogram_sample_callback = nullptr, + v8::AddHistogramSampleCallback add_histogram_sample_callback = nullptr, + scoped_refptr low_priority_task_runner = +- nullptr); ++ nullptr, + v8::Isolate* isolate = nullptr); IsolateHolder( scoped_refptr task_runner, AccessMode access_mode, - IsolateType isolate_type, +@@ -93,7 +94,8 @@ class GIN_EXPORT IsolateHolder { std::unique_ptr params, -- IsolateCreationMode isolate_creation_mode = IsolateCreationMode::kNormal); -+ IsolateCreationMode isolate_creation_mode = IsolateCreationMode::kNormal, + IsolateCreationMode isolate_creation_mode = IsolateCreationMode::kNormal, + scoped_refptr low_priority_task_runner = +- nullptr); ++ nullptr, + v8::Isolate* isolate = nullptr); IsolateHolder(const IsolateHolder&) = delete; IsolateHolder& operator=(const IsolateHolder&) = delete; diff --git a/patches/chromium/mas_disable_custom_window_frame.patch b/patches/chromium/mas_disable_custom_window_frame.patch index 27a337ead1e63..6eea71c1293b3 100644 --- a/patches/chromium/mas_disable_custom_window_frame.patch +++ b/patches/chromium/mas_disable_custom_window_frame.patch @@ -75,7 +75,7 @@ index 2d4be7e4df5a0f6de9046593434eb276e28232f9..c727984807d555b8e6ab8fe37d9a6daa + @end diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h -index 58e974137f318b0f990e0b77630fe3a51db62c8c..8638f9ee32bea5fca67a377f27f3e24b00982e44 100644 +index 841358dd85201f4972e4c91a334e55b81867d2ec..0069d4f904c527fa3c280c723574fe2c62c282b8 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h @@ -17,6 +17,7 @@ class NativeWidgetNSWindowBridge; @@ -95,10 +95,10 @@ index 58e974137f318b0f990e0b77630fe3a51db62c8c..8638f9ee32bea5fca67a377f27f3e24b // The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that // can only be accomplished by overriding methods. diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -index 85ec900639c308ce62f13eae1230d0597e8e9604..247568ccdfbaaf2f72612cbe738758e640472db1 100644 +index 8a89e3e1759b9785f069546aa564520a9375f0c2..fd09550a2f1fe59ba0d38a258107573a052fd784 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -@@ -101,7 +101,9 @@ void OrderChildWindow(NSWindow* child_window, +@@ -106,7 +106,9 @@ void OrderChildWindow(NSWindow* child_window, } // namespace @interface NSWindow (Private) @@ -108,7 +108,7 @@ index 85ec900639c308ce62f13eae1230d0597e8e9604..247568ccdfbaaf2f72612cbe738758e6 - (BOOL)hasKeyAppearance; - (long long)_resizeDirectionForMouseLocation:(CGPoint)location; - (BOOL)_isConsideredOpenForPersistentState; -@@ -139,6 +141,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event { +@@ -150,6 +152,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event { } @end @@ -117,7 +117,7 @@ index 85ec900639c308ce62f13eae1230d0597e8e9604..247568ccdfbaaf2f72612cbe738758e6 @implementation NativeWidgetMacNSWindowTitledFrame - (void)mouseDown:(NSEvent*)event { if (self.window.isMovable) -@@ -165,6 +169,8 @@ - (BOOL)usesCustomDrawing { +@@ -176,6 +180,8 @@ - (BOOL)usesCustomDrawing { } @end @@ -126,7 +126,7 @@ index 85ec900639c308ce62f13eae1230d0597e8e9604..247568ccdfbaaf2f72612cbe738758e6 @implementation NativeWidgetMacNSWindow { @private CommandDispatcher* __strong _commandDispatcher; -@@ -358,6 +364,8 @@ - (NSAccessibilityRole)accessibilityRole { +@@ -381,6 +387,8 @@ - (NSAccessibilityRole)accessibilityRole { // NSWindow overrides. @@ -135,7 +135,7 @@ index 85ec900639c308ce62f13eae1230d0597e8e9604..247568ccdfbaaf2f72612cbe738758e6 + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { if (windowStyle & NSWindowStyleMaskTitled) { if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class]) -@@ -369,6 +377,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { +@@ -392,6 +400,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { return [super frameViewClassForStyleMask:windowStyle]; } diff --git a/patches/chromium/mas_disable_remote_accessibility.patch b/patches/chromium/mas_disable_remote_accessibility.patch index a61777141ebec..d06d2a8776be6 100644 --- a/patches/chromium/mas_disable_remote_accessibility.patch +++ b/patches/chromium/mas_disable_remote_accessibility.patch @@ -43,10 +43,10 @@ index 1411678acc567b4d6368d0e2e6224f0974d61825..b9495cc1a391603b2c223ab1cf2d75b1 } // namespace diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm -index 10032ea5829e7dfc610db23f0f8f12021fe466f6..2b3f68f8e92e00caab15c048fcc2fc02f54a21fc 100644 +index 1eb8f76dba28861d002d5e8d0271d8bb54c157c6..d7356834e1c714024dc6b6c6147043a8afa98c08 100644 --- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm +++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm -@@ -591,10 +591,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { +@@ -603,10 +603,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { // this should be treated as an error and caught early. CHECK(bridged_view_); @@ -147,10 +147,10 @@ index 43f288af24064365999da0904dcb63bd3157497d..ae67c1ab9a1d6ca8d3aa373b7ae73986 // Used to force the NSApplication's focused accessibility element to be the // content::BrowserAccessibilityCocoa accessibility tree when the NSView for diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index be1cba15f2f1d219b9aa897c6af580e827f22211..f9d1b5d75d88eddc51bbabca4cb0571d8f5882ab 100644 +index 87c6840293a63ad6c77a07952444965d6fe80d1e..a9b4caaa4da3bee1a22db976a8ec71dc7d5400ed 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -259,8 +259,10 @@ +@@ -267,8 +267,10 @@ void RenderWidgetHostViewMac::MigrateNSViewBridge( remote_cocoa::mojom::Application* remote_cocoa_application, uint64_t parent_ns_view_id) { @@ -161,7 +161,7 @@ index be1cba15f2f1d219b9aa897c6af580e827f22211..f9d1b5d75d88eddc51bbabca4cb0571d // Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling // pointers. `ns_view_` gets reinitialized later in this method. -@@ -1599,8 +1601,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1616,8 +1618,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, gfx::NativeViewAccessible RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() { @@ -172,7 +172,7 @@ index be1cba15f2f1d219b9aa897c6af580e827f22211..f9d1b5d75d88eddc51bbabca4cb0571d return [GetInProcessNSView() window]; } -@@ -1644,9 +1648,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1661,9 +1665,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, } void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) { @@ -184,7 +184,7 @@ index be1cba15f2f1d219b9aa897c6af580e827f22211..f9d1b5d75d88eddc51bbabca4cb0571d } bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame( -@@ -2148,12 +2154,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -2165,12 +2171,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken( const std::vector& window_token) { @@ -200,7 +200,7 @@ index be1cba15f2f1d219b9aa897c6af580e827f22211..f9d1b5d75d88eddc51bbabca4cb0571d /////////////////////////////////////////////////////////////////////////////// diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index 3b64831839a4c333dbb0c6c172344d6fd0d7b771..0d07c88cb9fec014b727b5294a03671d183943ea 100644 +index b521b461456dac293972ded8cafd6b253c8b3f4d..614ae2d72c934f0f6650a501b7d132f5745f767e 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn @@ -372,6 +372,13 @@ component("base") { diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index ab24b50095189..d13241df0d409 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -11,7 +11,7 @@ majority of changes originally come from these PRs: This patch also fixes callback for manual user cancellation and success. diff --git a/BUILD.gn b/BUILD.gn -index 357647127147f797663a7ae3b82449f58991c388..cbbb8bc6df74fb932bc669fad2dac950c9d8661f 100644 +index 83530a3a22a75ec4010ed2ffb20e7a6f4751b835..f7b75fa8f943861b211cbe9a981face8317cc8f0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -971,7 +971,6 @@ if (is_win) { @@ -91,7 +91,7 @@ index 3a66a52b8d3c6da9cd8d7e9afdc8d59f528ec3d5..facaa6fbca8ee7c04f83607e62b81b95 : PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3; } diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc -index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b568dbb0cd 100644 +index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508025af64c 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc @@ -23,7 +23,9 @@ @@ -209,7 +209,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 return true; } -@@ -313,12 +344,13 @@ void PrintViewManagerBase::OnDidUpdatePrintableArea( +@@ -327,12 +358,13 @@ void PrintViewManagerBase::OnDidUpdatePrintableArea( } PRINTER_LOG(EVENT) << "Paper printable area updated for vendor id " << print_settings->requested_media().vendor_id; @@ -224,7 +224,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 base::Value::Dict job_settings, std::unique_ptr print_settings, UpdatePrintSettingsCallback callback) { -@@ -326,7 +358,8 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings( +@@ -340,7 +372,8 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings( settings->pages = GetPageRangesFromJobSettings(job_settings); settings->params = mojom::PrintParams::New(); RenderParamsFromPrintSettings(*print_settings, settings->params.get()); @@ -234,7 +234,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 if (!PrintMsgPrintParamsIsValid(*settings->params)) { mojom::PrinterType printer_type = static_cast( *job_settings.FindInt(kSettingPrinterType)); -@@ -338,6 +371,10 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings( +@@ -352,6 +385,10 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings( return; } @@ -245,7 +245,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 set_cookie(settings->params->document_cookie); std::move(callback).Run(std::move(settings)); } -@@ -442,7 +479,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply( +@@ -487,7 +524,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply( void PrintViewManagerBase::ScriptedPrintReply( ScriptedPrintCallback callback, int process_id, @@ -255,7 +255,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); #if BUILDFLAG(ENABLE_OOP_PRINTING) -@@ -457,12 +495,15 @@ void PrintViewManagerBase::ScriptedPrintReply( +@@ -502,12 +540,15 @@ void PrintViewManagerBase::ScriptedPrintReply( return; } @@ -273,7 +273,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 } } -@@ -599,10 +640,12 @@ void PrintViewManagerBase::DidPrintDocument( +@@ -647,10 +688,12 @@ void PrintViewManagerBase::DidPrintDocument( void PrintViewManagerBase::GetDefaultPrintSettings( GetDefaultPrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -286,7 +286,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 #if BUILDFLAG(ENABLE_OOP_PRINTING) if (printing::features::kEnableOopPrintDriversJobPrint.Get() && #if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS) -@@ -654,10 +697,12 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -702,10 +745,12 @@ void PrintViewManagerBase::UpdatePrintSettings( base::Value::Dict job_settings, UpdatePrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -299,7 +299,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 absl::optional printer_type_value = job_settings.FindInt(kSettingPrinterType); -@@ -668,6 +713,7 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -716,6 +761,7 @@ void PrintViewManagerBase::UpdatePrintSettings( mojom::PrinterType printer_type = static_cast(*printer_type_value); @@ -307,7 +307,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 if (printer_type != mojom::PrinterType::kExtension && printer_type != mojom::PrinterType::kPdf && printer_type != mojom::PrinterType::kLocal) { -@@ -687,6 +733,7 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -735,6 +781,7 @@ void PrintViewManagerBase::UpdatePrintSettings( if (value > 0) job_settings.Set(kSettingRasterizePdfDpi, value); } @@ -315,7 +315,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 std::unique_ptr print_settings = PrintSettingsFromJobSettings(job_settings); -@@ -706,7 +753,21 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -754,7 +801,21 @@ void PrintViewManagerBase::UpdatePrintSettings( } } @@ -338,7 +338,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 // TODO(crbug.com/1424368): Remove this if the printable areas can be made // fully available from `PrintBackend::GetPrinterSemanticCapsAndDefaults()` // for in-browser queries. -@@ -728,15 +789,13 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -776,15 +837,13 @@ void PrintViewManagerBase::UpdatePrintSettings( } #endif @@ -355,7 +355,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 } void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, -@@ -752,14 +811,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, +@@ -800,14 +859,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, // didn't happen for some reason. bad_message::ReceivedBadMessage( render_process_host, bad_message::PVMB_SCRIPTED_PRINT_FENCED_FRAME); @@ -372,7 +372,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 return; } #endif -@@ -795,6 +854,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, +@@ -843,6 +902,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, PrintManager::PrintingFailed(cookie, reason); @@ -380,7 +380,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 // `PrintingFailed()` can occur because asynchronous compositing results // don't complete until after a print job has already failed and been // destroyed. In such cases the error notification to the user will -@@ -804,7 +864,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, +@@ -852,7 +912,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, print_job_->document()->cookie() == cookie) { ShowPrintErrorDialogForGenericError(); } @@ -389,7 +389,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 ReleasePrinterQuery(); } -@@ -816,15 +876,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) { +@@ -864,15 +924,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) { test_observers_.RemoveObserver(&observer); } @@ -414,7 +414,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 } void PrintViewManagerBase::RenderFrameDeleted( -@@ -876,7 +945,12 @@ void PrintViewManagerBase::OnJobDone() { +@@ -924,7 +993,12 @@ void PrintViewManagerBase::OnJobDone() { // Printing is done, we don't need it anymore. // print_job_->is_job_pending() may still be true, depending on the order // of object registration. @@ -428,7 +428,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 ReleasePrintJob(); } -@@ -885,9 +959,10 @@ void PrintViewManagerBase::OnCanceling() { +@@ -933,9 +1007,10 @@ void PrintViewManagerBase::OnCanceling() { } void PrintViewManagerBase::OnFailed() { @@ -440,7 +440,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 TerminatePrintJob(true); } -@@ -897,7 +972,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() { +@@ -945,7 +1020,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() { // Is the document already complete? if (print_job_->document() && print_job_->document()->IsComplete()) { @@ -449,7 +449,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 return true; } -@@ -945,7 +1020,10 @@ bool PrintViewManagerBase::CreateNewPrintJob( +@@ -993,7 +1068,10 @@ bool PrintViewManagerBase::CreateNewPrintJob( // Disconnect the current `print_job_`. auto weak_this = weak_ptr_factory_.GetWeakPtr(); @@ -461,7 +461,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 if (!weak_this) return false; -@@ -966,7 +1044,7 @@ bool PrintViewManagerBase::CreateNewPrintJob( +@@ -1014,7 +1092,7 @@ bool PrintViewManagerBase::CreateNewPrintJob( #endif print_job_->AddObserver(*this); @@ -470,7 +470,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 return true; } -@@ -1034,6 +1112,11 @@ void PrintViewManagerBase::ReleasePrintJob() { +@@ -1082,6 +1160,11 @@ void PrintViewManagerBase::ReleasePrintJob() { } #endif @@ -482,7 +482,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 if (!print_job_) return; -@@ -1041,7 +1124,7 @@ void PrintViewManagerBase::ReleasePrintJob() { +@@ -1089,7 +1172,7 @@ void PrintViewManagerBase::ReleasePrintJob() { // printing_rfh_ should only ever point to a RenderFrameHost with a live // RenderFrame. DCHECK(rfh->IsRenderFrameLive()); @@ -491,7 +491,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 } print_job_->RemoveObserver(*this); -@@ -1083,7 +1166,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() { +@@ -1131,7 +1214,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() { } bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) { @@ -500,7 +500,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 return true; if (!cookie) { -@@ -1227,7 +1310,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() { +@@ -1277,7 +1360,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() { } void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) { @@ -509,8 +509,8 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 for (auto& observer : GetTestObservers()) { observer.OnPrintNow(rfh); -@@ -1277,7 +1360,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis( - set_analyzing_content(/*analyzing*/ false); +@@ -1327,7 +1410,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis( + set_analyzing_content(/*analyzing=*/false); if (!allowed || !printing_rfh_ || IsCrashed() || !printing_rfh_->IsRenderFrameLive()) { - std::move(callback).Run(nullptr); @@ -519,7 +519,7 @@ index 97847278fc73e3a8fc80bef1bfbea5a9d0497b36..9f0e7a1e8b7e0c22623d6f681ebcd6b5 } CompleteScriptedPrint(printing_rfh_, std::move(params), std::move(callback)); diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h -index fcee7b58a8eebd9fc044bab51a5d0e540de0de7d..160b5a6ad2d5cb6e0292f9ff1d16ee556d950880 100644 +index 78c9218049835cafdc9a0d7719bc073a81432c81..f233546a63a3b0f3531042b055a0011cc1980958 100644 --- a/chrome/browser/printing/print_view_manager_base.h +++ b/chrome/browser/printing/print_view_manager_base.h @@ -47,6 +47,8 @@ namespace printing { @@ -569,7 +569,7 @@ index fcee7b58a8eebd9fc044bab51a5d0e540de0de7d..160b5a6ad2d5cb6e0292f9ff1d16ee55 protected: explicit PrintViewManagerBase(content::WebContents* web_contents); -@@ -275,6 +290,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -285,6 +300,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { bool success); #endif void CompleteUpdatePrintSettings( @@ -577,7 +577,7 @@ index fcee7b58a8eebd9fc044bab51a5d0e540de0de7d..160b5a6ad2d5cb6e0292f9ff1d16ee55 base::Value::Dict job_settings, std::unique_ptr print_settings, UpdatePrintSettingsCallback callback); -@@ -304,7 +320,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -320,7 +336,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { // Runs `callback` with `params` to reply to ScriptedPrint(). void ScriptedPrintReply(ScriptedPrintCallback callback, int process_id, @@ -587,7 +587,7 @@ index fcee7b58a8eebd9fc044bab51a5d0e540de0de7d..160b5a6ad2d5cb6e0292f9ff1d16ee55 // Requests the RenderView to render all the missing pages for the print job. // No-op if no print job is pending. Returns true if at least one page has -@@ -374,8 +391,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -401,8 +418,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { // The current RFH that is printing with a system printing dialog. raw_ptr printing_rfh_ = nullptr; @@ -680,10 +680,10 @@ index ca71560874a0189068dd11fbc039f5673bf6bd96..a8551d95e64da2afbc1685b2df8f1fc3 mojom::PrintFailureReason reason) override; diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom -index c97825d05cb7d132c9af489998f4ed8c32603c00..fde20b8a6c4811ce728abfee26b2ab7b53027a94 100644 +index c46e272beafd30a089b06d0920f0e94d8736b81b..b5d61250dc58d20e9c17958ac26a519b7c888ccc 100644 --- a/components/printing/common/print.mojom +++ b/components/printing/common/print.mojom -@@ -296,7 +296,7 @@ union PrintWithParamsResult { +@@ -302,7 +302,7 @@ union PrintWithParamsResult { interface PrintRenderFrame { // Tells the RenderFrame to switch the CSS to print media type, render every // requested page, and then switch back the CSS to display media type. @@ -692,7 +692,7 @@ index c97825d05cb7d132c9af489998f4ed8c32603c00..fde20b8a6c4811ce728abfee26b2ab7b // Requests the frame to be printed with specified parameters. This is used // to programmatically produce PDF by request from the browser (e.g. over -@@ -390,7 +390,10 @@ interface PrintManagerHost { +@@ -396,7 +396,10 @@ interface PrintManagerHost { // UI to the user to select the final print settings. If the user cancels or // an error occurs, return null. [Sync] @@ -705,7 +705,7 @@ index c97825d05cb7d132c9af489998f4ed8c32603c00..fde20b8a6c4811ce728abfee26b2ab7b // Tells the browser printing failed. 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 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad2997824a27 100644 +index bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0b645513a 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc @@ -46,6 +46,7 @@ @@ -716,7 +716,7 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 #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" -@@ -1382,7 +1383,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { +@@ -1384,7 +1385,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { if (!weak_this) return; @@ -726,7 +726,7 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 if (!weak_this) return; -@@ -1414,7 +1416,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( +@@ -1416,7 +1418,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( receivers_.Add(this, std::move(receiver)); } @@ -735,7 +735,7 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr()); if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; -@@ -1430,7 +1432,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { +@@ -1432,7 +1434,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { // plugin node and print that instead. auto plugin = delegate_->GetPdfElement(frame); @@ -744,7 +744,7 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 if (!render_frame_gone_) { RecordBeforeAfterPrintEventForDebugging(__LINE__); -@@ -1514,7 +1516,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { +@@ -1516,7 +1518,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { } Print(frame, print_preview_context_.source_node(), @@ -754,7 +754,7 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 if (!render_frame_gone_) { RecordBeforeAfterPrintEventForDebugging(__LINE__); print_preview_context_.DispatchAfterPrintEvent(); -@@ -1567,6 +1570,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { +@@ -1570,6 +1573,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; @@ -763,7 +763,7 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 print_preview_context_.OnPrintPreview(); #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -2183,7 +2188,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -2193,7 +2198,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { return; Print(duplicate_node.GetDocument().GetFrame(), duplicate_node, @@ -773,7 +773,7 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 // Check if |this| is still valid. if (!weak_this) return; -@@ -2199,7 +2205,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -2209,7 +2215,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -784,16 +784,16 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 // If still not finished with earlier print request simply ignore. if (prep_frame_view_) return; -@@ -2207,7 +2215,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2217,7 +2225,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, FrameReference frame_ref(frame); uint32_t expected_page_count = 0; - if (!CalculateNumberOfPages(frame, node, &expected_page_count)) { + if (!CalculateNumberOfPages(frame, node, &expected_page_count, std::move(settings))) { - DidFinishPrinting(FAIL_PRINT_INIT); + DidFinishPrinting(PrintingResult::kFailPrintInit); return; // Failed to init print page settings. } -@@ -2226,8 +2234,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2236,8 +2244,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, print_pages_params_->params->print_scaling_option; auto self = weak_ptr_factory_.GetWeakPtr(); @@ -810,7 +810,7 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 // Check if |this| is still valid. if (!self) return; -@@ -2460,35 +2475,47 @@ void PrintRenderFrameHelper::IPCProcessed() { +@@ -2480,35 +2495,47 @@ void PrintRenderFrameHelper::IPCProcessed() { } } @@ -868,7 +868,7 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 return false; } -@@ -2592,7 +2619,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser( +@@ -2613,7 +2640,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser( std::move(params), base::BindOnce( [](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output, @@ -878,7 +878,7 @@ index 59c7a51279bdb703a84c13154a810f268062c345..a1e9f3e25589bc6436b18a550609ad29 std::move(quit_closure).Run(); }, diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h -index 0fea424325081a0ef6720000841ea321b89024d0..c700de4b81fc0c157946e76faedaca6b59aeac0c 100644 +index 54241ff910b7198761fd76a21e4fe4bd42cc7ce2..51735091523fdd208b2c799a1c7910fdcc703e44 100644 --- a/components/printing/renderer/print_render_frame_helper.h +++ b/components/printing/renderer/print_render_frame_helper.h @@ -247,7 +247,7 @@ class PrintRenderFrameHelper @@ -919,10 +919,10 @@ index 0fea424325081a0ef6720000841ea321b89024d0..c700de4b81fc0c157946e76faedaca6b #if BUILDFLAG(ENABLE_PRINT_PREVIEW) // Set options for print preset from source PDF document. diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index e83a8746c00800ef8236a696ea1052a76ae6b2fb..183c520baa855d3065f34f3bc90c8c590237192c 100644 +index 904c0ef40a0fa23e0f3b7d0023e6418500ce45e9..88eca71122353752154a29e4f54693c3ac13f930 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn -@@ -2913,8 +2913,9 @@ source_set("browser") { +@@ -2916,8 +2916,9 @@ source_set("browser") { "//ppapi/shared_impl", ] 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 a3d3b459db942..11c0d670cce78 100644 --- a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch +++ b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch @@ -44,7 +44,7 @@ index 7a84a4e6c65eb5b9373b0667166188d93948ad68..e621a92c42c5cd2d818bcbc99d9b3e7a void RenderWidgetHostImpl::ShowContextMenuAtPoint( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index e262b0d1b1c50b81345d6333c5190769dd35c4a8..a41d8c314019ddd26e7c549149053bae25080d68 100644 +index f362dc586802e47f45558b0cc068e2bf44cb796e..d95743b1ab3461f69326ca904448636de88ea070 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -4902,6 +4902,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { @@ -60,7 +60,7 @@ index e262b0d1b1c50b81345d6333c5190769dd35c4a8..a41d8c314019ddd26e7c549149053bae 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 5a95c202b96ee5e2e4a519e27c2a96b181248c07..9c55246c605adaa1f4edaa6f3396fab55328ac9e 100644 +index 7893e253691ef0e51b1ba619c4579cb0e39e2ff1..0be4c605413b9a7a27deafc9c13d1e45885e92fe 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -994,6 +994,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, diff --git a/patches/chromium/resource_file_conflict.patch b/patches/chromium/resource_file_conflict.patch index 950e50fc115c1..eb599229e6d95 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 75d9891502495a10262dad85f90f2c286b146be1..2153df7bef066da7851bd1cc6375faaeee2f4537 100644 +index 61f07f736047732cc631c713fafa507df48ebb90..7e99d7493ac1f9281668eb3283f7475769245021 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -1617,7 +1617,7 @@ if (is_chrome_branded && !is_android) { +@@ -1616,7 +1616,7 @@ if (is_chrome_branded && !is_android) { } } @@ -64,7 +64,7 @@ index 75d9891502495a10262dad85f90f2c286b146be1..2153df7bef066da7851bd1cc6375faae chrome_paks("packed_resources") { if (is_mac) { output_dir = "$root_gen_dir/repack" -@@ -1646,6 +1646,12 @@ if (!is_android) { +@@ -1645,6 +1645,12 @@ if (!is_android) { } } diff --git a/patches/chromium/scroll_bounce_flag.patch b/patches/chromium/scroll_bounce_flag.patch index 31d7875f58611..b1e04801b13eb 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 9bdebf527329f163260a4f300316a0b44f1082a6..abe4e33ef816221eb177c7ad789878dd49125c8c 100644 +index d1f8638d390858b0872c56a62168acb7eef04db4..6193cefd3e98ca550dc3a5ac7b78925b89aebd71 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -1332,7 +1332,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { +@@ -1334,7 +1334,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { } bool RenderThreadImpl::IsElasticOverscrollEnabled() { diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index 6d6bc57adad67..ed51ce41098bc 100644 --- a/patches/chromium/web_contents.patch +++ b/patches/chromium/web_contents.patch @@ -9,7 +9,7 @@ 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 c302ba2e69b71b58faf40bc3e622b22183b17f26..6a119a6179cc242a63cb6fcc7c4974dd15b721df 100644 +index a32f963654763cc0c706f752eca96e8cf5d0be54..998357b01a55def3d9c1e37d09f52d61b5ecd6f2 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -3314,6 +3314,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, @@ -35,7 +35,7 @@ index c302ba2e69b71b58faf40bc3e622b22183b17f26..6a119a6179cc242a63cb6fcc7c4974dd CHECK(view_.get()); diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h -index 31a816804ebb81089c8fee6e3a00420b786e0632..42cb935abb67d9c4ede682bbb3c87277d95ad93b 100644 +index f80a1a82e14a0c9f6c43897e649b60a87f5f5aa6..a58eb20fdd278fac7f89862a4817cbf57c6a0381 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h @@ -98,10 +98,13 @@ class BrowserContext; diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index 5ffa32ab07f17..74aa6d4c203fe 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -14,10 +14,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 587d3594c54bb395db7074b0c2e2f10fa61d682b..2a8fe8ef8381f93cf1b4f6a504ad4384fd5aa26e 100644 +index 81b495cce7891a30c3ea1acc9160566d66acaef0..e4925235a152e15bb38a680b3ed428b65e289404 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -7255,6 +7255,17 @@ void RenderFrameHostImpl::EnterFullscreen( +@@ -7263,6 +7263,17 @@ void RenderFrameHostImpl::EnterFullscreen( } } diff --git a/patches/v8/build_gn.patch b/patches/v8/build_gn.patch index ae54f79a4846d..f2e1612372d3e 100644 --- a/patches/v8/build_gn.patch +++ b/patches/v8/build_gn.patch @@ -9,10 +9,10 @@ necessary for native modules to load. Also change visibility on mksnapshot in order to target mksnapshot for mksnapshot zip. diff --git a/BUILD.gn b/BUILD.gn -index 8242f2e7121568404723be5fba05a073ad1a157e..f2bfbef1d12e06bbe9e0fcf84d89bda46edcbb8b 100644 +index 72e11bf5ff1468545e2ae3f59ba06edca96678e2..5b9abb1eb2f61499f22c4502ffa2deb254931b97 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -741,7 +741,7 @@ config("internal_config") { +@@ -743,7 +743,7 @@ config("internal_config") { ":cppgc_header_features", ] @@ -21,7 +21,7 @@ index 8242f2e7121568404723be5fba05a073ad1a157e..f2bfbef1d12e06bbe9e0fcf84d89bda4 defines += [ "BUILDING_V8_SHARED" ] } -@@ -6698,7 +6698,7 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -6706,7 +6706,7 @@ if (current_toolchain == v8_generator_toolchain) { "src/interpreter/bytecodes.h", ] @@ -30,7 +30,7 @@ index 8242f2e7121568404723be5fba05a073ad1a157e..f2bfbef1d12e06bbe9e0fcf84d89bda4 deps = [ ":v8_libbase", -@@ -6710,7 +6710,6 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -6718,7 +6718,6 @@ if (current_toolchain == v8_generator_toolchain) { if (current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { diff --git a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch index 62635384c64cb..99c9723edde9d 100644 --- a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch +++ b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch @@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not contain any standard C++ library exports (e.g. `std::ostringstream`). diff --git a/BUILD.gn b/BUILD.gn -index f2bfbef1d12e06bbe9e0fcf84d89bda46edcbb8b..6eb42a315950627a85ad55aa8d760e4cf3fda398 100644 +index 5b9abb1eb2f61499f22c4502ffa2deb254931b97..2de11af08a8f20c0b04a7f7454b10cb7141837e2 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -741,6 +741,10 @@ config("internal_config") { +@@ -743,6 +743,10 @@ config("internal_config") { ":cppgc_header_features", ] diff --git a/shell/app/electron_login_helper.mm b/shell/app/electron_login_helper.mm index 7e9585d80b6a6..86895c8c75e4e 100644 --- a/shell/app/electron_login_helper.mm +++ b/shell/app/electron_login_helper.mm @@ -5,12 +5,13 @@ #import int main(int argc, char* argv[]) { - NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; - NSArray* pathComponents = [[[NSBundle mainBundle] bundlePath] pathComponents]; - pathComponents = [pathComponents - subarrayWithRange:NSMakeRange(0, [pathComponents count] - 4)]; - NSString* path = [NSString pathWithComponents:pathComponents]; - [[NSWorkspace sharedWorkspace] launchApplication:path]; - [pool drain]; - return 0; + @autoreleasepool { + NSArray* pathComponents = + [[[NSBundle mainBundle] bundlePath] pathComponents]; + pathComponents = [pathComponents + subarrayWithRange:NSMakeRange(0, [pathComponents count] - 4)]; + NSString* path = [NSString pathWithComponents:pathComponents]; + [[NSWorkspace sharedWorkspace] launchApplication:path]; + return 0; + } } diff --git a/shell/browser/api/electron_api_app_mas.mm b/shell/browser/api/electron_api_app_mas.mm index 9c924939f1bec..d86446beea99d 100644 --- a/shell/browser/api/electron_api_app_mas.mm +++ b/shell/browser/api/electron_api_app_mas.mm @@ -15,7 +15,6 @@ // Callback passed to js which will stop accessing the given bookmark. void OnStopAccessingSecurityScopedResource(NSURL* bookmarkUrl) { [bookmarkUrl stopAccessingSecurityScopedResource]; - [bookmarkUrl release]; } // Get base64 encoded NSData, create a bookmark for it and start accessing it. @@ -54,9 +53,6 @@ void OnStopAccessingSecurityScopedResource(NSURL* bookmarkUrl) { [bookmarkUrl startAccessingSecurityScopedResource]; } - // Stop the NSURL from being GC'd. - [bookmarkUrl retain]; - // Return a js callback which will close the bookmark. return base::BindRepeating(&OnStopAccessingSecurityScopedResource, bookmarkUrl); diff --git a/shell/browser/api/electron_api_power_monitor_mac.mm b/shell/browser/api/electron_api_power_monitor_mac.mm index f7ba52967b0ac..ef38f17515ecb 100644 --- a/shell/browser/api/electron_api_power_monitor_mac.mm +++ b/shell/browser/api/electron_api_power_monitor_mac.mm @@ -63,7 +63,6 @@ - (id)init { - (void)dealloc { [[NSDistributedNotificationCenter defaultCenter] removeObserver:self]; - [super dealloc]; } - (void)addEmitter:(electron::api::PowerMonitor*)monitor_ { diff --git a/shell/browser/auto_updater_mac.mm b/shell/browser/auto_updater_mac.mm index b0636cf3200e9..c186062033a1d 100644 --- a/shell/browser/auto_updater_mac.mm +++ b/shell/browser/auto_updater_mac.mm @@ -25,7 +25,7 @@ namespace { // The global SQRLUpdater object. -SQRLUpdater* g_updater = nil; +SQRLUpdater* __strong g_updater = nil; } // namespace @@ -87,7 +87,7 @@ } if (g_updater) - [g_updater release]; + g_updater = nil; // Initialize the SQRLUpdater. @try { diff --git a/shell/browser/javascript_environment.cc b/shell/browser/javascript_environment.cc index 5172a8e7d2ee8..4293871ad169d 100644 --- a/shell/browser/javascript_environment.cc +++ b/shell/browser/javascript_environment.cc @@ -97,7 +97,7 @@ gin::IsolateHolder CreateIsolateHolder(v8::Isolate* isolate) { base::SingleThreadTaskRunner::GetCurrentDefault(), gin::IsolateHolder::kSingleThread, gin::IsolateHolder::IsolateType::kUtility, std::move(create_params), - gin::IsolateHolder::IsolateCreationMode::kNormal, isolate); + gin::IsolateHolder::IsolateCreationMode::kNormal, nullptr, isolate); } } // namespace diff --git a/shell/browser/mac/in_app_purchase.mm b/shell/browser/mac/in_app_purchase.mm index 5741449879355..d015183652aa1 100644 --- a/shell/browser/mac/in_app_purchase.mm +++ b/shell/browser/mac/in_app_purchase.mm @@ -84,9 +84,6 @@ - (void)purchaseProduct:(NSString*)productID { */ - (void)productsRequest:(SKProductsRequest*)request didReceiveResponse:(SKProductsResponse*)response { - // Release request object. - [request release]; - // Get the first product. NSArray* products = response.products; SKProduct* product = [products count] == 1 ? [products firstObject] : nil; @@ -129,13 +126,10 @@ - (void)runCallback:(bool)isProductValid { content::GetUIThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce(std::move(callback_), isProductValid)); } - // Release this delegate. - [self release]; } - (void)dealloc { - [username_ release]; - [super dealloc]; + username_ = nil; } @end diff --git a/shell/browser/mac/in_app_purchase_observer.mm b/shell/browser/mac/in_app_purchase_observer.mm index b7eb63631367d..ade5aeee98e26 100644 --- a/shell/browser/mac/in_app_purchase_observer.mm +++ b/shell/browser/mac/in_app_purchase_observer.mm @@ -57,7 +57,6 @@ - (id)initWithCallback:(const InAppTransactionCallback&)callback { */ - (void)dealloc { [[SKPaymentQueue defaultQueue] removeTransactionObserver:self]; - [super dealloc]; } /** @@ -226,7 +225,7 @@ - (void)paymentQueue:(SKPaymentQueue*)queue } TransactionObserver::~TransactionObserver() { - [observer_ release]; + observer_ = nil; } } // namespace in_app_purchase diff --git a/shell/browser/mac/in_app_purchase_product.mm b/shell/browser/mac/in_app_purchase_product.mm index 8627168279223..adae14602bf17 100644 --- a/shell/browser/mac/in_app_purchase_product.mm +++ b/shell/browser/mac/in_app_purchase_product.mm @@ -67,9 +67,6 @@ - (void)getProducts:(NSSet*)productIDs { */ - (void)productsRequest:(SKProductsRequest*)request didReceiveResponse:(SKProductsResponse*)response { - // Release request object. - [request release]; - // Get the products. NSArray* products = response.products; @@ -84,8 +81,6 @@ - (void)productsRequest:(SKProductsRequest*)request // Send the callback to the browser thread. content::GetUIThreadTaskRunner({})->PostTask( FROM_HERE, base::BindOnce(std::move(callback_), converted)); - - [self release]; } /** diff --git a/shell/browser/notifications/mac/cocoa_notification.h b/shell/browser/notifications/mac/cocoa_notification.h index 8fd3cfb64c9cd..c0a2664b0b692 100644 --- a/shell/browser/notifications/mac/cocoa_notification.h +++ b/shell/browser/notifications/mac/cocoa_notification.h @@ -10,7 +10,6 @@ #include #include -#include "base/mac/scoped_nsobject.h" #include "shell/browser/notifications/notification.h" namespace electron { @@ -36,7 +35,7 @@ class CocoaNotification : public Notification { private: void LogAction(const char* action); - base::scoped_nsobject notification_; + NSUserNotification* __strong notification_; std::map additional_action_indices_; unsigned action_index_; }; diff --git a/shell/browser/notifications/mac/cocoa_notification.mm b/shell/browser/notifications/mac/cocoa_notification.mm index 35cc637420e54..73b4337a36dca 100644 --- a/shell/browser/notifications/mac/cocoa_notification.mm +++ b/shell/browser/notifications/mac/cocoa_notification.mm @@ -28,7 +28,7 @@ } void CocoaNotification::Show(const NotificationOptions& options) { - notification_.reset([[NSUserNotification alloc] init]); + notification_ = [[NSUserNotification alloc] init]; NSString* identifier = [NSString stringWithFormat:@"%@:notification:%@", @@ -71,8 +71,7 @@ int i = 0; action_index_ = UINT_MAX; - NSMutableArray* additionalActions = - [[[NSMutableArray alloc] init] autorelease]; + NSMutableArray* additionalActions = [[NSMutableArray alloc] init]; for (const auto& action : options.actions) { if (action.type == u"button") { // If the notification has both a reply and actions, @@ -118,7 +117,7 @@ NotificationDismissed(); - notification_.reset(nil); + notification_ = nil; } void CocoaNotification::NotificationDisplayed() { diff --git a/shell/browser/notifications/mac/notification_presenter_mac.h b/shell/browser/notifications/mac/notification_presenter_mac.h index 207e3acd81478..55850e36194af 100644 --- a/shell/browser/notifications/mac/notification_presenter_mac.h +++ b/shell/browser/notifications/mac/notification_presenter_mac.h @@ -6,7 +6,6 @@ #ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_MAC_NOTIFICATION_PRESENTER_MAC_H_ #define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_MAC_NOTIFICATION_PRESENTER_MAC_H_ -#include "base/mac/scoped_nsobject.h" #include "shell/browser/notifications/mac/notification_center_delegate.h" #include "shell/browser/notifications/notification_presenter.h" @@ -25,8 +24,7 @@ class NotificationPresenterMac : public NotificationPresenter { Notification* CreateNotificationObject( NotificationDelegate* delegate) override; - base::scoped_nsobject - notification_center_delegate_; + NotificationCenterDelegate* __strong notification_center_delegate_; }; } // namespace electron diff --git a/shell/browser/osr/osr_web_contents_view_mac.mm b/shell/browser/osr/osr_web_contents_view_mac.mm index 919bec712feb3..c4e6fc01f8e1e 100644 --- a/shell/browser/osr/osr_web_contents_view_mac.mm +++ b/shell/browser/osr/osr_web_contents_view_mac.mm @@ -14,14 +14,13 @@ @implementation OffScreenView - (void)drawRect:(NSRect)dirtyRect { NSString* str = @"No content under offscreen mode"; NSMutableParagraphStyle* paragraphStyle = - [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease]; + [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [paragraphStyle setAlignment:NSTextAlignmentCenter]; NSDictionary* attributes = [NSDictionary dictionaryWithObject:paragraphStyle forKey:NSParagraphStyleAttributeName]; NSAttributedString* text = - [[[NSAttributedString alloc] initWithString:str - attributes:attributes] autorelease]; + [[NSAttributedString alloc] initWithString:str attributes:attributes]; NSRect frame = NSMakeRect(0, (self.frame.size.height - text.size.height) / 2, self.frame.size.width, text.size.height); [str drawInRect:frame withAttributes:attributes]; @@ -48,7 +47,7 @@ - (void)drawRect:(NSRect)dirtyRect { } void OffScreenWebContentsView::PlatformDestroy() { - [offScreenView_ release]; + offScreenView_ = nil; } } // namespace electron diff --git a/shell/browser/ui/certificate_trust_mac.mm b/shell/browser/ui/certificate_trust_mac.mm index ef8cf360edf1a..6c2adc41f497c 100644 --- a/shell/browser/ui/certificate_trust_mac.mm +++ b/shell/browser/ui/certificate_trust_mac.mm @@ -42,12 +42,9 @@ - (void)panelDidEnd:(NSWindow*)sheet @implementation TrustDelegate - (void)dealloc { - [panel_ release]; CFRelease(trust_); CFRelease(cert_chain_); CFRelease(sec_policy_); - - [super dealloc]; } - (id)initWithPromise:(gin_helper::Promise)promise @@ -77,7 +74,6 @@ - (void)panelDidEnd:(NSWindow*)sheet cert_db->NotifyObserversTrustStoreChanged(); promise_->Resolve(); - [self autorelease]; } @end diff --git a/shell/browser/ui/cocoa/NSString+ANSI.mm b/shell/browser/ui/cocoa/NSString+ANSI.mm index b4c661f98900d..4dd123628c7d0 100644 --- a/shell/browser/ui/cocoa/NSString+ANSI.mm +++ b/shell/browser/ui/cocoa/NSString+ANSI.mm @@ -6,7 +6,6 @@ #import -#include "base/mac/scoped_nsobject.h" #include "content/public/common/color_parser.h" #include "shell/browser/ui/cocoa/NSString+ANSI.h" #include "skia/ext/skia_utils_mac.h" @@ -149,12 +148,11 @@ - (BOOL)containsANSICodes { - (NSMutableAttributedString*)attributedStringParsingANSICodes { NSMutableAttributedString* result = [[NSMutableAttributedString alloc] init]; - base::scoped_nsobject attributes( - [[NSMutableDictionary alloc] init]); + NSMutableDictionary* attributes([[NSMutableDictionary alloc] init]); NSArray* parts = [self componentsSeparatedByString:@"\033["]; - [result appendAttributedString:[[[NSAttributedString alloc] + [result appendAttributedString:[[NSAttributedString alloc] initWithString:parts.firstObject - attributes:nil] autorelease]]; + attributes:nil]]; for (NSString* part in [parts subarrayWithRange:NSMakeRange(1, parts.count - 1)]) { @@ -165,18 +163,16 @@ - (NSMutableAttributedString*)attributedStringParsingANSICodes { NSString* text = sequence.lastObject; if (sequence.count < 2) { - [result - appendAttributedString:[[[NSAttributedString alloc] - initWithString:text - attributes:attributes] autorelease]]; + [result appendAttributedString:[[NSAttributedString alloc] + initWithString:text + attributes:attributes]]; } else if (sequence.count >= 2) { text = [[sequence subarrayWithRange:NSMakeRange(1, sequence.count - 1)] componentsJoinedByString:@"m"]; [attributes modifyAttributesForANSICodes:sequence[0]]; - [result - appendAttributedString:[[[NSAttributedString alloc] - initWithString:text - attributes:attributes] autorelease]]; + [result appendAttributedString:[[NSAttributedString alloc] + initWithString:text + attributes:attributes]]; } } diff --git a/shell/browser/ui/cocoa/electron_bundle_mover.mm b/shell/browser/ui/cocoa/electron_bundle_mover.mm index b566721753ead..f6a7c12ab5a01 100644 --- a/shell/browser/ui/cocoa/electron_bundle_mover.mm +++ b/shell/browser/ui/cocoa/electron_bundle_mover.mm @@ -50,7 +50,7 @@ stringWithFileSystemRepresentation:fs.f_mntfromname length:strlen(fs.f_mntfromname)]; - NSTask* hdiutil = [[[NSTask alloc] init] autorelease]; + NSTask* hdiutil = [[NSTask alloc] init]; [hdiutil setLaunchPath:@"/usr/bin/hdiutil"]; [hdiutil setArguments:[NSArray arrayWithObjects:@"info", @"-plist", nil]]; [hdiutil setStandardOutput:[NSPipe pipe]]; @@ -286,8 +286,8 @@ bool Trash(NSString* path) { move theFile to trash end tell )str"; - NSAppleScript* appleScript = [[[NSAppleScript alloc] - initWithSource:[NSString stringWithFormat:@(code), path]] autorelease]; + NSAppleScript* appleScript = [[NSAppleScript alloc] + initWithSource:[NSString stringWithFormat:@(code), path]]; NSDictionary* errorDict = nil; NSAppleEventDescriptor* scriptResult = [appleScript executeAndReturnError:&errorDict]; diff --git a/shell/browser/ui/cocoa/electron_native_widget_mac.mm b/shell/browser/ui/cocoa/electron_native_widget_mac.mm index 12a9469b92ba6..3af6eb58f5aa2 100644 --- a/shell/browser/ui/cocoa/electron_native_widget_mac.mm +++ b/shell/browser/ui/cocoa/electron_native_widget_mac.mm @@ -26,11 +26,10 @@ NativeWidgetMacNSWindow* ElectronNativeWidgetMac::CreateNSWindow( const remote_cocoa::mojom::CreateWindowParams* params) { if (window_type_ == "panel") { - return [[[ElectronNSPanel alloc] initWithShell:shell_ - styleMask:style_mask_] autorelease]; + return [[ElectronNSPanel alloc] initWithShell:shell_ styleMask:style_mask_]; } else { - return [[[ElectronNSWindow alloc] initWithShell:shell_ - styleMask:style_mask_] autorelease]; + return [[ElectronNSWindow alloc] initWithShell:shell_ + styleMask:style_mask_]; } } diff --git a/shell/browser/ui/cocoa/window_buttons_proxy.mm b/shell/browser/ui/cocoa/window_buttons_proxy.mm index 350cddde2802b..6cc28b279beb4 100644 --- a/shell/browser/ui/cocoa/window_buttons_proxy.mm +++ b/shell/browser/ui/cocoa/window_buttons_proxy.mm @@ -45,7 +45,6 @@ - (id)initWithWindow:(NSWindow*)window { - (void)dealloc { if (hover_view_) [hover_view_ removeFromSuperview]; - [super dealloc]; } - (void)setVisible:(BOOL)visible { diff --git a/shell/browser/ui/drag_util_mac.mm b/shell/browser/ui/drag_util_mac.mm index 3410aecdd77df..638738106203f 100644 --- a/shell/browser/ui/drag_util_mac.mm +++ b/shell/browser/ui/drag_util_mac.mm @@ -54,8 +54,8 @@ void DragFileItems(const std::vector& files, NSMutableArray* file_items = [NSMutableArray array]; for (auto const& file : files) { NSURL* file_url = base::mac::FilePathToNSURL(file); - NSDraggingItem* file_item = [[[NSDraggingItem alloc] - initWithPasteboardWriter:file_url] autorelease]; + NSDraggingItem* file_item = + [[NSDraggingItem alloc] initWithPasteboardWriter:file_url]; NSImage* file_image = icon.ToNSImage(); NSSize image_size = file_image.size; NSRect image_rect = NSMakeRect(current_position.x - image_size.width / 2, diff --git a/shell/browser/ui/file_dialog_mac.mm b/shell/browser/ui/file_dialog_mac.mm index 0a268365b5424..434348f6c8fb9 100644 --- a/shell/browser/ui/file_dialog_mac.mm +++ b/shell/browser/ui/file_dialog_mac.mm @@ -73,8 +73,7 @@ @implementation ElectronAccessoryView - (void)dealloc { auto* popupButton = static_cast([[self subviews] objectAtIndex:1]); - [[popupButton target] release]; - [super dealloc]; + popupButton.target = nil; } @end @@ -148,10 +147,10 @@ void SetAllowedFileTypes(NSSavePanel* dialog, const Filters& filters) { [popupButton setTarget:popUpButtonHandler]; [popupButton setAction:@selector(selectFormat:)]; - [accessoryView addSubview:[label autorelease]]; - [accessoryView addSubview:[popupButton autorelease]]; + [accessoryView addSubview:label]; + [accessoryView addSubview:popupButton]; - [dialog setAccessoryView:[accessoryView autorelease]]; + [dialog setAccessoryView:accessoryView]; } void SetupDialog(NSSavePanel* dialog, const DialogSettings& settings) { diff --git a/shell/browser/ui/message_box_mac.mm b/shell/browser/ui/message_box_mac.mm index cc1b3ec4883e2..710e7716d10cd 100644 --- a/shell/browser/ui/message_box_mac.mm +++ b/shell/browser/ui/message_box_mac.mm @@ -14,7 +14,6 @@ #include "base/containers/contains.h" #include "base/functional/callback.h" #include "base/mac/mac_util.h" -#include "base/mac/scoped_nsobject.h" #include "base/no_destructor.h" #include "base/strings/sys_string_conversions.h" #include "content/public/browser/browser_task_traits.h" @@ -106,7 +105,7 @@ if (settings.text_width > 0) { NSRect rect = NSMakeRect(0, 0, settings.text_width, 0); NSView* accessoryView = [[NSView alloc] initWithFrame:rect]; - [alert setAccessoryView:[accessoryView autorelease]]; + [alert setAccessoryView:accessoryView]; } return alert; @@ -115,7 +114,7 @@ } // namespace int ShowMessageBoxSync(const MessageBoxSettings& settings) { - base::scoped_nsobject alert(CreateNSAlert(settings)); + NSAlert* alert(CreateNSAlert(settings)); // Use runModal for synchronous alert without parent, since we don't have a // window to wait for. Also use it when window is provided but it is not @@ -145,7 +144,7 @@ void ShowMessageBox(const MessageBoxSettings& settings, // Use runModal for synchronous alert without parent, since we don't have a // window to wait for. if (!settings.parent_window) { - int ret = [[alert autorelease] runModal]; + int ret = [alert runModal]; std::move(callback).Run( ret, alert.suppressionButton.state == NSControlStateValueOn); } else { @@ -175,7 +174,6 @@ void ShowMessageBox(const MessageBoxSettings& settings, if (response < 0) response = cancel_id; bool suppressed = alert.suppressionButton.state == NSControlStateValueOn; - [alert release]; // The completionHandler runs inside a transaction commit, and we should // not do any runModal inside it. However since we can not control what // users will run in the callback, we have to delay running the callback @@ -204,7 +202,6 @@ void ShowErrorBox(const std::u16string& title, const std::u16string& content) { [alert setInformativeText:base::SysUTF16ToNSString(content)]; [alert setAlertStyle:NSAlertStyleCritical]; [alert runModal]; - [alert release]; } } // namespace electron diff --git a/shell/common/api/electron_api_native_image_mac.mm b/shell/common/api/electron_api_native_image_mac.mm index 29645d2ba5f0c..54ad12921fe9c 100644 --- a/shell/common/api/electron_api_native_image_mac.mm +++ b/shell/common/api/electron_api_native_image_mac.mm @@ -13,7 +13,6 @@ #import #include "base/mac/foundation_util.h" -#include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "gin/arguments.h" #include "shell/common/gin_converters/image_converter.h" @@ -66,13 +65,11 @@ } NSScreen* screen = [[NSScreen screens] firstObject]; - base::scoped_nsobject request( - [[QLThumbnailGenerationRequest alloc] - initWithFileAtURL:nsurl - size:cg_size - scale:[screen backingScaleFactor] - representationTypes: - QLThumbnailGenerationRequestRepresentationTypeAll]); + QLThumbnailGenerationRequest* request([[QLThumbnailGenerationRequest alloc] + initWithFileAtURL:nsurl + size:cg_size + scale:[screen backingScaleFactor] + representationTypes:QLThumbnailGenerationRequestRepresentationTypeAll]); __block gin_helper::Promise p = std::move(promise); [[QLThumbnailGenerator sharedGenerator] generateBestRepresentationForRequest:request @@ -89,9 +86,9 @@ err_msg); }); } else { - NSImage* result = [[[NSImage alloc] + NSImage* result = [[NSImage alloc] initWithCGImage:[thumbnail CGImage] - size:cg_size] autorelease]; + size:cg_size]; gfx::Image image(result); dispatch_async(dispatch_get_main_queue(), ^{ p.Resolve(image); diff --git a/shell/common/application_info_mac.mm b/shell/common/application_info_mac.mm index c9ffbef889638..7a35873b04afd 100644 --- a/shell/common/application_info_mac.mm +++ b/shell/common/application_info_mac.mm @@ -20,8 +20,7 @@ } std::string ApplicationInfoDictionaryValue(CFStringRef key) { - NSString* key_ns = - const_cast(reinterpret_cast(key)); + NSString* key_ns = const_cast((__bridge const NSString*)(key)); return ApplicationInfoDictionaryValue(key_ns); } diff --git a/shell/common/platform_util_mac.mm b/shell/common/platform_util_mac.mm index d4ded68576e84..1370d205df721 100644 --- a/shell/common/platform_util_mac.mm +++ b/shell/common/platform_util_mac.mm @@ -30,7 +30,7 @@ // thread safe, including LSGetApplicationForURL (> 10.2) and // NSWorkspace#openURLs. std::string OpenURL(NSURL* ns_url, bool activate) { - CFURLRef cf_url = reinterpret_cast(ns_url); + CFURLRef cf_url = (__bridge CFURLRef)(ns_url); CFURLRef ref = LSCopyDefaultApplicationURLForURL(cf_url, kLSRolesAll, nullptr); From 984568c24bdfa47463d9ce87e8bf75a1fe0f91ec Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Fri, 4 Aug 2023 12:59:40 +0200 Subject: [PATCH 24/93] feat: allow more Node.js cli flags in main process (#39344) * feat: allow more Node.js cli flags in main process * docs: update cli switch documentation --- docs/api/command-line-switches.md | 30 +++++++++++++++++++--- shell/common/node_bindings.cc | 42 +++++++++++++++++++------------ 2 files changed, 52 insertions(+), 20 deletions(-) diff --git a/docs/api/command-line-switches.md b/docs/api/command-line-switches.md index e99f223b2f5fc..ee5e746420c25 100644 --- a/docs/api/command-line-switches.md +++ b/docs/api/command-line-switches.md @@ -241,19 +241,25 @@ Electron supports some of the [CLI flags][node-cli] supported by Node.js. **Note:** Passing unsupported command line switches to Electron when it is not running in `ELECTRON_RUN_AS_NODE` will have no effect. -### --inspect-brk\[=\[host:]port] +### `--inspect-brk\[=\[host:]port]` Activate inspector on host:port and break at start of user script. Default host:port is 127.0.0.1:9229. Aliased to `--debug-brk=[host:]port`. -### --inspect-port=\[host:]port +#### `--inspect-brk-node[=[host:]port]` + +Activate inspector on `host:port` and break at start of the first internal +JavaScript script executed when the inspector is available. +Default `host:port` is `127.0.0.1:9229`. + +### `--inspect-port=\[host:]port` Set the `host:port` to be used when the inspector is activated. Useful when activating the inspector by sending the SIGUSR1 signal. Default host is `127.0.0.1`. Aliased to `--debug-port=[host:]port`. -### --inspect\[=\[host:]port] +### `--inspect\[=\[host:]port]` Activate inspector on `host:port`. Default is `127.0.0.1:9229`. @@ -263,12 +269,28 @@ See the [Debugging the Main Process][debugging-main-process] guide for more deta Aliased to `--debug[=[host:]port`. -### --inspect-publish-uid=stderr,http +### `--inspect-publish-uid=stderr,http` Specify ways of the inspector web socket url exposure. By default inspector websocket url is available in stderr and under /json/list endpoint on http://host:port/json/list. +### `--no-deprecation` + +Silence deprecation warnings. + +### `--throw-deprecation` + +Throw errors for deprecations. + +### `--trace-deprecation` + +Print stack traces for deprecations. + +### `--trace-warnings` + +Print stack traces for process warnings (including deprecations). + [app]: app.md [append-switch]: command-line.md#commandlineappendswitchswitch-value [debugging-main-process]: ../tutorial/debugging-main-process.md diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 583a7a33345cf..d3670ed269982 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -228,21 +228,30 @@ void ErrorMessageListener(v8::Local message, } } -// Only allow DebugOptions in non-ELECTRON_RUN_AS_NODE mode. +// Only allow a specific subset of options in non-ELECTRON_RUN_AS_NODE mode. // If node CLI inspect support is disabled, allow no debug options. -bool IsAllowedDebugOption(base::StringPiece option) { - static constexpr auto options = base::MakeFixedFlatSet({ - "--debug", - "--debug-brk", - "--debug-port", - "--inspect", - "--inspect-brk", - "--inspect-brk-node", - "--inspect-port", - "--inspect-publish-uid", - }); - - return electron::fuses::IsNodeCliInspectEnabled() && options.contains(option); +bool IsAllowedOption(base::StringPiece option) { + static constexpr auto debug_options = + base::MakeFixedFlatSet({ + "--debug", + "--debug-brk", + "--debug-port", + "--inspect", + "--inspect-brk", + "--inspect-brk-node", + "--inspect-port", + "--inspect-publish-uid", + }); + + // This should be aligned with what's possible to set via the process object. + static constexpr auto options = base::MakeFixedFlatSet( + {"--trace-warnings", "--trace-deprecation", "--throw-deprecation", + "--no-deprecation"}); + + if (debug_options.contains(option)) + return electron::fuses::IsNodeCliInspectEnabled(); + + return options.contains(option); } // Initialize NODE_OPTIONS to pass to Node.js @@ -395,8 +404,9 @@ void NodeBindings::SetNodeCliFlags() { #endif const auto stripped = base::StringPiece(option).substr(0, option.find('=')); - // Only allow in no-op (--) option or DebugOptions - if (IsAllowedDebugOption(stripped) || stripped == "--") + // Only allow in no-op (--) option or a small set of debug + // and trace related options. + if (IsAllowedOption(stripped) || stripped == "--") args.push_back(option); } From deac26295a50d4407dc1095fe4af2cffed1f46ea Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Mon, 7 Aug 2023 03:51:53 -0400 Subject: [PATCH 25/93] ci: fix hang when validating AppVeyor artifacts (#39362) --- appveyor-woa.yml | 36 +++++++++++++++++++++++++++++++++++- appveyor.yml | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 6478bc1656268..2c1bdc28cdc0e 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -189,6 +189,31 @@ for: 7z a pdb.zip out\Default\*.pdb } - python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest + - ps: | + cd C:\projects\src + $missing_artifacts = $false + if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') { + Write-warning "Skipping artifact validation for doc-only $env:APPVEYOR_PROJECT_NAME" + } else { + $artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip' + foreach($artifact_name in $artifacts_to_validate) { + if ($artifact_name -eq 'ffmpeg.zip') { + $artifact_file = "out\ffmpeg\ffmpeg.zip" + } elseif ( + $artifact_name -eq 'node_headers.zip') { + $artifact_file = $artifact_name + } else { + $artifact_file = "out\Default\$artifact_name" + } + if (-not(Test-Path $artifact_file)) { + Write-warning "$artifact_name is missing and cannot be added to artifacts" + $missing_artifacts = $true + } + } + } + if ($missing_artifacts) { + throw "Build failed due to missing artifacts" + } deploy_script: - cd electron @@ -205,7 +230,16 @@ for: on_finish: # Uncomment this lines to enable RDP # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - - ps: "cd C:\\projects\\src\n$missing_artifacts = $false\nif ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {\n Write-warning \"Skipping artifact validation for doc-only PR\"\n} else {\n $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip')\n foreach($artifact_name in $artifacts_to_upload) {\n if ($artifact_name -eq 'ffmpeg.zip') {\n $artifact_file = \"out\\ffmpeg\\ffmpeg.zip\"\n } elseif ($artifact_name -eq 'node_headers.zip') {\n $artifact_file = $artifact_name\n } else {\n $artifact_file = \"out\\Default\\$artifact_name\"\n }\n if (Test-Path $artifact_file) {\n appveyor-retry appveyor PushArtifact $artifact_file \n } else {\n Write-warning \"$artifact_name is missing and cannot be added to artifacts\"\n $missing_artifacts = $true\n }\n }\n if ($missing_artifacts) {\n throw \"Build failed due to missing artifacts\"\n }\n}\n" + - cd C:\projects\src + - if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json ) + - if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip) + - if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe) + - if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip) + - if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip) + - if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip) + - if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip) + - if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip) + - if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib) - ps: >- if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) { appveyor-retry appveyor PushArtifact pdb.zip diff --git a/appveyor.yml b/appveyor.yml index 4ced279751265..02b669b89dc4b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -187,6 +187,31 @@ for: 7z a pdb.zip out\Default\*.pdb } - python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest + - ps: | + cd C:\projects\src + $missing_artifacts = $false + if ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') { + Write-warning "Skipping artifact validation for doc-only $env:APPVEYOR_PROJECT_NAME" + } else { + $artifacts_to_validate = 'dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip' + foreach($artifact_name in $artifacts_to_validate) { + if ($artifact_name -eq 'ffmpeg.zip') { + $artifact_file = "out\ffmpeg\ffmpeg.zip" + } elseif ( + $artifact_name -eq 'node_headers.zip') { + $artifact_file = $artifact_name + } else { + $artifact_file = "out\Default\$artifact_name" + } + if (-not(Test-Path $artifact_file)) { + Write-warning "$artifact_name is missing and cannot be added to artifacts" + $missing_artifacts = $true + } + } + } + if ($missing_artifacts) { + throw "Build failed due to missing artifacts" + } deploy_script: - cd electron @@ -203,7 +228,16 @@ for: on_finish: # Uncomment this lines to enable RDP # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - - ps: "cd C:\\projects\\src\n$missing_artifacts = $false\n\nif ($env:SHOULD_SKIP_ARTIFACT_VALIDATION -eq 'true') {\n Write-warning \"Skipping artifact validation for doc-only PR\"\n} else {\n $artifacts_to_upload = @('dist.zip','windows_toolchain_profile.json','shell_browser_ui_unittests.exe','chromedriver.zip','ffmpeg.zip','node_headers.zip','mksnapshot.zip','electron.lib','hunspell_dictionaries.zip')\n foreach($artifact_name in $artifacts_to_upload) {\n if ($artifact_name -eq 'ffmpeg.zip') {\n $artifact_file = \"out\\ffmpeg\\ffmpeg.zip\"\n } elseif ($artifact_name -eq 'node_headers.zip') {\n $artifact_file = $artifact_name\n } else {\n $artifact_file = \"out\\Default\\$artifact_name\"\n }\n if (Test-Path $artifact_file) {\n appveyor-retry appveyor PushArtifact $artifact_file \n } else {\n Write-warning \"$artifact_name is missing and cannot be added to artifacts\"\n $missing_artifacts = $true\n }\n }\n if ($missing_artifacts) {\n throw \"Build failed due to missing artifacts\"\n }\n}\n" + - cd C:\projects\src + - if exist out\Default\windows_toolchain_profile.json ( appveyor-retry appveyor PushArtifact out\Default\windows_toolchain_profile.json ) + - if exist out\Default\dist.zip (appveyor-retry appveyor PushArtifact out\Default\dist.zip) + - if exist out\Default\shell_browser_ui_unittests.exe (appveyor-retry appveyor PushArtifact out\Default\shell_browser_ui_unittests.exe) + - if exist out\Default\chromedriver.zip (appveyor-retry appveyor PushArtifact out\Default\chromedriver.zip) + - if exist out\ffmpeg\ffmpeg.zip (appveyor-retry appveyor PushArtifact out\ffmpeg\ffmpeg.zip) + - if exist node_headers.zip (appveyor-retry appveyor PushArtifact node_headers.zip) + - if exist out\Default\mksnapshot.zip (appveyor-retry appveyor PushArtifact out\Default\mksnapshot.zip) + - if exist out\Default\hunspell_dictionaries.zip (appveyor-retry appveyor PushArtifact out\Default\hunspell_dictionaries.zip) + - if exist out\Default\electron.lib (appveyor-retry appveyor PushArtifact out\Default\electron.lib) - ps: >- if ((Test-Path "pdb.zip") -And ($env:GN_CONFIG -ne 'release')) { appveyor-retry appveyor PushArtifact pdb.zip From 9154b9c19c2269a4e48121cfdbbbbaaa58157cd9 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 7 Aug 2023 09:52:18 +0200 Subject: [PATCH 26/93] fix: macOS tray button selection with VoiceOver (#39352) --- shell/browser/ui/tray_icon_cocoa.mm | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/shell/browser/ui/tray_icon_cocoa.mm b/shell/browser/ui/tray_icon_cocoa.mm index 9d6d6d4bd0f21..ba66aed141eab 100644 --- a/shell/browser/ui/tray_icon_cocoa.mm +++ b/shell/browser/ui/tray_icon_cocoa.mm @@ -54,7 +54,12 @@ - (id)initWithIcon:(electron::TrayIconCocoa*)icon { NSStatusItem* item = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]; statusItem_ = item; - [[statusItem_ button] addSubview:self]; // inject custom view + [[statusItem_ button] addSubview:self]; + + // We need to set the target and action on the button, otherwise + // VoiceOver doesn't know where to send the select action. + [[statusItem_ button] setTarget:self]; + [[statusItem_ button] setAction:@selector(mouseDown:)]; [self updateDimensions]; } return self; @@ -190,6 +195,25 @@ - (void)handleClickNotifications:(NSEvent*)event { } - (void)mouseDown:(NSEvent*)event { + // If |event| does not respond to locationInWindow, we've + // arrived here from VoiceOver, which does not pass an event. + // Create a synthetic event to pass to the click handler. + if (![event respondsToSelector:@selector(locationInWindow)]) { + event = [NSEvent mouseEventWithType:NSEventTypeRightMouseDown + location:NSMakePoint(0, 0) + modifierFlags:0 + timestamp:NSApp.currentEvent.timestamp + windowNumber:0 + context:nil + eventNumber:0 + clickCount:1 + pressure:1.0]; + + // We also need to explicitly call the click handler here, since + // VoiceOver won't trigger mouseUp. + [self handleClickNotifications:event]; + } + trayIcon_->NotifyMouseDown( gfx::ScreenPointFromNSPoint([event locationInWindow]), ui::EventFlagsFromModifiers([event modifierFlags])); From 97d63ad1128423ce76495d247f99401195fb5705 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 7 Aug 2023 00:56:36 -0700 Subject: [PATCH 27/93] docs: fix description of pageRanges (#39378) Co-authored-by: Alain BUFERNE --- docs/api/web-contents.md | 2 +- docs/api/webview-tag.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index cb046fb8fd9f2..0b4cdfe4a0cd3 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -1631,7 +1631,7 @@ win.webContents.print(options, (success, errorType) => { * `bottom` number (optional) - Bottom margin in inches. Defaults to 1cm (~0.4 inches). * `left` number (optional) - Left margin in inches. Defaults to 1cm (~0.4 inches). * `right` number (optional) - Right margin in inches. Defaults to 1cm (~0.4 inches). - * `pageRanges` string (optional) - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. + * `pageRanges` string (optional) - Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. * `headerTemplate` string (optional) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: `date` (formatted print date), `title` (document title), `url` (document location), `pageNumber` (current page number) and `totalPages` (total pages in the document). For example, `` would generate span containing the title. * `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`. * `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size. diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index 74b8c1519dd25..322a5b6d39348 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -601,7 +601,7 @@ Prints `webview`'s web page. Same as `webContents.print([options])`. * `bottom` number (optional) - Bottom margin in inches. Defaults to 1cm (~0.4 inches). * `left` number (optional) - Left margin in inches. Defaults to 1cm (~0.4 inches). * `right` number (optional) - Right margin in inches. Defaults to 1cm (~0.4 inches). - * `pageRanges` string (optional) - Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. + * `pageRanges` string (optional) - Page ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. * `headerTemplate` string (optional) - HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: `date` (formatted print date), `title` (document title), `url` (document location), `pageNumber` (current page number) and `totalPages` (total pages in the document). For example, `` would generate span containing the title. * `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`. * `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size. From d3ab4124e1964dbd56df7615570c77b868c2fd18 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 7 Aug 2023 10:03:45 +0200 Subject: [PATCH 28/93] fix: `chrome.tabs.update` return value (#39365) fix: chrome.tabs.update return value --- shell/browser/extensions/api/tabs/tabs_api.cc | 14 ++++++++++++++ spec/extensions-spec.ts | 17 +++++++++++++++++ .../extensions/tabs-api-async/background.js | 7 +++++++ spec/fixtures/extensions/tabs-api-async/main.js | 5 +++++ 4 files changed, 43 insertions(+) diff --git a/shell/browser/extensions/api/tabs/tabs_api.cc b/shell/browser/extensions/api/tabs/tabs_api.cc index 87920a6e1cb0f..cde0d41b28cfb 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.cc +++ b/shell/browser/extensions/api/tabs/tabs_api.cc @@ -57,6 +57,14 @@ void ZoomModeToZoomSettings(WebContentsZoomController::ZoomMode zoom_mode, break; } } + +api::tabs::MutedInfo CreateMutedInfo(content::WebContents* contents) { + DCHECK(contents); + api::tabs::MutedInfo info; + info.muted = contents->IsAudioMuted(); + info.reason = api::tabs::MUTED_INFO_REASON_USER; + return info; +} } // namespace ExecuteCodeInTabFunction::ExecuteCodeInTabFunction() : execute_tab_id_(-1) {} @@ -502,11 +510,17 @@ ExtensionFunction::ResponseValue TabsUpdateFunction::GetResult() { auto* api_web_contents = electron::api::WebContents::From(web_contents_); tab.id = (api_web_contents ? api_web_contents->ID() : -1); + // TODO(nornagon): in Chrome, the tab URL is only available to extensions // that have the "tabs" (or "activeTab") permission. We should do the same // permission check here. tab.url = web_contents_->GetLastCommittedURL().spec(); + if (api_web_contents) + tab.active = api_web_contents->IsFocused(); + tab.muted_info = CreateMutedInfo(web_contents_); + tab.audible = web_contents_->IsCurrentlyAudible(); + return ArgumentList(tabs::Get::Results::Create(std::move(tab))); } diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index cc8b49c6c2825..c55964c990d83 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -950,6 +950,23 @@ describe('chrome extensions', () => { expect(response.status).to.equal('reloaded'); }); }); + + it('update', async () => { + await w.loadURL(url); + + const message = { method: 'update', args: [{ muted: true }] }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [,, responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + + expect(response).to.have.property('mutedInfo').that.is.a('object'); + const { mutedInfo } = response; + expect(mutedInfo).to.deep.eq({ + muted: true, + reason: 'user' + }); + }); }); }); }); diff --git a/spec/fixtures/extensions/tabs-api-async/background.js b/spec/fixtures/extensions/tabs-api-async/background.js index 32290c36fb789..2e3eb8ebf5cd0 100644 --- a/spec/fixtures/extensions/tabs-api-async/background.js +++ b/spec/fixtures/extensions/tabs-api-async/background.js @@ -42,6 +42,13 @@ const handleRequest = (request, sender, sendResponse) => { chrome.tabs.reload(tabId).then(() => { sendResponse({ status: 'reloaded' }); }); + break; + } + + case 'update': { + const [params] = args; + chrome.tabs.update(tabId, params).then(sendResponse); + break; } } }; diff --git a/spec/fixtures/extensions/tabs-api-async/main.js b/spec/fixtures/extensions/tabs-api-async/main.js index 8c23bb00d0a18..4360681115ab2 100644 --- a/spec/fixtures/extensions/tabs-api-async/main.js +++ b/spec/fixtures/extensions/tabs-api-async/main.js @@ -34,6 +34,11 @@ const testMap = { chrome.runtime.sendMessage({ method: 'reload' }, response => { console.log(JSON.stringify(response)); }); + }, + update (params) { + chrome.runtime.sendMessage({ method: 'update', args: [params] }, response => { + console.log(JSON.stringify(response)); + }); } }; From 80f2cfe4641d3c0a532acb3a8bf7716904dc285c Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 7 Aug 2023 11:30:15 +0200 Subject: [PATCH 29/93] refactor: use `for-of` instead of `for` simple array iteration (#39338) --- lib/browser/api/dialog.ts | 4 ++-- spec/api-desktop-capturer-spec.ts | 4 ++-- spec/api-subframe-spec.ts | 6 +++--- spec/lib/video-helpers.js | 20 ++++++++++---------- spec/ts-smoke/electron/renderer.ts | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/browser/api/dialog.ts b/lib/browser/api/dialog.ts index e155ab307496c..3ec49b8bc203a 100644 --- a/lib/browser/api/dialog.ts +++ b/lib/browser/api/dialog.ts @@ -194,8 +194,8 @@ const messageBox = (sync: boolean, window: BrowserWindow | null, options?: Messa if (cancelId == null) { // If the defaultId is set to 0, ensure the cancel button is a different index (1) cancelId = (defaultId === 0 && buttons.length > 1) ? 1 : 0; - for (let i = 0; i < buttons.length; i++) { - const text = buttons[i].toLowerCase(); + for (const [i, button] of buttons.entries()) { + const text = button.toLowerCase(); if (text === 'cancel' || text === 'no') { cancelId = i; break; diff --git a/spec/api-desktop-capturer-spec.ts b/spec/api-desktop-capturer-spec.ts index 55dcaf4205976..b7729ac748036 100644 --- a/spec/api-desktop-capturer-spec.ts +++ b/spec/api-desktop-capturer-spec.ts @@ -60,8 +60,8 @@ ifdescribe(!process.arch.includes('arm') && process.platform !== 'win32')('deskt const sources = await desktopCapturer.getSources({ types: ['screen'] }); expect(sources).to.be.an('array').of.length(displays.length); - for (let i = 0; i < sources.length; i++) { - expect(sources[i].display_id).to.equal(displays[i].id.toString()); + for (const [i, source] of sources.entries()) { + expect(source.display_id).to.equal(displays[i].id.toString()); } }); diff --git a/spec/api-subframe-spec.ts b/spec/api-subframe-spec.ts index c5e5b50302e38..1a56612695ee7 100644 --- a/spec/api-subframe-spec.ts +++ b/spec/api-subframe-spec.ts @@ -133,14 +133,14 @@ describe('renderer nodeIntegrationInSubFrames', () => { const generateConfigs = (webPreferences: any, ...permutations: {name: string, webPreferences: any}[]) => { const configs = [{ webPreferences, names: [] as string[] }]; - for (let i = 0; i < permutations.length; i++) { + for (const permutation of permutations) { const length = configs.length; for (let j = 0; j < length; j++) { const newConfig = Object.assign({}, configs[j]); newConfig.webPreferences = Object.assign({}, - newConfig.webPreferences, permutations[i].webPreferences); + newConfig.webPreferences, permutation.webPreferences); newConfig.names = newConfig.names.slice(0); - newConfig.names.push(permutations[i].name); + newConfig.names.push(permutation.name); configs.push(newConfig); } } diff --git a/spec/lib/video-helpers.js b/spec/lib/video-helpers.js index c376b1598db93..b2ff78a6de7d5 100644 --- a/spec/lib/video-helpers.js +++ b/spec/lib/video-helpers.js @@ -313,16 +313,16 @@ function bitsToBuffer (bits) { function generateEBML (json) { const ebml = []; - for (let i = 0; i < json.length; i++) { - if (!('id' in json[i])) { + for (const item of json) { + if (!('id' in item)) { // already encoded blob or byteArray - ebml.push(json[i]); + ebml.push(item); continue; } - let data = json[i].data; + let data = item.data; if (typeof data === 'object') data = generateEBML(data); - if (typeof data === 'number') data = ('size' in json[i]) ? numToFixedBuffer(data, json[i].size) : bitsToBuffer(data.toString(2)); + if (typeof data === 'number') data = ('size' in item) ? numToFixedBuffer(data, item.size) : bitsToBuffer(data.toString(2)); if (typeof data === 'string') data = strToBuffer(data); const len = data.size || data.byteLength || data.length; @@ -335,7 +335,7 @@ function generateEBML (json) { // going to fix this, i'm probably just going to write some hacky thing which // converts that string into a buffer-esque thing - ebml.push(numToBuffer(json[i].id)); + ebml.push(numToBuffer(item.id)); ebml.push(bitsToBuffer(size)); ebml.push(data); } @@ -349,13 +349,13 @@ function toFlatArray (arr, outBuffer) { if (outBuffer == null) { outBuffer = []; } - for (let i = 0; i < arr.length; i++) { - if (typeof arr[i] === 'object') { + for (const item of arr) { + if (typeof item === 'object') { // an array - toFlatArray(arr[i], outBuffer); + toFlatArray(item, outBuffer); } else { // a simple element - outBuffer.push(arr[i]); + outBuffer.push(item); } } return outBuffer; diff --git a/spec/ts-smoke/electron/renderer.ts b/spec/ts-smoke/electron/renderer.ts index 8fc55790d04d8..16d0f9c02b8ef 100644 --- a/spec/ts-smoke/electron/renderer.ts +++ b/spec/ts-smoke/electron/renderer.ts @@ -74,14 +74,14 @@ crashReporter.start({ // https://github.com/electron/electron/blob/main/docs/api/desktop-capturer.md getSources({ types: ['window', 'screen'] }).then(sources => { - for (let i = 0; i < sources.length; ++i) { - if (sources[i].name === 'Electron') { + for (const source of sources) { + if (source.name === 'Electron') { (navigator as any).webkitGetUserMedia({ audio: false, video: { mandatory: { chromeMediaSource: 'desktop', - chromeMediaSourceId: sources[i].id, + chromeMediaSourceId: source.id, minWidth: 1280, maxWidth: 1280, minHeight: 720, From 97c4f386b007906811a2e68437726a661b485f30 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 7 Aug 2023 13:08:53 -0700 Subject: [PATCH 30/93] build: update appveyor image to e-117.0.5921.0 (#39390) build: update appveyor image to latest version Co-authored-by: jkleinsc --- appveyor-woa.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 2c1bdc28cdc0e..6bf813b9e5624 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-117.0.5911.0 +image: e-117.0.5921.0 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default diff --git a/appveyor.yml b/appveyor.yml index 02b669b89dc4b..89d45b84c8b7a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-117.0.5911.0 +image: e-117.0.5921.0 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default From 126d4871074a56a13faf6864af4fd5c2529c72f3 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 8 Aug 2023 10:23:14 +0200 Subject: [PATCH 31/93] fix: `removeBrowserView` draggable region removal (#39387) fix: removeBrowserView draggable region removal Closes https://github.com/electron/electron/issues/39377. --- shell/browser/api/electron_api_base_window.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index 421417ec9b007..57841dd41d19b 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -780,8 +780,8 @@ void BaseWindow::RemoveBrowserView(gin::Handle browser_view) { browser_view.ToV8()); if (iter != browser_views_.end()) { - window_->RemoveBrowserView(browser_view->view()); window_->RemoveDraggableRegionProvider(browser_view.get()); + window_->RemoveBrowserView(browser_view->view()); browser_view->SetOwnerWindow(nullptr); iter->Reset(); browser_views_.erase(iter); From e46a34011532bc2f7e5b9b9dc83d5802e4bc23ec Mon Sep 17 00:00:00 2001 From: Robo Date: Tue, 8 Aug 2023 17:45:03 +0900 Subject: [PATCH 32/93] fix: crash when closing active macOS native tab (#39394) fix: crash when closing current active macOS native tab --- shell/browser/ui/inspectable_web_contents_view_mac.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/shell/browser/ui/inspectable_web_contents_view_mac.mm b/shell/browser/ui/inspectable_web_contents_view_mac.mm index 175678f037bfc..7f465e173ba95 100644 --- a/shell/browser/ui/inspectable_web_contents_view_mac.mm +++ b/shell/browser/ui/inspectable_web_contents_view_mac.mm @@ -24,6 +24,7 @@ initWithInspectableWebContentsViewMac:this]) {} InspectableWebContentsViewMac::~InspectableWebContentsViewMac() { + [[NSNotificationCenter defaultCenter] removeObserver:view_]; CloseDevTools(); } From e3a31877dde02a04b55662a25ca660a29a1c7a48 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 8 Aug 2023 12:35:59 +0200 Subject: [PATCH 33/93] docs: handle opening links in the default browser in main.js (#39379) docs: handle opening links in the default browser in the main process --- docs/fiddles/menus/customize-menus/main.js | 6 ++++++ docs/fiddles/menus/customize-menus/renderer.js | 14 +------------- docs/fiddles/menus/shortcuts/index.html | 4 ---- docs/fiddles/menus/shortcuts/main.js | 8 +++++++- docs/fiddles/menus/shortcuts/renderer.js | 13 ------------- .../fiddles/native-ui/dialogs/error-dialog/main.js | 8 +++++++- .../native-ui/dialogs/error-dialog/renderer.js | 13 +------------ .../native-ui/dialogs/information-dialog/main.js | 8 +++++++- .../dialogs/information-dialog/renderer.js | 13 +------------ .../dialogs/open-file-or-directory/main.js | 8 +++++++- .../dialogs/open-file-or-directory/renderer.js | 13 +------------ docs/fiddles/native-ui/dialogs/save-dialog/main.js | 8 +++++++- .../native-ui/dialogs/save-dialog/renderer.js | 13 +------------ docs/fiddles/native-ui/drag-and-drop/main.js | 8 +++++++- docs/fiddles/native-ui/drag-and-drop/renderer.js | 13 ------------- .../native-ui/external-links-file-manager/main.js | 8 +++++++- .../external-links-file-manager/renderer.js | 12 ------------ docs/fiddles/native-ui/notifications/index.html | 2 +- docs/fiddles/native-ui/notifications/main.js | 8 +++++++- docs/fiddles/native-ui/notifications/renderer.js | 14 -------------- .../get-version-information/main.js | 8 +++++++- .../get-version-information/renderer.js | 14 -------------- .../manage-windows/frameless-window/main.js | 8 +++++++- .../manage-windows/frameless-window/renderer.js | 14 +------------- .../manage-windows/manage-window-state/main.js | 8 +++++++- .../manage-windows/manage-window-state/renderer.js | 14 +------------- .../windows/manage-windows/window-events/main.js | 8 +++++++- .../manage-windows/window-events/renderer.js | 14 +------------- 28 files changed, 99 insertions(+), 183 deletions(-) delete mode 100644 docs/fiddles/menus/shortcuts/renderer.js diff --git a/docs/fiddles/menus/customize-menus/main.js b/docs/fiddles/menus/customize-menus/main.js index b55adcc283ece..74a700895481f 100644 --- a/docs/fiddles/menus/customize-menus/main.js +++ b/docs/fiddles/menus/customize-menus/main.js @@ -312,6 +312,12 @@ function createWindow () { // when you should delete the corresponding element. mainWindow = null }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/menus/customize-menus/renderer.js b/docs/fiddles/menus/customize-menus/renderer.js index 24df360514c90..5527e1f20008d 100644 --- a/docs/fiddles/menus/customize-menus/renderer.js +++ b/docs/fiddles/menus/customize-menus/renderer.js @@ -1,4 +1,4 @@ -const { ipcRenderer, shell } = require('electron') +const { ipcRenderer } = require('electron') // Tell main process to show the menu when demo button is clicked const contextMenuBtn = document.getElementById('context-menu') @@ -6,15 +6,3 @@ const contextMenuBtn = document.getElementById('context-menu') contextMenuBtn.addEventListener('click', () => { ipcRenderer.send('show-context-menu') }) - -const links = document.querySelectorAll('a[href]') - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/menus/shortcuts/index.html b/docs/fiddles/menus/shortcuts/index.html index 3f65322c75ecd..6ab24f828bdf7 100644 --- a/docs/fiddles/menus/shortcuts/index.html +++ b/docs/fiddles/menus/shortcuts/index.html @@ -68,10 +68,6 @@

ProTip

- diff --git a/docs/fiddles/menus/shortcuts/main.js b/docs/fiddles/menus/shortcuts/main.js index f17dced4f656f..ff51f59a9adab 100644 --- a/docs/fiddles/menus/shortcuts/main.js +++ b/docs/fiddles/menus/shortcuts/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, globalShortcut, dialog } = require('electron') +const { app, BrowserWindow, globalShortcut, dialog, shell } = require('electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -38,6 +38,12 @@ function createWindow () { // when you should delete the corresponding element. mainWindow = null }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/menus/shortcuts/renderer.js b/docs/fiddles/menus/shortcuts/renderer.js deleted file mode 100644 index b403b34e38c2d..0000000000000 --- a/docs/fiddles/menus/shortcuts/renderer.js +++ /dev/null @@ -1,13 +0,0 @@ -const { shell } = require('electron') - -const links = document.querySelectorAll('a[href]') - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/native-ui/dialogs/error-dialog/main.js b/docs/fiddles/native-ui/dialogs/error-dialog/main.js index cf33afc3dca3e..1e26daacd8d83 100644 --- a/docs/fiddles/native-ui/dialogs/error-dialog/main.js +++ b/docs/fiddles/native-ui/dialogs/error-dialog/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, ipcMain, dialog } = require('electron') +const { app, BrowserWindow, ipcMain, dialog, shell } = require('electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -29,6 +29,12 @@ function createWindow () { // when you should delete the corresponding element. mainWindow = null }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/native-ui/dialogs/error-dialog/renderer.js b/docs/fiddles/native-ui/dialogs/error-dialog/renderer.js index 94e360ea9a94e..e355e7ee9a905 100644 --- a/docs/fiddles/native-ui/dialogs/error-dialog/renderer.js +++ b/docs/fiddles/native-ui/dialogs/error-dialog/renderer.js @@ -1,18 +1,7 @@ -const { ipcRenderer, shell } = require('electron') +const { ipcRenderer } = require('electron') -const links = document.querySelectorAll('a[href]') const errorBtn = document.getElementById('error-dialog') errorBtn.addEventListener('click', event => { ipcRenderer.send('open-error-dialog') }) - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/native-ui/dialogs/information-dialog/main.js b/docs/fiddles/native-ui/dialogs/information-dialog/main.js index 11b23c08acb8f..187abcfce7b15 100644 --- a/docs/fiddles/native-ui/dialogs/information-dialog/main.js +++ b/docs/fiddles/native-ui/dialogs/information-dialog/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, ipcMain, dialog } = require('electron') +const { app, BrowserWindow, ipcMain, dialog, shell } = require('electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -29,6 +29,12 @@ function createWindow () { // when you should delete the corresponding element. mainWindow = null }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/native-ui/dialogs/information-dialog/renderer.js b/docs/fiddles/native-ui/dialogs/information-dialog/renderer.js index 1f437c8556f4d..108d8e3241023 100644 --- a/docs/fiddles/native-ui/dialogs/information-dialog/renderer.js +++ b/docs/fiddles/native-ui/dialogs/information-dialog/renderer.js @@ -1,7 +1,6 @@ -const { ipcRenderer, shell } = require('electron') +const { ipcRenderer } = require('electron') const informationBtn = document.getElementById('information-dialog') -const links = document.querySelectorAll('a[href]') informationBtn.addEventListener('click', event => { ipcRenderer.send('open-information-dialog') @@ -13,13 +12,3 @@ ipcRenderer.on('information-dialog-selection', (event, index) => { else message += 'no.' document.getElementById('info-selection').innerHTML = message }) - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/native-ui/dialogs/open-file-or-directory/main.js b/docs/fiddles/native-ui/dialogs/open-file-or-directory/main.js index 85bee267b3745..b3f87183a7f89 100644 --- a/docs/fiddles/native-ui/dialogs/open-file-or-directory/main.js +++ b/docs/fiddles/native-ui/dialogs/open-file-or-directory/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, ipcMain, dialog } = require('electron') +const { app, BrowserWindow, ipcMain, dialog, shell } = require('electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -29,6 +29,12 @@ function createWindow () { // when you should delete the corresponding element. mainWindow = null }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/native-ui/dialogs/open-file-or-directory/renderer.js b/docs/fiddles/native-ui/dialogs/open-file-or-directory/renderer.js index 2de0b1d647442..08333444dca38 100644 --- a/docs/fiddles/native-ui/dialogs/open-file-or-directory/renderer.js +++ b/docs/fiddles/native-ui/dialogs/open-file-or-directory/renderer.js @@ -1,7 +1,6 @@ -const { ipcRenderer, shell } = require('electron') +const { ipcRenderer } = require('electron') const selectDirBtn = document.getElementById('select-directory') -const links = document.querySelectorAll('a[href]') selectDirBtn.addEventListener('click', event => { ipcRenderer.send('open-file-dialog') @@ -10,13 +9,3 @@ selectDirBtn.addEventListener('click', event => { ipcRenderer.on('selected-directory', (event, path) => { document.getElementById('selected-file').innerHTML = `You selected: ${path}` }) - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/native-ui/dialogs/save-dialog/main.js b/docs/fiddles/native-ui/dialogs/save-dialog/main.js index cf98f9e9c5c22..b522f27ed6bab 100644 --- a/docs/fiddles/native-ui/dialogs/save-dialog/main.js +++ b/docs/fiddles/native-ui/dialogs/save-dialog/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, ipcMain, dialog } = require('electron') +const { app, BrowserWindow, ipcMain, dialog, shell } = require('electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -29,6 +29,12 @@ function createWindow () { // when you should delete the corresponding element. mainWindow = null }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/native-ui/dialogs/save-dialog/renderer.js b/docs/fiddles/native-ui/dialogs/save-dialog/renderer.js index c51f9a8da9ba2..075b02e17b595 100644 --- a/docs/fiddles/native-ui/dialogs/save-dialog/renderer.js +++ b/docs/fiddles/native-ui/dialogs/save-dialog/renderer.js @@ -1,7 +1,6 @@ -const { ipcRenderer, shell } = require('electron') +const { ipcRenderer } = require('electron') const saveBtn = document.getElementById('save-dialog') -const links = document.querySelectorAll('a[href]') saveBtn.addEventListener('click', event => { ipcRenderer.send('save-dialog') @@ -11,13 +10,3 @@ ipcRenderer.on('saved-file', (event, path) => { if (!path) path = 'No path' document.getElementById('file-saved').innerHTML = `Path selected: ${path}` }) - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/native-ui/drag-and-drop/main.js b/docs/fiddles/native-ui/drag-and-drop/main.js index 7767495abbd9a..1137ef176a967 100644 --- a/docs/fiddles/native-ui/drag-and-drop/main.js +++ b/docs/fiddles/native-ui/drag-and-drop/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, ipcMain, nativeImage } = require('electron') +const { app, BrowserWindow, ipcMain, nativeImage, shell } = require('electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. let mainWindow @@ -28,6 +28,12 @@ function createWindow () { // when you should delete the corresponding element. mainWindow = null }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/native-ui/drag-and-drop/renderer.js b/docs/fiddles/native-ui/drag-and-drop/renderer.js index 621eea3a6bb25..859348551e762 100644 --- a/docs/fiddles/native-ui/drag-and-drop/renderer.js +++ b/docs/fiddles/native-ui/drag-and-drop/renderer.js @@ -1,17 +1,4 @@ const { ipcRenderer } = require('electron') -const shell = require('electron').shell - -const links = document.querySelectorAll('a[href]') - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} const dragFileLink = document.getElementById('drag-file-link') diff --git a/docs/fiddles/native-ui/external-links-file-manager/main.js b/docs/fiddles/native-ui/external-links-file-manager/main.js index a9a5c558ea59c..a2de1b97c8972 100644 --- a/docs/fiddles/native-ui/external-links-file-manager/main.js +++ b/docs/fiddles/native-ui/external-links-file-manager/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow } = require('electron') +const { app, BrowserWindow, shell } = require('electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -29,6 +29,12 @@ function createWindow () { // when you should delete the corresponding element. mainWindow = null }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/native-ui/external-links-file-manager/renderer.js b/docs/fiddles/native-ui/external-links-file-manager/renderer.js index e557679162bb9..2a059092c98f1 100644 --- a/docs/fiddles/native-ui/external-links-file-manager/renderer.js +++ b/docs/fiddles/native-ui/external-links-file-manager/renderer.js @@ -11,15 +11,3 @@ fileManagerBtn.addEventListener('click', (event) => { exLinksBtn.addEventListener('click', (event) => { shell.openExternal('https://electronjs.org') }) - -const links = document.querySelectorAll('a[href]') - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/native-ui/notifications/index.html b/docs/fiddles/native-ui/notifications/index.html index 60d43d1948534..b7d86f23aa89f 100644 --- a/docs/fiddles/native-ui/notifications/index.html +++ b/docs/fiddles/native-ui/notifications/index.html @@ -26,7 +26,7 @@

Open the - + full API documentation(opens in new window) in your browser. diff --git a/docs/fiddles/native-ui/notifications/main.js b/docs/fiddles/native-ui/notifications/main.js index a9a5c558ea59c..a2de1b97c8972 100644 --- a/docs/fiddles/native-ui/notifications/main.js +++ b/docs/fiddles/native-ui/notifications/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow } = require('electron') +const { app, BrowserWindow, shell } = require('electron') // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -29,6 +29,12 @@ function createWindow () { // when you should delete the corresponding element. mainWindow = null }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/native-ui/notifications/renderer.js b/docs/fiddles/native-ui/notifications/renderer.js index e7b2ca60bf3f2..9a97f7a869e03 100644 --- a/docs/fiddles/native-ui/notifications/renderer.js +++ b/docs/fiddles/native-ui/notifications/renderer.js @@ -1,5 +1,3 @@ -const { shell } = require('electron') - const basicNotification = { title: 'Basic Notification', body: 'Short message part' @@ -29,15 +27,3 @@ basicNotificationButton.addEventListener('click', () => { console.log('Notification clicked') } }) - -const links = document.querySelectorAll('a[href]') - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/system/system-information/get-version-information/main.js b/docs/fiddles/system/system-information/get-version-information/main.js index 8d9751b4ef960..34bdd9e32b3bc 100644 --- a/docs/fiddles/system/system-information/get-version-information/main.js +++ b/docs/fiddles/system/system-information/get-version-information/main.js @@ -1,4 +1,4 @@ -const { app, BrowserWindow } = require('electron') +const { app, BrowserWindow, shell } = require('electron') let mainWindow = null @@ -19,6 +19,12 @@ function createWindow () { mainWindow.on('closed', () => { mainWindow = null }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } app.whenReady().then(() => { diff --git a/docs/fiddles/system/system-information/get-version-information/renderer.js b/docs/fiddles/system/system-information/get-version-information/renderer.js index 714d52f172fa8..40f7f2cf2cf64 100644 --- a/docs/fiddles/system/system-information/get-version-information/renderer.js +++ b/docs/fiddles/system/system-information/get-version-information/renderer.js @@ -1,5 +1,3 @@ -const { shell } = require('electron') - const versionInfoBtn = document.getElementById('version-info') const electronVersion = process.versions.electron @@ -8,15 +6,3 @@ versionInfoBtn.addEventListener('click', () => { const message = `This app is using Electron version: ${electronVersion}` document.getElementById('got-version-info').innerHTML = message }) - -const links = document.querySelectorAll('a[href]') - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/windows/manage-windows/frameless-window/main.js b/docs/fiddles/windows/manage-windows/frameless-window/main.js index eb9d8d7b55596..b60f99d224903 100644 --- a/docs/fiddles/windows/manage-windows/frameless-window/main.js +++ b/docs/fiddles/windows/manage-windows/frameless-window/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, ipcMain } = require('electron') +const { app, BrowserWindow, ipcMain, shell } = require('electron') ipcMain.on('create-frameless-window', (event, { url }) => { const win = new BrowserWindow({ frame: false }) @@ -19,6 +19,12 @@ function createWindow () { // and load the index.html of the app. mainWindow.loadFile('index.html') + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/windows/manage-windows/frameless-window/renderer.js b/docs/fiddles/windows/manage-windows/frameless-window/renderer.js index d00294d010114..21f91ad561b37 100644 --- a/docs/fiddles/windows/manage-windows/frameless-window/renderer.js +++ b/docs/fiddles/windows/manage-windows/frameless-window/renderer.js @@ -1,4 +1,4 @@ -const { ipcRenderer, shell } = require('electron') +const { ipcRenderer } = require('electron') const newWindowBtn = document.getElementById('frameless-window') @@ -6,15 +6,3 @@ newWindowBtn.addEventListener('click', () => { const url = 'data:text/html,

Hello World!

Close this Window' ipcRenderer.send('create-frameless-window', { url }) }) - -const links = document.querySelectorAll('a[href]') - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/windows/manage-windows/manage-window-state/main.js b/docs/fiddles/windows/manage-windows/manage-window-state/main.js index caef426acbb29..05fcdd704e167 100644 --- a/docs/fiddles/windows/manage-windows/manage-window-state/main.js +++ b/docs/fiddles/windows/manage-windows/manage-window-state/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, ipcMain } = require('electron') +const { app, BrowserWindow, ipcMain, shell } = require('electron') ipcMain.on('create-demo-window', (event) => { const win = new BrowserWindow({ width: 400, height: 275 }) @@ -29,6 +29,12 @@ function createWindow () { // and load the index.html of the app. mainWindow.loadFile('index.html') + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/windows/manage-windows/manage-window-state/renderer.js b/docs/fiddles/windows/manage-windows/manage-window-state/renderer.js index 7071f50f2d4a6..bdf6a54c17950 100644 --- a/docs/fiddles/windows/manage-windows/manage-window-state/renderer.js +++ b/docs/fiddles/windows/manage-windows/manage-window-state/renderer.js @@ -1,9 +1,7 @@ -const { shell, ipcRenderer } = require('electron') +const { ipcRenderer } = require('electron') const manageWindowBtn = document.getElementById('manage-window') -const links = document.querySelectorAll('a[href]') - ipcRenderer.on('bounds-changed', (event, bounds) => { const manageWindowReply = document.getElementById('manage-window-reply') const message = `Size: ${bounds.size} Position: ${bounds.position}` @@ -13,13 +11,3 @@ ipcRenderer.on('bounds-changed', (event, bounds) => { manageWindowBtn.addEventListener('click', (event) => { ipcRenderer.send('create-demo-window') }) - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} diff --git a/docs/fiddles/windows/manage-windows/window-events/main.js b/docs/fiddles/windows/manage-windows/window-events/main.js index d9eac74714424..5abf2cc257ccb 100644 --- a/docs/fiddles/windows/manage-windows/window-events/main.js +++ b/docs/fiddles/windows/manage-windows/window-events/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, ipcMain } = require('electron') +const { app, BrowserWindow, ipcMain, shell } = require('electron') function createWindow () { // Create the browser window. @@ -15,6 +15,12 @@ function createWindow () { // and load the index.html of the app. mainWindow.loadFile('index.html') + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) + let demoWindow ipcMain.on('show-demo-window', () => { if (demoWindow) { diff --git a/docs/fiddles/windows/manage-windows/window-events/renderer.js b/docs/fiddles/windows/manage-windows/window-events/renderer.js index 70218b7df22a2..85460df9373ba 100644 --- a/docs/fiddles/windows/manage-windows/window-events/renderer.js +++ b/docs/fiddles/windows/manage-windows/window-events/renderer.js @@ -1,4 +1,4 @@ -const { shell, ipcRenderer } = require('electron') +const { ipcRenderer } = require('electron') const listenToWindowBtn = document.getElementById('listen-to-window') const focusModalBtn = document.getElementById('focus-on-modal-window') @@ -25,15 +25,3 @@ ipcRenderer.on('window-blur', showFocusBtn) listenToWindowBtn.addEventListener('click', () => { ipcRenderer.send('show-demo-window') }) - -const links = document.querySelectorAll('a[href]') - -for (const link of links) { - const url = link.getAttribute('href') - if (url.indexOf('http') === 0) { - link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal(url) - }) - } -} From 4f3cf17973f889227a6257a70dcad86eea0f7d01 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 8 Aug 2023 04:49:56 -0700 Subject: [PATCH 34/93] chore: fix ipcRenderer.sendTo deprecation warning (#39342) --- lib/renderer/api/ipc-renderer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/renderer/api/ipc-renderer.ts b/lib/renderer/api/ipc-renderer.ts index 4e1e7fba21c80..1977ce4ed384d 100644 --- a/lib/renderer/api/ipc-renderer.ts +++ b/lib/renderer/api/ipc-renderer.ts @@ -18,8 +18,9 @@ ipcRenderer.sendToHost = function (channel, ...args) { return ipc.sendToHost(channel, args); }; +const sendToDeprecated = deprecate.warnOnce('ipcRenderer.sendTo'); ipcRenderer.sendTo = function (webContentsId, channel, ...args) { - deprecate.warnOnce('ipcRenderer.sendTo'); + sendToDeprecated(); return ipc.sendTo(webContentsId, channel, args); }; From c39e28ccba9b4bdc637208768d4e16c5b00b562a Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Tue, 8 Aug 2023 09:56:41 -0700 Subject: [PATCH 35/93] build: use aks backed runners for linux builds (#39403) * build: test aks runner * build: stress test * build: use super-large nodes for publish jobs * build: try using aks for everything... * build: shared host not great * build: clean up * build: apparently tests dont run in kube infra? * build: do not change test size --- .circleci/config/base.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 0b9155df00eee..468a45f103b54 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -42,7 +42,9 @@ executors: size: description: "Docker executor size" type: enum - enum: ["medium", "xlarge", "2xlarge"] + # aks-linux-medium === 8 core (32 core host, shared with other builds) + # aks-linux-large === 32 core + enum: ["medium", "xlarge", "electronjs/aks-linux-medium", "electronjs/aks-linux-large"] docker: - image: ghcr.io/electron/build:e6bebd08a51a0d78ec23e5b3fd7e7c0846412328 resource_class: << parameters.size >> @@ -1698,7 +1700,7 @@ jobs: linux-x64-testing: executor: name: linux-docker - size: xlarge + size: electronjs/aks-linux-large environment: <<: *env-global <<: *env-testing-build @@ -1715,7 +1717,7 @@ jobs: linux-x64-testing-asan: executor: name: linux-docker - size: 2xlarge + size: electronjs/aks-linux-large environment: <<: *env-global <<: *env-testing-build @@ -1744,7 +1746,7 @@ jobs: linux-x64-publish: executor: name: linux-docker - size: 2xlarge + size: electronjs/aks-linux-large environment: <<: *env-linux-2xlarge-release <<: *env-release-build @@ -1767,7 +1769,7 @@ jobs: linux-arm-testing: executor: name: linux-docker - size: 2xlarge + size: electronjs/aks-linux-large environment: <<: *env-global <<: *env-arm @@ -1787,7 +1789,7 @@ jobs: linux-arm-publish: executor: name: linux-docker - size: 2xlarge + size: electronjs/aks-linux-large environment: <<: *env-linux-2xlarge-release <<: *env-arm @@ -1812,7 +1814,7 @@ jobs: linux-arm64-testing: executor: name: linux-docker - size: 2xlarge + size: electronjs/aks-linux-large environment: <<: *env-global <<: *env-arm64 @@ -1843,7 +1845,7 @@ jobs: linux-arm64-publish: executor: name: linux-docker - size: 2xlarge + size: electronjs/aks-linux-large environment: <<: *env-linux-2xlarge-release <<: *env-arm64 From 5aee52a17ab2ed6d992a5c354904acdb7766fc4b Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 8 Aug 2023 20:02:16 +0200 Subject: [PATCH 36/93] chore: remove i18n JSON spec (#39391) --- shell/common/extensions/api/i18n.json | 132 -------------------------- 1 file changed, 132 deletions(-) delete mode 100644 shell/common/extensions/api/i18n.json diff --git a/shell/common/extensions/api/i18n.json b/shell/common/extensions/api/i18n.json deleted file mode 100644 index 41678f21e6a9f..0000000000000 --- a/shell/common/extensions/api/i18n.json +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2012 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "i18n", - "description": "Use the chrome.i18n infrastructure to implement internationalization across your whole app or extension.", - "types": [ - { - "id": "LanguageCode", - "type": "string", - "description": "An ISO language code such as en or fr. For a complete list of languages supported by this method, see kLanguageInfoTable. For an unknown language, und will be returned, which means that [percentage] of the text is unknown to CLD" - } - ], - "functions": [ - { - "name": "getAcceptLanguages", - "type": "function", - "description": "Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use $(ref:i18n.getUILanguage).", - "parameters": [], - "returns_async": { - "name": "callback", - "parameters": [ - { - "name": "languages", - "type": "array", - "items": { - "$ref": "LanguageCode" - }, - "description": "Array of LanguageCode" - } - ] - } - }, - { - "name": "getMessage", - "nocompile": true, - "type": "function", - "description": "Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the getMessage() call is wrong — for example, messageName is not a string or the substitutions array has more than 9 elements — this method returns undefined.", - "parameters": [ - { - "type": "string", - "name": "messageName", - "description": "The name of the message, as specified in the messages.json file." - }, - { - "type": "any", - "name": "substitutions", - "optional": true, - "description": "Up to 9 substitution strings, if the message requires any." - }, - { - "type": "object", - "name": "options", - "optional": true, - "properties": { - "escapeLt": { - "type": "boolean", - "optional": true, - "description": "Escape < in translation to &lt;. This applies only to the message itself, not to the placeholders. Developers might want to use this if the translation is used in an HTML context. Closure Templates used with Closure Compiler generate this automatically." - } - } - } - ], - "returns": { - "type": "string", - "description": "Message localized for current locale." - } - }, - { - "name": "getUILanguage", - "type": "function", - "nocompile": true, - "description": "Gets the browser UI language of the browser. This is different from $(ref:i18n.getAcceptLanguages) which returns the preferred user languages.", - "parameters": [], - "returns": { - "type": "string", - "description": "The browser UI language code such as en-US or fr-FR." - } - }, - { - "name": "detectLanguage", - "type": "function", - "nocompile": true, - "description": "Detects the language of the provided text using CLD.", - "parameters": [ - { - "type": "string", - "name": "text", - "minimum": 0, - "description": "User input string to be translated." - } - ], - "returns_async": { - "name": "callback", - "parameters": [ - { - "type": "object", - "name": "result", - "description": "LanguageDetectionResult object that holds detected langugae reliability and array of DetectedLanguage", - "properties": { - "isReliable": { - "type": "boolean", - "description": "CLD detected language reliability" - }, - "languages": { - "type": "array", - "description": "array of detectedLanguage", - "items": { - "type": "object", - "description": "DetectedLanguage object that holds detected ISO language code and its percentage in the input string", - "properties": { - "language": { - "$ref": "LanguageCode" - }, - "percentage": { - "type": "integer", - "description": "The percentage of the detected language" - } - } - } - } - } - } - ] - } - } - ], - "events": [] - } -] From fbb92de81eb336799f975afafe70d68949fc4047 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 8 Aug 2023 22:29:03 +0200 Subject: [PATCH 37/93] chore: update `chrome.runtime.getPlatformInfo` impl (#39392) chore: update chrome.runtime.getPlatformInfo impl --- .../api/runtime/electron_runtime_api_delegate.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc b/shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc index e43a195b9f86e..976bd56cdb835 100644 --- a/shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc +++ b/shell/browser/extensions/api/runtime/electron_runtime_api_delegate.cc @@ -37,10 +37,13 @@ void ElectronRuntimeAPIDelegate::ReloadExtension( bool ElectronRuntimeAPIDelegate::CheckForUpdates( const std::string& extension_id, UpdateCheckCallback callback) { + LOG(INFO) << "chrome.runtime.requestUpdateCheck is not supported in Electron"; return false; } -void ElectronRuntimeAPIDelegate::OpenURL(const GURL& uninstall_url) {} +void ElectronRuntimeAPIDelegate::OpenURL(const GURL& uninstall_url) { + LOG(INFO) << "chrome.runtime.openURL is not supported in Electron"; +} bool ElectronRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { const char* os = update_client::UpdateQueryParams::GetOS(); @@ -74,9 +77,6 @@ bool ElectronRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { const char* nacl_arch = update_client::UpdateQueryParams::GetNaclArch(); if (strcmp(nacl_arch, "arm") == 0) { info->nacl_arch = extensions::api::runtime::PlatformNaclArch::kArm; - } else if (strcmp(nacl_arch, "arm64") == 0) { - // Use ARM for ARM64 NaCl, as ARM64 NaCl is not available. - info->nacl_arch = extensions::api::runtime::PlatformNaclArch::kArm; } else if (strcmp(nacl_arch, "x86-32") == 0) { info->nacl_arch = extensions::api::runtime::PlatformNaclArch::kX86_32; } else if (strcmp(nacl_arch, "x86-64") == 0) { From 5dc5801324d19de8d6ed330c9d63281e593db027 Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 17:52:51 -0500 Subject: [PATCH 38/93] chore: bump node to v18.17.0 (main) (#39154) * chore: bump node in DEPS to v18.17.0 * chore: update build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch Xref: https://github.com/nodejs/node/pull/46930 manually sync patch to minor upstream code shear * chore: update build_ensure_native_module_compilation_fails_if_not_using_a_new.patch Xref: https://github.com/nodejs/node/pull/48248 manually sync patch to minor upstream code shear * chore: update fix_expose_the_built-in_electron_module_via_the_esm_loader.patch Xref: https://github.com/nodejs/node/pull/47824 chore: upstream func throwIfUnsupportedURLProtocol() has been removed, so no need to patch it * chore: update api_pass_oomdetails_to_oomerrorcallback.patch Xref: https://github.com/nodejs/node/pull/47695 manually sync patch to minor upstream code shear * chore: remove fix_prevent_changing_functiontemplateinfo_after_publish.patch Xref: https://github.com/nodejs/node/pull/46979 (upstreamed patch) Xref: https://chromium-review.googlesource.com/c/v8/v8/+/2718147 (related) * chore: update fix_adapt_debugger_tests_for_upstream_v8_changes.patch Xref: https://github.com/nodejs/node/pull/47274 manually sync patch to minor upstream code shear some tests moved from sequential to parallel * chore: remove fix_libc_buffer_overflow_in_string_view_ctor.patch Xref: fix_libc_buffer_overflow_in_string_view_ctor.patch patch is no longer needed due to upstream bump to ada 2.2.0 * chore: remove fix_preventing_potential_oob_in_ada_no_scheme_parsing.patch Xref: https://github.com/nodejs/node/pull/47339 patch is no longer needed due to upstream bump to ada 2.2.0 * chore: rebuild filenames.json several files removed/added/changed upstream * chore: update build_add_gn_build_files.patch upstream dep histogram 0.11.7 moved its include path from src/ to include/ Xref: https://github.com/nodejs/node/pull/47742 * chore: update fix_crypto_tests_to_run_with_bssl.patch Xref: https://github.com/nodejs/node/pull/47160 BoringSSL doesn't support BIO_s_secmem() (a secure heap variant of BIO_s_mem()), so use BIO_s_mem() instead. Related discussion of secure heap support in BoringSSL: https://boringssl-review.googlesource.com/c/boringssl/+/54309 * fix: ftbfs in node dep ada * fix: ftbfs in node dep uvwasi * chore: rebuild patches * chore: update fix_handle_boringssl_and_openssl_incompatibilities.patch Upstream used `BIO_s_secmem()`, a secure heap variant of `BIO_s_mem()`. BoringSSL doesn't support it, so this PR opts for `BIO_s_mem()` instead. Upstream Node.js change that prompted this: https://github.com/nodejs/node/pull/47160 Related discussion of BoringSSL support of secure heap: https://boringssl-review.googlesource.com/c/boringssl/+/54309 * fix: work around Node 18 isURL() regression * chore: sort script/node-disabled-tests.json alphabetically * test: add parallel/test-snapshot-argv1 to disabled list test: add parallel/test-snapshot-namespaced-builtin to disabled list We don't support that type of snapshotting at the moment. * chore: disable flaky node test parallel/test-dgram-send-cb-quelches-error fails upstream in v18.x on my box as well * ci: ensure spawned node tests have ELECTRON_RUN_AS_NODE set * fixup! fix: work around Node 18 isURL() regression fix: infinite loop regression * fixup! fix: work around Node 18 isURL() regression * chore: patch fixtures/errors/force_colors.snapshot The line numbers in the stacktrace from our v8 build don't match what Node's tests are expecting, so update the stacktrace to match our build. The specific numbers probably aren't t needed for the force_colors test, which is trying to see whether or not the lines are greyed out. One option is to upstream a test change to stop hardcoding the stacktrace. * fixup! fix: work around Node 18 isURL() regression fix; pull in upstream bugfix * fixup! ci: ensure spawned node tests have ELECTRON_RUN_AS_NODE set chore: do not inject ELECTRON_RUN_AS_NODE in test-assert-colors.js * chore: disable flaky node test parallel/test-debugger-random-port-with-inspect-port --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr --- DEPS | 2 +- patches/node/.patches | 8 ++- ..._pass_oomdetails_to_oomerrorcallback.patch | 16 ++--- patches/node/build_add_gn_build_files.patch | 26 +++---- ...compilation_fails_if_not_using_a_new.patch | 8 +-- ...pression_sandbox_is_enabled_on_64bit.patch | 4 +- ...f_original-fs_and_custom_embedder_js.patch | 13 ++-- ...t_to_context_aware_module_prevention.patch | 4 +- ...de_entrypoint_to_be_a_builtin_module.patch | 6 +- ...ve_--no-harmony-atomics_related_code.patch | 2 +- ...ixtures_errors_force_colors_snapshot.patch | 34 +++++++++ ..._node_tests_set_electron_run_as_node.patch | 60 ++++++++++++++++ ...enable_crashpad_linux_node_processes.patch | 2 +- .../expose_get_builtin_module_function.patch | 8 +-- ...nalhandler_to_environment_to_prevent.patch | 16 ++--- .../node/feat_initialize_asar_support.patch | 4 +- patches/node/fix_-wshadow_warning.patch | 2 +- ...bugger_tests_for_upstream_v8_changes.patch | 22 +++--- .../fix_crypto_tests_to_run_with_bssl.patch | 2 +- ...ose_lookupandcompile_with_parameters.patch | 4 +- ...n_electron_module_via_the_esm_loader.patch | 23 ++---- ...se_tracing_tracingcontroller_instead.patch | 10 +-- .../node/fix_ftbfs_werror_wextra-semi.patch | 30 ++++++++ ...ftbfs_werror_wunreachable-code-break.patch | 30 ++++++++ ...ingssl_and_openssl_incompatibilities.patch | 33 +++++---- patches/node/fix_isurl_implementation.patch | 71 +++++++++++++++++++ ..._buffer_overflow_in_string_view_ctor.patch | 40 ----------- ...g_functiontemplateinfo_after_publish.patch | 61 ---------------- ...tential_oob_in_ada_no_scheme_parsing.patch | 21 ------ ..._undefined_symbol_error_on_woa_arm64.patch | 2 +- .../pass_all_globals_through_require.patch | 2 +- ...dder_overriding_of_internal_fs_calls.patch | 2 +- ...cess_fork_to_use_execute_script_with.patch | 2 +- .../node/support_v8_sandboxed_pointers.patch | 14 ++-- ...st_formally_mark_some_tests_as_flaky.patch | 4 +- .../node/v8_api_advance_api_deprecation.patch | 2 +- script/node-disabled-tests.json | 22 +++--- 37 files changed, 362 insertions(+), 250 deletions(-) create mode 100644 patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch create mode 100644 patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch create mode 100644 patches/node/fix_ftbfs_werror_wextra-semi.patch create mode 100644 patches/node/fix_ftbfs_werror_wunreachable-code-break.patch create mode 100644 patches/node/fix_isurl_implementation.patch delete mode 100644 patches/node/fix_libc_buffer_overflow_in_string_view_ctor.patch delete mode 100644 patches/node/fix_prevent_changing_functiontemplateinfo_after_publish.patch delete mode 100644 patches/node/fix_preventing_potential_oob_in_ada_no_scheme_parsing.patch diff --git a/DEPS b/DEPS index 743a01fa3c931..c44e0dd0e2fdf 100644 --- a/DEPS +++ b/DEPS @@ -4,7 +4,7 @@ vars = { 'chromium_version': '117.0.5921.0', 'node_version': - 'v18.16.1', + 'v18.17.0', 'nan_version': '16fa32231e2ccd89d2804b3f765319128b20c4ac', 'squirrel.mac_version': diff --git a/patches/node/.patches b/patches/node/.patches index 2b2e03219c8be..f419622b86399 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -27,15 +27,17 @@ fix_parallel_test-v8-stats.patch fix_expose_the_built-in_electron_module_via_the_esm_loader.patch api_pass_oomdetails_to_oomerrorcallback.patch fix_expose_lookupandcompile_with_parameters.patch -fix_prevent_changing_functiontemplateinfo_after_publish.patch enable_crashpad_linux_node_processes.patch test_formally_mark_some_tests_as_flaky.patch fix_adapt_debugger_tests_for_upstream_v8_changes.patch -fix_libc_buffer_overflow_in_string_view_ctor.patch -fix_preventing_potential_oob_in_ada_no_scheme_parsing.patch chore_remove_--no-harmony-atomics_related_code.patch fix_account_for_createexternalizablestring_v8_global.patch fix_wunreachable-code_warning_in_ares_init_rand_engine.patch fix_-wshadow_warning.patch fix_do_not_resolve_electron_entrypoints.patch fix_adapt_generator_tostringtag_prototype_to_v8.patch +fix_ftbfs_werror_wunreachable-code-break.patch +fix_ftbfs_werror_wextra-semi.patch +fix_isurl_implementation.patch +ci_ensure_node_tests_set_electron_run_as_node.patch +chore_update_fixtures_errors_force_colors_snapshot.patch diff --git a/patches/node/api_pass_oomdetails_to_oomerrorcallback.patch b/patches/node/api_pass_oomdetails_to_oomerrorcallback.patch index 8e316f8f3aa79..79d0d2fb1c0c9 100644 --- a/patches/node/api_pass_oomdetails_to_oomerrorcallback.patch +++ b/patches/node/api_pass_oomdetails_to_oomerrorcallback.patch @@ -8,15 +8,15 @@ Introduced in https://chromium-review.googlesource.com/c/v8/v8/+/3647827. This patch can be removed when Electron updates to Node.js v20. diff --git a/src/node_errors.cc b/src/node_errors.cc -index 2dc9e085269222c70902698020fc5c7b1af2f004..655f54e369c35efefa75c69cc57776249405dc76 100644 +index e58e45be7bbb642f2277361d6312d444cfa27d16..54402bd5663666425b17fd267ba05ba7b800791c 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc -@@ -527,9 +527,9 @@ void OnFatalError(const char* location, const char* message) { +@@ -521,9 +521,9 @@ static void ReportFatalException(Environment* env, ABORT(); } --void OOMErrorHandler(const char* location, bool is_heap_oom) { -+void OOMErrorHandler(const char* location, const v8::OOMDetails& details) { +-[[noreturn]] void OOMErrorHandler(const char* location, bool is_heap_oom) { ++[[noreturn]] void OOMErrorHandler(const char* location, const v8::OOMDetails& details) { const char* message = - is_heap_oom ? "Allocation failed - JavaScript heap out of memory" + details.is_heap_oom ? "Allocation failed - JavaScript heap out of memory" @@ -24,15 +24,15 @@ index 2dc9e085269222c70902698020fc5c7b1af2f004..655f54e369c35efefa75c69cc5777624 if (location) { FPrintF(stderr, "FATAL ERROR: %s %s\n", location, message); diff --git a/src/node_errors.h b/src/node_errors.h -index 850d437acdfe09fc43a7a37790c2926e6109749d..5a33d17b0e90e8ca8dc670e14f93de8fef99d526 100644 +index cc336536af0170e63cf9ccde99f9fa0a0be3f216..1687eed35717ae385aedad952c03ebab4f0f3bf7 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -21,7 +21,7 @@ void AppendExceptionLine(Environment* env, [[noreturn]] void FatalError(const char* location, const char* message); - void OnFatalError(const char* location, const char* message); --void OOMErrorHandler(const char* location, bool is_heap_oom); -+void OOMErrorHandler(const char* location, const v8::OOMDetails& details); + [[noreturn]] void OnFatalError(const char* location, const char* message); +-[[noreturn]] void OOMErrorHandler(const char* location, bool is_heap_oom); ++[[noreturn]] void OOMErrorHandler(const char* location, const v8::OOMDetails& details); // Helpers to construct errors similar to the ones provided by // lib/internal/errors.js. diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index 4cb30d5e17cb3..ec9b2069a3985 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -887,12 +887,12 @@ index 0000000000000000000000000000000000000000..0daf8c006cef89e76d7eccec3e924bd2 +} diff --git a/deps/histogram/BUILD.gn b/deps/histogram/BUILD.gn new file mode 100644 -index 0000000000000000000000000000000000000000..8ba89a379fa2937b4b2fa5092f18727c7d0788a6 +index 0000000000000000000000000000000000000000..02bc887db7c8545e1d8adc57f73f203eec2f2592 --- /dev/null +++ b/deps/histogram/BUILD.gn @@ -0,0 +1,19 @@ +config("histogram_config") { -+ include_dirs = [ "src" ] ++ include_dirs = [ "include" ] + + cflags = [ + "-Wno-implicit-function-declaration", @@ -910,6 +910,7 @@ index 0000000000000000000000000000000000000000..8ba89a379fa2937b4b2fa5092f18727c + "src/hdr_histogram.h", + ] +} +\ No newline at end of file diff --git a/deps/llhttp/BUILD.gn b/deps/llhttp/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..fb000f8ee7647c375bc190d1729d67bb7770d109 @@ -1261,10 +1262,10 @@ index 0000000000000000000000000000000000000000..2c9d2826c85bdd033f1df1d6188df636 +} diff --git a/filenames.json b/filenames.json new file mode 100644 -index 0000000000000000000000000000000000000000..bfed2576bda1371c35533bcf50888f84d82b57f3 +index 0000000000000000000000000000000000000000..7d86765bf229275ba55d37a452ef24832a7afadb --- /dev/null +++ b/filenames.json -@@ -0,0 +1,663 @@ +@@ -0,0 +1,664 @@ +// This file is automatically generated by generate_gn_filenames_json.py +// DO NOT EDIT +{ @@ -1470,6 +1471,7 @@ index 0000000000000000000000000000000000000000..bfed2576bda1371c35533bcf50888f84 + "lib/internal/crypto/sig.js", + "lib/internal/crypto/util.js", + "lib/internal/crypto/webcrypto.js", ++ "lib/internal/crypto/webidl.js", + "lib/internal/crypto/x509.js", + "lib/internal/debugger/inspect.js", + "lib/internal/debugger/inspect_client.js", @@ -1616,14 +1618,11 @@ index 0000000000000000000000000000000000000000..bfed2576bda1371c35533bcf50888f84 + "lib/internal/test_runner/reporter/dot.js", + "lib/internal/test_runner/reporter/spec.js", + "lib/internal/test_runner/reporter/tap.js", ++ "lib/internal/test_runner/reporter/v8-serializer.js", + "lib/internal/test_runner/runner.js", -+ "lib/internal/test_runner/tap_checker.js", -+ "lib/internal/test_runner/tap_lexer.js", -+ "lib/internal/test_runner/tap_parser.js", + "lib/internal/test_runner/test.js", + "lib/internal/test_runner/tests_stream.js", + "lib/internal/test_runner/utils.js", -+ "lib/internal/test_runner/yaml_to_js.js", + "lib/internal/timers.js", + "lib/internal/tls/secure-context.js", + "lib/internal/tls/secure-pair.js", @@ -1649,6 +1648,7 @@ index 0000000000000000000000000000000000000000..bfed2576bda1371c35533bcf50888f84 + "lib/internal/wasm_web_api.js", + "lib/internal/watch_mode/files_watcher.js", + "lib/internal/watchdog.js", ++ "lib/internal/webidl.js", + "lib/internal/webstreams/adapters.js", + "lib/internal/webstreams/compression.js", + "lib/internal/webstreams/encoding.js", @@ -1681,6 +1681,7 @@ index 0000000000000000000000000000000000000000..bfed2576bda1371c35533bcf50888f84 + "lib/string_decoder.js", + "lib/sys.js", + "lib/test.js", ++ "lib/test/reporters.js", + "lib/timers.js", + "lib/timers/promises.js", + "lib/tls.js", @@ -1707,6 +1708,7 @@ index 0000000000000000000000000000000000000000..bfed2576bda1371c35533bcf50888f84 + "//v8/tools/tickprocessor-driver.mjs", + "deps/acorn/acorn/dist/acorn.js", + "deps/acorn/acorn-walk/dist/walk.js", ++ "deps/minimatch/index.js", + "deps/cjs-module-lexer/lexer.js", + "deps/cjs-module-lexer/dist/lexer.js", + "deps/undici/undici.js" @@ -1964,10 +1966,10 @@ index 0000000000000000000000000000000000000000..9b1a4048a4a64c36d88de0bbe1a548c9 + } +} diff --git a/node.gyp b/node.gyp -index cf52281bb4479ba20fbe852518edadc2185f0dae..81254f1d4fff9be925ecbb85fb0811c0909900dd 100644 +index 6b554d75d89077f0fcfcaaf1636c8a537478f679..7f88a4466cb4a6b55b91345bb3af6b3600afd47a 100644 --- a/node.gyp +++ b/node.gyp -@@ -687,7 +687,7 @@ +@@ -688,7 +688,7 @@ 'src/util-inl.h', # Dependency headers 'deps/v8/include/v8.h', @@ -2183,7 +2185,7 @@ index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868b + args = rebase_path(inputs + outputs, root_build_dir) +} diff --git a/src/node_version.h b/src/node_version.h -index d08a0d731f6c14b0e66076a858214147821b5a32..67c008ee7724f10de476e7e523e902fa087eb2c8 100644 +index 5509ad145e59ce62341a479c2b2fdc377ede1c30..0bbfeabf2966734d5c6b143be89d7a914e7d9b99 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -89,7 +89,10 @@ @@ -2457,7 +2459,7 @@ index f13f2ecd662a5fb985839b394b45319c091b56d4..21bc48324946d52ed2b1c9eec35c1fcd if 'false' == variables.get('node_shared_libuv'): subdir_files('deps/uv/include', 'include/node/', action) diff --git a/tools/js2c.py b/tools/js2c.py -index f9c202e861b986e3171aa21079c3b29f51fe0398..ef24c4de0aaa2cd5f3c06e5bd8dd90de2b30ffcb 100755 +index 54c7dfce3631001e108570b19d34966edafd624f..077bba1572f05f1aa16553894703b12abc19a985 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -131,6 +131,14 @@ def NormalizeFileName(filename): 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 5e45b90c66908..10d601584777d 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 @@ -40,19 +40,19 @@ index f3e0047fea1319034bf8b05b8d54d8a4ef181b4b..be0289ea7df50d7c2cb002c6343b7501 'defines': [ 'V8_COMPRESS_POINTERS', diff --git a/configure.py b/configure.py -index 03ccbae0a1a837a382b98b828990d5a511f7a9d7..b5c747971a10b549007a8a3247aa5bd8058f311f 100755 +index 875d83e5db0037b902cff03c74852ea347513b03..8776cd057607ffe913bdd822a0aed5f9f1aa4a7a 100755 --- a/configure.py +++ b/configure.py -@@ -1529,6 +1529,7 @@ def configure_library(lib, output, pkgname=None): +@@ -1524,6 +1524,7 @@ def configure_library(lib, output, pkgname=None): def configure_v8(o): + o['variables']['using_electron_config_gypi'] = 1 - o['variables']['v8_enable_webassembly'] = 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 4b9b416e77b07407eae7b9587705b74ad3e6f211..deefda5c684c062f3c707fbdee30878a74d5dbb0 100644 +index c4cce244359d893acf31e78f935152d4d47b14cd..26368061a909e6abc62a4cf261a5dbbd79404f1a 100644 --- a/src/node.h +++ b/src/node.h @@ -22,6 +22,12 @@ diff --git a/patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch b/patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch index e0804226ebc8c..45c61827c4ff8 100644 --- a/patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch +++ b/patches/node/build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch @@ -42,10 +42,10 @@ index 543ede0020fd79251bdd9eac897d9a0e330ef239..f3e0047fea1319034bf8b05b8d54d8a4 'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'], }], diff --git a/configure.py b/configure.py -index 40e0395ebd2c3cbcff587294bf9f1646dcab21aa..03ccbae0a1a837a382b98b828990d5a511f7a9d7 100755 +index 7006ee65816989976b1648374565ebbae4b188f1..875d83e5db0037b902cff03c74852ea347513b03 100755 --- a/configure.py +++ b/configure.py -@@ -1542,6 +1542,7 @@ def configure_v8(o): +@@ -1537,6 +1537,7 @@ def configure_v8(o): o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1 o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0 o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0 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 952d101465590..86000f4dbc2e3 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 @@ -37,7 +37,7 @@ index ce885c154c81c5703365fa34957697698da9aff6..229b0d522aeee3632145c86715bea139 async function* watch(filename, options = kEmptyObject) { const path = toNamespacedPath(getValidatedPath(filename)); diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index 40d9025746d3c39cf9ea27b6cffc8f2eb7e62c1e..d3a0dd7cedb0d239ae427d1af2335e155345a454 100644 +index 2220869fa76f35fdfba72eba993b20748b07c546..522670ed5c9951c506dcdf2745585552ad2a081f 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc @@ -33,6 +33,7 @@ BuiltinLoader BuiltinLoader::instance_; @@ -61,7 +61,7 @@ index 90b158b84bb2a66781cf92f5b4c1a64f9e2ee651..8d9f7c409659a30747e5feeac6cfec42 std::vector GetBuiltinIds(); diff --git a/tools/js2c.py b/tools/js2c.py -index ef24c4de0aaa2cd5f3c06e5bd8dd90de2b30ffcb..ece70a8d7a1fdca051d4b821ba114be54bd34e4e 100755 +index 077bba1572f05f1aa16553894703b12abc19a985..bb9f26e3adc863757ad8ede5069d299c2d138369 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -39,6 +39,8 @@ import codecs @@ -159,22 +159,23 @@ index ef24c4de0aaa2cd5f3c06e5bd8dd90de2b30ffcb..ece70a8d7a1fdca051d4b821ba114be5 write_if_chaged(out, target) -@@ -218,6 +237,7 @@ def main(): +@@ -222,6 +241,7 @@ def main(): default=None, - help='input file directory') + help='root directory containing the sources') parser.add_argument('--verbose', action='store_true', help='output file') + parser.add_argument('--only-js', action='store_true', help='do not require or parse any config.gypi files') parser.add_argument('sources', nargs='*', help='input files') options = parser.parse_args() global is_verbose -@@ -230,12 +250,15 @@ def main(): +@@ -238,13 +258,15 @@ def main(): source_files = functools.reduce(SourceFileByExt, sources, {}) - # Should have exactly 3 types: `.js`, `.mjs` and `.gypi` - assert len(source_files) == 3 - # Currently config.gypi is the only `.gypi` file allowed -- assert source_files['.gypi'] == ['config.gypi'] +- assert len(source_files['.gypi']) == 1 +- assert os.path.basename(source_files['.gypi'][0]) == 'config.gypi' - source_files['config.gypi'] = source_files.pop('.gypi')[0] - JS2C(source_files, options.target) + if options.only_js: 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 a2884b2039669..49628b8e071ca 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 5093c3e53cee6d0ad9a9100b487549c3b4e7ae46..3e7b796fe5d285289e409985a5dba77b0d230910 100644 +index a82763cc5ad47f25b63b8c72e08bdc09ab841448..eb25fb4a81f53e2e443d0276bb1acbbf5700533a 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc @@ -4,6 +4,7 @@ @@ -19,7 +19,7 @@ index 5093c3e53cee6d0ad9a9100b487549c3b4e7ae46..3e7b796fe5d285289e409985a5dba77b #include "util.h" #include -@@ -475,7 +476,12 @@ void DLOpen(const FunctionCallbackInfo& args) { +@@ -481,7 +482,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 d5ab99a3c915b..01cfadc80b80a 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,7 +8,7 @@ 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 9783d9235ed43c7919ed2f26e35c96ae7ff1a08b..e4fd5e7dadb8230c9e07dbb7bc70b2117135c59a 100644 +index 8ce3d78839944ddd15bed299d89aeb61a7fd53e5..b3a54aecb06b07834e38f9c94c5246df31c7a47a 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -1230,6 +1230,13 @@ Module.prototype._compile = function(content, filename) { @@ -26,10 +26,10 @@ index 9783d9235ed43c7919ed2f26e35c96ae7ff1a08b..e4fd5e7dadb8230c9e07dbb7bc70b211 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 f91a32c0348f805d01d9c198c39cff4c5c72c88b..421b0ada67e281b4d269c7d3154e42f63e1e2cc7 100644 +index 2e35cbba2ac02494c44821af395fe0195b1ab6b5..f5b6fecf6843a6204ec532a77f39a36d33bf061d 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js -@@ -150,11 +150,13 @@ function patchProcessObject(expandArgv1) { +@@ -149,11 +149,13 @@ 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_remove_--no-harmony-atomics_related_code.patch b/patches/node/chore_remove_--no-harmony-atomics_related_code.patch index 2d2afa975520b..c57dee0102e69 100644 --- a/patches/node/chore_remove_--no-harmony-atomics_related_code.patch +++ b/patches/node/chore_remove_--no-harmony-atomics_related_code.patch @@ -37,7 +37,7 @@ index 7fbfb64984c290a1d71c99c92084975c31ce18fe..be4d82086199855a10108528b3dacc66 // not to workers created by other workers. let cachedCwd = ''; diff --git a/lib/internal/worker.js b/lib/internal/worker.js -index 59de3085cf65d532c1d8a9a3ff7fe75447639a10..9a2b8c06ec807fa62ef5130ad7b8aea21c7f049a 100644 +index 3d828d2f6f2b19554f7fc01ea880c0c144d8837d..78fcaec8d694580798783c83c3282ec1aaac4aa7 100644 --- a/lib/internal/worker.js +++ b/lib/internal/worker.js @@ -93,8 +93,7 @@ let cwdCounter; diff --git a/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch b/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch new file mode 100644 index 0000000000000..3aea2d4d028f4 --- /dev/null +++ b/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Charles Kerr +Date: Mon, 7 Aug 2023 20:29:10 -0500 +Subject: chore: update fixtures/errors/force_colors.snapshot + +The line numbers in the stacktrace from our v8 build don't match what +Node's tests are expecting, so update the stacktrace to match our build. + +The specific probably isn't needed for the force_colors test, which is +trying to see whether or not the lines are greyed out. One possibility +would be to upstream a changed test that doesn't hardcode line numbers. + +diff --git a/test/fixtures/errors/force_colors.snapshot b/test/fixtures/errors/force_colors.snapshot +index 0334a0b4faa3633aa8617b9538873e7f3540513b..d8c710e07602b68c9ad4eaaeab2bdf399ed5150b 100644 +--- a/test/fixtures/errors/force_colors.snapshot ++++ b/test/fixtures/errors/force_colors.snapshot +@@ -4,11 +4,12 @@ throw new Error('Should include grayed stack trace') + + Error: Should include grayed stack trace + at Object. (/test*force_colors.js:1:7) +- at Module._compile (node:internal*modules*cjs*loader:1256:14) +- at Module._extensions..js (node:internal*modules*cjs*loader:1310:10) +- at Module.load (node:internal*modules*cjs*loader:1119:32) +- at Module._load (node:internal*modules*cjs*loader:960:12) +- at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:81:12) ++ at Module._compile (node:internal*modules*cjs*loader:1271:14) ++ at Object..js (node:internal*modules*cjs*loader:1326:10) ++ at Module.load (node:internal*modules*cjs*loader:1126:32) ++ at node:internal*modules*cjs*loader:967:12 ++ at Function._load (node:electron*js2c*asar_bundle:756:32) ++ at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:87:12) +  at node:internal*main*run_main_module:23:47 + + Node.js * 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 new file mode 100644 index 0000000000000..481c2c00ba2ec --- /dev/null +++ b/patches/node/ci_ensure_node_tests_set_electron_run_as_node.patch @@ -0,0 +1,60 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Charles Kerr +Date: Mon, 7 Aug 2023 13:12:29 -0500 +Subject: ci: ensure node tests set ELECTRON_RUN_AS_NODE=1 + +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/common/assertSnapshot.js b/test/common/assertSnapshot.js +index c403751ac3ef5e39e7c0b1a1a8fb704ebf843dd7..83ee45f5f906adddcbc701112f373332dd1f66f9 100644 +--- a/test/common/assertSnapshot.js ++++ b/test/common/assertSnapshot.js +@@ -62,6 +62,7 @@ async function spawnAndAssert(filename, transform = (x) => x, { tty = false, ... + const flags = common.parseTestFlags(filename); + const executable = tty ? 'tools/pseudo-tty.py' : process.execPath; + const args = tty ? [process.execPath, ...flags, filename] : [...flags, filename]; ++ if (options && options.env) options.env.ELECTRON_RUN_AS_NODE = 1; + const { stdout, stderr } = await common.spawnPromisified(executable, args, options); + await assertSnapshot(transform(`${stdout}${stderr}`), filename); + } +diff --git a/test/fixtures/test-runner/output/arbitrary-output-colored.js b/test/fixtures/test-runner/output/arbitrary-output-colored.js +index b09eeeb9971cf6dfbdccc700757487fe2236e5a8..dd8296e63133eec6babac9b35e77da301a44b86f 100644 +--- a/test/fixtures/test-runner/output/arbitrary-output-colored.js ++++ b/test/fixtures/test-runner/output/arbitrary-output-colored.js +@@ -6,6 +6,6 @@ const fixtures = require('../../../common/fixtures'); + + (async function run() { + const test = fixtures.path('test-runner/output/arbitrary-output-colored-1.js'); +- await once(spawn(process.execPath, ['--test', test], { stdio: 'inherit', env: { FORCE_COLOR: 1 } }), 'exit'); +- await once(spawn(process.execPath, ['--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { FORCE_COLOR: 1 } }), 'exit'); +-})().then(common.mustCall()); ++ await once(spawn(process.execPath, ['--test', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1, FORCE_COLOR: 1 } }), 'exit'); ++ await once(spawn(process.execPath, ['--test', '--test-reporter', 'tap', test], { stdio: 'inherit', env: { ELECTRON_RUN_AS_NODE: 1, FORCE_COLOR: 1 } }), 'exit'); ++})().then(common.mustCall()); +\ No newline at end of file +diff --git a/test/parallel/test-node-output-console.mjs b/test/parallel/test-node-output-console.mjs +index 5a1b9feb6c8bedb50b89f5c4f3c5983455bb042d..efca7811dc0b6a590c5ee023c71801703a642882 100644 +--- a/test/parallel/test-node-output-console.mjs ++++ b/test/parallel/test-node-output-console.mjs +@@ -31,6 +31,7 @@ describe('console output', { concurrency: true }, () => { + .transform(snapshot.replaceWindowsLineEndings, snapshot.replaceWindowsPaths, replaceStackTrace); + for (const { name, transform, env } of tests) { + it(name, async () => { ++ if (env) env.ELECTRON_RUN_AS_NODE = 1; + await snapshot.spawnAndAssert(fixtures.path(name), transform ?? defaultTransform, { env }); + }); + } +diff --git a/test/parallel/test-node-output-errors.mjs b/test/parallel/test-node-output-errors.mjs +index fca2149fea32123dc4d4c6f21c64cc3c583454b3..b9a55fb7ea22e62553f69bd035797f7aaee1fc38 100644 +--- a/test/parallel/test-node-output-errors.mjs ++++ b/test/parallel/test-node-output-errors.mjs +@@ -53,6 +53,7 @@ describe('errors output', { concurrency: true }, () => { + !skipForceColors ? { name: 'errors/force_colors.js', env: { FORCE_COLOR: 1 } } : null, + ].filter(Boolean); + for (const { name, transform, env } of tests) { ++ if (env) env.ELECTRON_RUN_AS_NODE = 1; + it(name, async () => { + await snapshot.spawnAndAssert(fixtures.path(name), transform ?? defaultTransform, { env }); + }); diff --git a/patches/node/enable_crashpad_linux_node_processes.patch b/patches/node/enable_crashpad_linux_node_processes.patch index 92b3bddda966f..cd16b942d540e 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 07ad7906a7be156926d0c770c3d766c1a411203b..31061418c21d3764685110e827fc5ff536c74430 100644 +index da553f6556a06d57d7490d74a3b4dd8f0132600c..168a6c72520d6540f0dbf84a62bc5e2b2f3ae022 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -60,6 +60,7 @@ let debug = require('internal/util/debuglog').debuglog( diff --git a/patches/node/expose_get_builtin_module_function.patch b/patches/node/expose_get_builtin_module_function.patch index 508edc68b35b1..7059546cc8323 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 60b5eea61cf05344de9862a028165fecdb63fd35..5093c3e53cee6d0ad9a9100b487549c3b4e7ae46 100644 +index 259ce86b4c443c960dae6cb1c9d6c62b9ff23b30..a82763cc5ad47f25b63b8c72e08bdc09ab841448 100644 --- a/src/node_binding.cc +++ b/src/node_binding.cc -@@ -609,6 +609,10 @@ void GetInternalBinding(const FunctionCallbackInfo& args) { +@@ -620,6 +620,10 @@ void GetInternalBinding(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(exports); } @@ -24,10 +24,10 @@ index 60b5eea61cf05344de9862a028165fecdb63fd35..5093c3e53cee6d0ad9a9100b487549c3 Environment* env = Environment::GetCurrent(args); diff --git a/src/node_binding.h b/src/node_binding.h -index 13681bac67c64f5b9c81a034f0be1eeb2b346bb1..76898adc448c48715d8b9dc4aa782217a4fc7e05 100644 +index 32106afb0b7260b297c0e1a94527e03ed6039ee0..62a7473f64a618bb631b08cd5a32a1bcaa296aa8 100644 --- a/src/node_binding.h +++ b/src/node_binding.h -@@ -91,6 +91,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo& args); +@@ -98,6 +98,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_knostartdebugsignalhandler_to_environment_to_prevent.patch b/patches/node/feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch index 9b40a3eee5242..b9d61dee90750 100644 --- a/patches/node/feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch +++ b/patches/node/feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch @@ -7,10 +7,10 @@ Subject: feat: add kNoStartDebugSignalHandler to Environment to prevent This patch should be upstreamed, it allows embedders to prevent the call to StartDebugSignalHandler which handles SIGUSR1 and starts the inspector agent. Apps that have --inspect disabled also don't want SIGUSR1 to have this affect. diff --git a/src/env-inl.h b/src/env-inl.h -index bea695bd8c92d44cb9526f347a9464549155ed85..0cbd1b25c107b5deba5fdd14551cc641904f7f21 100644 +index 7ceab0da0c632f857f6e2d0fbf479bbc4f55df07..debd982c75805c51ea7d01229b9d635550060503 100644 --- a/src/env-inl.h +++ b/src/env-inl.h -@@ -669,6 +669,10 @@ inline bool Environment::no_global_search_paths() const { +@@ -627,6 +627,10 @@ inline bool Environment::no_global_search_paths() const { !options_->global_search_paths; } @@ -22,10 +22,10 @@ index bea695bd8c92d44cb9526f347a9464549155ed85..0cbd1b25c107b5deba5fdd14551cc641 // configure --no-browser-globals #ifdef NODE_NO_BROWSER_GLOBALS diff --git a/src/env.h b/src/env.h -index 82f2dd1689114ec9c89fa32130985f0e9e78cc5f..4cb02112598459ea78a4b7b683ddd57e21ecb4c4 100644 +index b0f10cfca00f380728903d5e0ea24cf3156ead0f..c914b621f50bcd6bce2617fef9e48737235aa516 100644 --- a/src/env.h +++ b/src/env.h -@@ -767,6 +767,7 @@ class Environment : public MemoryRetainer { +@@ -748,6 +748,7 @@ class Environment : public MemoryRetainer { inline bool tracks_unmanaged_fds() const; inline bool hide_console_windows() const; inline bool no_global_search_paths() const; @@ -34,10 +34,10 @@ index 82f2dd1689114ec9c89fa32130985f0e9e78cc5f..4cb02112598459ea78a4b7b683ddd57e inline uint64_t thread_id() const; inline worker::Worker* worker_context() const; diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc -index 214f992c9d015593ccdecd6eff0af4d960eccfbb..e5307b529c88d0e4db7fd7c6bd1b032d219b8c31 100644 +index b1ba86b7b0b2349f771e01143630e45cf0aecc3b..4c9f7f636aeeb19a87150ac5a05e28159503f051 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc -@@ -693,8 +693,10 @@ bool Agent::Start(const std::string& path, +@@ -703,8 +703,10 @@ bool Agent::Start(const std::string& path, StartIoThreadAsyncCallback)); uv_unref(reinterpret_cast(&start_io_thread_async)); start_io_thread_async.data = this; @@ -51,10 +51,10 @@ index 214f992c9d015593ccdecd6eff0af4d960eccfbb..e5307b529c88d0e4db7fd7c6bd1b032d parent_env_->AddCleanupHook([](void* data) { Environment* env = static_cast(data); diff --git a/src/node.h b/src/node.h -index 8314edbc82971148310c5c99e5a4b18dffa14e51..4b9b416e77b07407eae7b9587705b74ad3e6f211 100644 +index b50bd5a941d381778d464fdb2770566a3ac34fed..c4cce244359d893acf31e78f935152d4d47b14cd 100644 --- a/src/node.h +++ b/src/node.h -@@ -559,7 +559,11 @@ enum Flags : uint64_t { +@@ -575,7 +575,11 @@ enum Flags : uint64_t { // This control is needed by embedders who may not want to initialize the V8 // inspector in situations where one has already been created, // e.g. Blink's in Chromium. diff --git a/patches/node/feat_initialize_asar_support.patch b/patches/node/feat_initialize_asar_support.patch index fede0b77ac3f5..972c40956ed20 100644 --- a/patches/node/feat_initialize_asar_support.patch +++ b/patches/node/feat_initialize_asar_support.patch @@ -6,10 +6,10 @@ Subject: feat: initialize asar support This patch initializes asar support in Node.js. diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js -index a4cc80d48064fe4f58edf569de4ea962cecb4540..f91a32c0348f805d01d9c198c39cff4c5c72c88b 100644 +index 250a43c5455b4f9ff72dd3a34d5b0aa270f43cc6..2e35cbba2ac02494c44821af395fe0195b1ab6b5 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js -@@ -118,12 +118,17 @@ function setupUserModules() { +@@ -117,12 +117,17 @@ function setupUserModules() { loadPreloadModules(); // Need to be done after --require setup. initializeFrozenIntrinsics(); diff --git a/patches/node/fix_-wshadow_warning.patch b/patches/node/fix_-wshadow_warning.patch index 1ff7a9a1b1ce2..88ff6d4a9a71b 100644 --- a/patches/node/fix_-wshadow_warning.patch +++ b/patches/node/fix_-wshadow_warning.patch @@ -28,7 +28,7 @@ In file included from ../../third_party/electron_node/src/env-inl.h:32: 1 error generated. diff --git a/src/util.h b/src/util.h -index b1750f7b718f664153a96aa90be6efd94a46cda0..aef06b22076f4a288b00d348ee47d5978d41e75b 100644 +index a50d92601bf0ac278fa4137e056d5172a7589358..d18c263ae73d6181f07097bfcb1e4ef6f2e27e5e 100644 --- a/src/util.h +++ b/src/util.h @@ -129,10 +129,10 @@ void DumpBacktrace(FILE* fp); 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 index 0096f7517454a..978b11d75f86b 100644 --- a/patches/node/fix_adapt_debugger_tests_for_upstream_v8_changes.patch +++ b/patches/node/fix_adapt_debugger_tests_for_upstream_v8_changes.patch @@ -36,11 +36,11 @@ index 4aff5b9a0f74d99f8f605b68631f820e282091ab..d5d77fc7c648ddb45225f04c6cf23f98 }, ctrlC() { -diff --git a/test/sequential/test-debugger-break.js b/test/sequential/test-debugger-break.js -index 1d92331d4e10136ddc9d811c3eb07e6b24d0fc51..8f37b71571225eb6b264cd44fa031f82c701cdbc 100644 ---- a/test/sequential/test-debugger-break.js -+++ b/test/sequential/test-debugger-break.js -@@ -27,7 +27,7 @@ const cli = startCLI([script]); +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( @@ -49,7 +49,7 @@ index 1d92331d4e10136ddc9d811c3eb07e6b24d0fc51..8f37b71571225eb6b264cd44fa031f82 'pauses in next line of the script'); assert.match( cli.output, -@@ -36,7 +36,7 @@ const cli = startCLI([script]); +@@ -36,7 +36,7 @@ const cli = startCLI(['--port=0', script]); await cli.stepCommand('next'); assert.ok( @@ -58,7 +58,7 @@ index 1d92331d4e10136ddc9d811c3eb07e6b24d0fc51..8f37b71571225eb6b264cd44fa031f82 'pauses in next line of the script'); assert.match( cli.output, -@@ -89,7 +89,7 @@ const cli = startCLI([script]); +@@ -89,7 +89,7 @@ const cli = startCLI(['--port=0', script]); await cli.stepCommand(''); assert.match( cli.output, @@ -67,10 +67,10 @@ index 1d92331d4e10136ddc9d811c3eb07e6b24d0fc51..8f37b71571225eb6b264cd44fa031f82 'entered timers.js'); await cli.stepCommand('cont'); -diff --git a/test/sequential/test-debugger-run-after-quit-restart.js b/test/sequential/test-debugger-run-after-quit-restart.js -index a9da07dcdff8bd0b8cc69ccff8f29a67ff553592..2da4cea6359c8564a93863e43fc4a3f14a27e693 100644 ---- a/test/sequential/test-debugger-run-after-quit-restart.js -+++ b/test/sequential/test-debugger-run-after-quit-restart.js +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(() => { 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 2f52efa0e0bd3..b242c647ade0c 100644 --- a/patches/node/fix_crypto_tests_to_run_with_bssl.patch +++ b/patches/node/fix_crypto_tests_to_run_with_bssl.patch @@ -1030,7 +1030,7 @@ index 6c6b15781549a4b37781bf0b8014054dc5d8c746..142d41b169c836201660d78c19383f3f } +*/ diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js -index 8d107a99bdd8c5ce0c32cfbbc337b2c880bde200..2a2b7e2253ed2d55b3fb973d06dec768ba9b1e1c 100644 +index 670f19b7e4a190a222cc997f67975c3d49f65035..d4c4812cab56bcb51435aa6dd27545368fc11ed7 100644 --- a/test/parallel/test-webcrypto-wrap-unwrap.js +++ b/test/parallel/test-webcrypto-wrap-unwrap.js @@ -18,14 +18,15 @@ const kWrappingData = { diff --git a/patches/node/fix_expose_lookupandcompile_with_parameters.patch b/patches/node/fix_expose_lookupandcompile_with_parameters.patch index c9f6a91a7735d..7eab7217eaba7 100644 --- a/patches/node/fix_expose_lookupandcompile_with_parameters.patch +++ b/patches/node/fix_expose_lookupandcompile_with_parameters.patch @@ -10,10 +10,10 @@ parameters. This should be upstreamed. diff --git a/src/node_builtins.cc b/src/node_builtins.cc -index d3a0dd7cedb0d239ae427d1af2335e155345a454..de0c39234bb4155c56b4e51e42a399df3c4b8f87 100644 +index 522670ed5c9951c506dcdf2745585552ad2a081f..12ea7cdabb16a7f4ea350bdf1cd5d073e035fda1 100644 --- a/src/node_builtins.cc +++ b/src/node_builtins.cc -@@ -439,6 +439,22 @@ MaybeLocal BuiltinLoader::LookupAndCompile( +@@ -435,6 +435,22 @@ MaybeLocal BuiltinLoader::LookupAndCompile( return maybe; } 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 b84b765d1c617..406b6bbabba52 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,7 +6,7 @@ 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 eb5f0be49395b0192f18738d549241ae98793df7..522fd5cc6bea3e7fe4089eb25d64d65d2e8784ca 100644 +index 219ef03a21214deb8961044cfc18ef9c1e711b60..7749b37001f869fe565d8c450ff7ca2b6f3faa7a 100644 --- a/lib/internal/modules/esm/get_format.js +++ b/lib/internal/modules/esm/get_format.js @@ -30,6 +30,7 @@ const protocolHandlers = { @@ -18,10 +18,10 @@ index eb5f0be49395b0192f18738d549241ae98793df7..522fd5cc6bea3e7fe4089eb25d64d65d /** diff --git a/lib/internal/modules/esm/resolve.js b/lib/internal/modules/esm/resolve.js -index fd7d2feada9bbbba589fe89230e45954fa2dd3be..3c9b1ad93f2c6b5fde5e9ed2a8bf1dc01d94a8de 100644 +index 2cac6f2d450fab014544d15439e51575f86ccb38..ce2d851da2577e6e99980eb75337f629b38fddbf 100644 --- a/lib/internal/modules/esm/resolve.js +++ b/lib/internal/modules/esm/resolve.js -@@ -824,6 +824,8 @@ function parsePackageName(specifier, base) { +@@ -822,6 +822,8 @@ function parsePackageName(specifier, base) { return { packageName, packageSubpath, isScoped }; } @@ -30,7 +30,7 @@ index fd7d2feada9bbbba589fe89230e45954fa2dd3be..3c9b1ad93f2c6b5fde5e9ed2a8bf1dc0 /** * @param {string} specifier * @param {string | URL | undefined} base -@@ -836,6 +838,10 @@ function packageResolve(specifier, base, conditions) { +@@ -834,6 +836,10 @@ function packageResolve(specifier, base, conditions) { return new URL('node:' + specifier); } @@ -41,15 +41,6 @@ index fd7d2feada9bbbba589fe89230e45954fa2dd3be..3c9b1ad93f2c6b5fde5e9ed2a8bf1dc0 const { packageName, packageSubpath, isScoped } = parsePackageName(specifier, base); -@@ -1034,7 +1040,7 @@ function checkIfDisallowedImport(specifier, parsed, parsedParentURL) { - - function throwIfUnsupportedURLProtocol(url) { - if (url.protocol !== 'file:' && url.protocol !== 'data:' && -- url.protocol !== 'node:') { -+ url.protocol !== 'node:' && url.protocol !== 'electron:') { - throw new ERR_UNSUPPORTED_ESM_URL_SCHEME(url); - } - } diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index a425749e82acd7593c9fb1ceffedc119a4e416f2..1ceb89da21610c703f4a18be5888373c7feaa370 100644 --- a/lib/internal/modules/esm/translators.js @@ -77,12 +68,12 @@ index a425749e82acd7593c9fb1ceffedc119a4e416f2..1ceb89da21610c703f4a18be5888373c // We might trigger a getter -> dont fail. let value; diff --git a/lib/internal/url.js b/lib/internal/url.js -index 7b2e0b4ffa6cc71b78dd1a1f64f7f491a6669383..41327e0f33828b1a3f276c9054293d89a7956e1d 100644 +index 51688b8403076a328c2c62b6434fc310ee4f1ea7..36604c9de2179b5f6941dd9a7af66cdb03facd7f 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js -@@ -1221,6 +1221,8 @@ function fileURLToPath(path) { +@@ -1399,6 +1399,8 @@ function fileURLToPath(path) { path = new URL(path); - else if (!isURLInstance(path)) + else if (!isURL(path)) throw new ERR_INVALID_ARG_TYPE('path', ['string', 'URL'], path); + if (path.protocol === 'electron:') + return 'electron'; 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 93091bcb2202d..214695d67d33a 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 0de7ae88c2a715aa85a83217a2d9b2532e3be1f0..89236434d4816f619b30fe30bee1046a61c598ae 100644 +index e1095037f3b9970e3ffd314b641b454f1248e33e..7ef6d04794c31064c70dbbb0bfc1dd7bf4d1b8fc 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc -@@ -516,6 +516,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) { +@@ -520,6 +520,10 @@ MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env) { return env->platform(); } @@ -22,10 +22,10 @@ index 0de7ae88c2a715aa85a83217a2d9b2532e3be1f0..89236434d4816f619b30fe30bee1046a int thread_pool_size, node::tracing::TracingController* tracing_controller) { diff --git a/src/node.h b/src/node.h -index 04edec35975c6b9db1d44e896d92a9f5bc606d51..8314edbc82971148310c5c99e5a4b18dffa14e51 100644 +index ac9bce58f33380cd8b687a088176a446c1e8cf34..b50bd5a941d381778d464fdb2770566a3ac34fed 100644 --- a/src/node.h +++ b/src/node.h -@@ -129,6 +129,7 @@ namespace node { +@@ -130,6 +130,7 @@ namespace node { namespace tracing { @@ -33,7 +33,7 @@ index 04edec35975c6b9db1d44e896d92a9f5bc606d51..8314edbc82971148310c5c99e5a4b18d class TracingController; } -@@ -671,6 +672,8 @@ NODE_EXTERN void GetNodeReport(Environment* env, +@@ -688,6 +689,8 @@ NODE_EXTERN void GetNodeReport(Environment* env, NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env); NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env); diff --git a/patches/node/fix_ftbfs_werror_wextra-semi.patch b/patches/node/fix_ftbfs_werror_wextra-semi.patch new file mode 100644 index 0000000000000..cb8a07961867f --- /dev/null +++ b/patches/node/fix_ftbfs_werror_wextra-semi.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Charles Kerr +Date: Wed, 19 Jul 2023 16:00:08 -0500 +Subject: fix ftbfs Werror Wextra-semi + +Fix a deps warning that causes FTBFS when building with -Werror. + +This patch can be removed if fixed upstream. +Upstream PR: https://github.com/nodejs/uvwasi/pull/217 + +diff --git a/deps/uvwasi/src/uvwasi.c b/deps/uvwasi/src/uvwasi.c +index 9e7fc7681664b8430bbd2d2324352be8c6735106..708a52b0621666133b5215790cb9d5fd6a71d4fa 100644 +--- a/deps/uvwasi/src/uvwasi.c ++++ b/deps/uvwasi/src/uvwasi.c +@@ -2564,7 +2564,7 @@ uvwasi_errno_t uvwasi_sock_accept(uvwasi_t* uvwasi, + /* TODO(mhdawson): Needs implementation */ + UVWASI_DEBUG("uvwasi_sock_accept(uvwasi=%p, unimplemented)\n", uvwasi); + return UVWASI_ENOTSUP; +-}; ++} + + + const char* uvwasi_embedder_err_code_to_string(uvwasi_errno_t code) { +@@ -2651,4 +2651,4 @@ const char* uvwasi_embedder_err_code_to_string(uvwasi_errno_t code) { + default: + return "UVWASI_UNKNOWN_ERROR"; + } +-} ++} +\ No newline at end of file diff --git a/patches/node/fix_ftbfs_werror_wunreachable-code-break.patch b/patches/node/fix_ftbfs_werror_wunreachable-code-break.patch new file mode 100644 index 0000000000000..5aee0a822fdd6 --- /dev/null +++ b/patches/node/fix_ftbfs_werror_wunreachable-code-break.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Charles Kerr +Date: Wed, 19 Jul 2023 15:57:19 -0500 +Subject: fix ftbfs Werror Wunreachable-code-break + +Fix a deps warning that causes FTBFS when building with -Werror. + +This patch can be removed if fixed upstream. +Upstream PR 1: https://github.com/ada-url/ada/pull/464 +Upstream PR 2: https://github.com/ada-url/idna/pull/31 + +diff --git a/deps/ada/ada.cpp b/deps/ada/ada.cpp +index 570a659d118de5404003d0cd3731523d863de16b..43147d495f78eea916f895258f9c1846bd55f40a 100644 +--- a/deps/ada/ada.cpp ++++ b/deps/ada/ada.cpp +@@ -2829,7 +2829,6 @@ std::u32string map(std::u32string_view input) { + break; + case 2: + return error; // disallowed +- break; + + // case 3 : + default: +@@ -15175,4 +15174,4 @@ const ada_url_components* ada_get_components(ada_url result) noexcept { + } + } // extern "C" + /* end file src/ada_c.cpp */ +-/* end file src/ada.cpp */ ++/* end file src/ada.cpp */ +\ No newline at end of file diff --git a/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch b/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch index 49ac942b63033..9930fdbc5b40a 100644 --- a/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch +++ b/patches/node/fix_handle_boringssl_and_openssl_incompatibilities.patch @@ -104,10 +104,19 @@ index 41e607e9298314bd7dd9e61643650f3ec75caea8..bd3228a67e1bda671488b347bd53ca80 if (!Set(env->context(), obj, diff --git a/src/crypto/crypto_context.cc b/src/crypto/crypto_context.cc -index b9f323035ff543ecb6f7bd577512729f0d60a156..0262dee543359c85c2c293ee22a8697b05f75feb 100644 +index 838ee2a68dffc5a2aeca2bdb51b076795b2b145f..b0b18cd30c854c8c30d74afbf3ed352d3d23f30d 100644 --- a/src/crypto/crypto_context.cc +++ b/src/crypto/crypto_context.cc -@@ -857,10 +857,12 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { +@@ -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; +@@ -855,10 +855,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. @@ -208,7 +217,7 @@ index dd69323b80076d7333b80453c9cc9ef5b680ce27..6431b768c83fa27b2287588e936f93ae UNREACHABLE(); } diff --git a/src/crypto/crypto_dsa.cc b/src/crypto/crypto_dsa.cc -index 6839283fbf4ca7ee7dd586e749c80671ad965658..4e186abdf13613cbe576da5b7d547408c0ee9f93 100644 +index 3fa4a415dc911a13afd90dfb31c1ed4ad0fd268f..fa48dffc31342c44a1c1207b9d4c3dc72ed93b60 100644 --- a/src/crypto/crypto_dsa.cc +++ b/src/crypto/crypto_dsa.cc @@ -40,7 +40,7 @@ namespace crypto { @@ -232,10 +241,10 @@ index 6839283fbf4ca7ee7dd586e749c80671ad965658..4e186abdf13613cbe576da5b7d547408 return EVPKeyCtxPointer(); diff --git a/src/crypto/crypto_random.cc b/src/crypto/crypto_random.cc -index 2f9e9aacb1e652202d72c69b46f8e76d6c5405a8..5f19c38a78e37d3e8d92bcc20ae1357f20349ad4 100644 +index 9850104cd607f877a8e867e83a8d4d4ccd4a4395..f153b3366e2795133ff3df7b7a2153a6106237e4 100644 --- a/src/crypto/crypto_random.cc +++ b/src/crypto/crypto_random.cc -@@ -146,7 +146,7 @@ Maybe RandomPrimeTraits::AdditionalConfig( +@@ -140,7 +140,7 @@ Maybe RandomPrimeTraits::AdditionalConfig( params->bits = bits; params->safe = safe; @@ -265,10 +274,10 @@ index 47a42246eddfc795b735f5efd08edf2832bbf6c1..7e6afaa1d3a4612fd567924b40438a31 if (target diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc -index 247067a9908717ba1323bd610eeeedf3aba008a4..0fe7358d3f419f6e6f00eb4cc8422e9c5cb6cb9a 100644 +index 87d6ab3b9970e48db53cf7061d7208679c8b1dfc..4d79fbb4a30a7e57a7456413685706d9af36b1b3 100644 --- a/src/crypto/crypto_util.cc +++ b/src/crypto/crypto_util.cc -@@ -508,24 +508,15 @@ Maybe Decorate(Environment* env, Local obj, +@@ -518,24 +518,15 @@ Maybe Decorate(Environment* env, Local obj, V(BIO) \ V(PKCS7) \ V(X509V3) \ @@ -294,7 +303,7 @@ index 247067a9908717ba1323bd610eeeedf3aba008a4..0fe7358d3f419f6e6f00eb4cc8422e9c V(USER) \ #define V(name) case ERR_LIB_##name: lib = #name "_"; break; -@@ -699,7 +690,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -709,7 +700,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { CHECK(args[0]->IsUint32()); Environment* env = Environment::GetCurrent(args); uint32_t len = args[0].As()->Value(); @@ -303,7 +312,7 @@ index 247067a9908717ba1323bd610eeeedf3aba008a4..0fe7358d3f419f6e6f00eb4cc8422e9c if (data == nullptr) { // There's no memory available for the allocation. // Return nothing. -@@ -710,7 +701,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -720,7 +711,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { data, len, [](void* data, size_t len, void* deleter_data) { @@ -312,7 +321,7 @@ index 247067a9908717ba1323bd610eeeedf3aba008a4..0fe7358d3f419f6e6f00eb4cc8422e9c }, data); Local buffer = ArrayBuffer::New(env->isolate(), store); -@@ -718,10 +709,12 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -728,10 +719,12 @@ void SecureBuffer(const FunctionCallbackInfo& args) { } void SecureHeapUsed(const FunctionCallbackInfo& args) { @@ -352,7 +361,7 @@ index 1831bfd0baaac70277fc274a72235bf6a04697cb..1c0a3fcdeb44dc947bb8c38459533779 #if NODE_OPENSSL_HAS_QUIC #include diff --git a/src/node_options.cc b/src/node_options.cc -index 6e156fa1ba448f8d0c709eb7ba7112e92909a8fc..8bbee83ddb32a31ada18d7a6e8be7cdf33321b69 100644 +index 47a24ef5e59f049848637afbbfae6c9cfb9b8902..499d048fcb82e50a302d74e2c7f87f3696103a40 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -6,7 +6,7 @@ @@ -365,7 +374,7 @@ index 6e156fa1ba448f8d0c709eb7ba7112e92909a8fc..8bbee83ddb32a31ada18d7a6e8be7cdf #endif diff --git a/src/node_options.h b/src/node_options.h -index 665ea4ceb779f7c7747e53aba4beba0494fa7ebe..22a346eb23274374d5a5aa4a1b2219e6ebdee48a 100644 +index c57e7a93b13a856e834b77707feaf691241ebc41..f8bdd016e13a8775520bfee7eb61d1c8d667bb58 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -11,7 +11,7 @@ diff --git a/patches/node/fix_isurl_implementation.patch b/patches/node/fix_isurl_implementation.patch new file mode 100644 index 0000000000000..63fa1d8a5ae15 --- /dev/null +++ b/patches/node/fix_isurl_implementation.patch @@ -0,0 +1,71 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Charles Kerr +Date: Thu, 20 Jul 2023 14:18:19 -0500 +Subject: fix: isURL() implementation + +Modify Node's lib/internal/url.js isURL() to return the correct value for +URLs created both inside and outside of Node. + +The isURL() impl in `main` is Electron-safe but can't be backported in +isolation because it relies on other changes from 18 to main. But we can +safely get there by trying the 18 version first (catching Node URLs), +then the `main` version (catching Electron URLs). + +More background w/upstream links at +https://github.com/electron/electron/pull/39154#issuecomment-1644433388 + +This patch can be removed when we update to Node 20. + +diff --git a/lib/internal/url.js b/lib/internal/url.js +index 36604c9de2179b5f6941dd9a7af66cdb03facd7f..525b18e58a3e2f8e5ddfb138b1c54fd9b23a20cf 100644 +--- a/lib/internal/url.js ++++ b/lib/internal/url.js +@@ -592,7 +592,12 @@ ObjectDefineProperties(URLSearchParams.prototype, { + * @returns {self is URL} + */ + function isURL(self) { +- return self != null && ObjectPrototypeHasOwnProperty(self, context); ++ // if it has `context` it is a Node.js URL... ++ if (self != null && ObjectPrototypeHasOwnProperty(self, context)) ++ return true; ++ ++ // ...but also honor 3rd party URLs e.g. from Electron. ++ return Boolean(self?.href && self.protocol && self.auth === undefined && self.path === undefined); + } + + class URL { +@@ -688,14 +693,10 @@ class URL { + } + + get href() { +- if (!isURL(this)) +- throw new ERR_INVALID_THIS('URL'); + return this[context].href; + } + + set href(value) { +- if (!isURL(this)) +- throw new ERR_INVALID_THIS('URL'); + value = `${value}`; + const href = bindingUrl.update(this[context].href, updateActions.kHref, value); + if (!href) { throw ERR_INVALID_URL(value); } +diff --git a/test/parallel/test-whatwg-url-invalidthis.js b/test/parallel/test-whatwg-url-invalidthis.js +index 790c28e37c13ed6763cb61b549ab4a983f384717..bddf48b8302632a275d996a53b09343938dc7dc9 100644 +--- a/test/parallel/test-whatwg-url-invalidthis.js ++++ b/test/parallel/test-whatwg-url-invalidthis.js +@@ -15,7 +15,6 @@ const assert = require('assert'); + }); + + [ +- 'href', + 'protocol', + 'username', + 'password', +@@ -36,7 +35,6 @@ const assert = require('assert'); + }); + + [ +- 'origin', + 'searchParams', + ].forEach((i) => { + assert.throws(() => Reflect.get(URL.prototype, i, {}), { diff --git a/patches/node/fix_libc_buffer_overflow_in_string_view_ctor.patch b/patches/node/fix_libc_buffer_overflow_in_string_view_ctor.patch deleted file mode 100644 index fe8cc72968dab..0000000000000 --- a/patches/node/fix_libc_buffer_overflow_in_string_view_ctor.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Tue, 18 Apr 2023 11:24:59 +0200 -Subject: fix: libc++ buffer overflow in string_view ctor - -Refs https://github.com/nodejs/node/pull/46410 -Refs https://github.com/llvm/llvm-project/issues/61100. - -Fixes a buffer overflow crash in std::string view constructor. This -happens as a result of a limitation of libc++'s implementation of the -string_view constructor. If string_view receives a pointer to a string start point, -and then a length as a size_t, the spec says that a size_t that exceeds the length -of the null terminated string found at pointer only be read up until the null terminator. - -However, Chromium's implementation however does a hard check that this length is less than -or equal to static_cast(std::numeric_limits::max()): -https://source.chromium.org/chromium/chromium/src/+/main:buildtools/third_party/libc++/trunk/include/string_view;drc=1718a75513d114e6b9aa4474e5c55d8dabee92fb;l=309 - -This doesn't break in Node.js right now because that hard assert is missing, but will -break in the next version of Xcode that's shipped and this Node.js too. - -This should be upstreamed to ada. - -diff --git a/deps/ada/ada.cpp b/deps/ada/ada.cpp -index 8b2cdd38ad0bb1e5757cdf5724c5a5917fc8e577..7d2f75fe559c1878e129aa681c86d6780d2e8233 100644 ---- a/deps/ada/ada.cpp -+++ b/deps/ada/ada.cpp -@@ -825,8 +825,10 @@ namespace ada::helpers { - - // Let path be url’s path. - // If url’s scheme is "file", path’s size is 1, and path[0] is a normalized Windows drive letter, then return. -- if (type == ada::scheme::type::FILE && first_delimiter == std::string_view::npos) { -- if (checkers::is_normalized_windows_drive_letter(std::string_view(path.data() + 1, first_delimiter - 1))) { -+ if (!path.empty() && type == ada::scheme::type::FILE && -+ first_delimiter == std::string_view::npos) { -+ if (checkers::is_normalized_windows_drive_letter( -+ std::string_view(path.data() + 1, path.length() - 1))) { - return; - } - } diff --git a/patches/node/fix_prevent_changing_functiontemplateinfo_after_publish.patch b/patches/node/fix_prevent_changing_functiontemplateinfo_after_publish.patch deleted file mode 100644 index ef4a5f23184fc..0000000000000 --- a/patches/node/fix_prevent_changing_functiontemplateinfo_after_publish.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Sun, 23 Oct 2022 23:36:19 +0200 -Subject: fix: prevent changing FunctionTemplateInfo after publish - -Refs https://chromium-review.googlesource.com/c/v8/v8/+/2718147 - -Fixes an issue where Node.js would try to call SetClassName on a -FunctionTemplate twice in some cases. The above CL made it so that -V8 CHECKs when this occurs. It is fixed by ensuring SetClassName -is only called once. - -This should be upstreamed. - -diff --git a/src/histogram.cc b/src/histogram.cc -index 3a3228ddc9eb6b53efc0721466479a9f62cd8967..175a67840348ca507d6e8b29835e5ab3b6d3e71a 100644 ---- a/src/histogram.cc -+++ b/src/histogram.cc -@@ -340,8 +340,9 @@ void HistogramBase::RegisterExternalReferences( - } - - void HistogramBase::Initialize(Environment* env, Local target) { -- SetConstructorFunction( -- env->context(), target, "Histogram", GetConstructorTemplate(env)); -+ SetConstructorFunction(env->context(), target, "Histogram", -+ GetConstructorTemplate(env), -+ SetConstructorFunctionFlag::NONE); - } - - BaseObjectPtr HistogramBase::HistogramTransferData::Deserialize( -@@ -367,6 +368,7 @@ Local IntervalHistogram::GetConstructorTemplate( - Isolate* isolate = env->isolate(); - tmpl = NewFunctionTemplate(isolate, nullptr); - tmpl->Inherit(HandleWrap::GetConstructorTemplate(env)); -+ tmpl->SetClassName(OneByteString(isolate, "Histogram")); - tmpl->InstanceTemplate()->SetInternalFieldCount( - HistogramBase::kInternalFieldCount); - SetProtoMethodNoSideEffect(isolate, tmpl, "count", GetCount); -diff --git a/src/node_messaging.cc b/src/node_messaging.cc -index d1296fe20c290bd137cb0aa0c077d1672c18c7a1..1c0f54286f9269efa436ba0fbc730766224891c0 100644 ---- a/src/node_messaging.cc -+++ b/src/node_messaging.cc -@@ -1495,13 +1495,16 @@ static void InitMessaging(Local target, - t->Inherit(BaseObject::GetConstructorTemplate(env)); - t->InstanceTemplate()->SetInternalFieldCount( - JSTransferable::kInternalFieldCount); -- SetConstructorFunction(context, target, "JSTransferable", t); -+ t->SetClassName(OneByteString(isolate, "JSTransferable")); -+ SetConstructorFunction(context, target, "JSTransferable", t, -+ SetConstructorFunctionFlag::NONE); - } - - SetConstructorFunction(context, - target, - env->message_port_constructor_string(), -- GetMessagePortConstructorTemplate(env)); -+ GetMessagePortConstructorTemplate(env), -+ SetConstructorFunctionFlag::NONE); - - // These are not methods on the MessagePort prototype, because - // the browser equivalents do not provide them. diff --git a/patches/node/fix_preventing_potential_oob_in_ada_no_scheme_parsing.patch b/patches/node/fix_preventing_potential_oob_in_ada_no_scheme_parsing.patch deleted file mode 100644 index 44596f96ce2ae..0000000000000 --- a/patches/node/fix_preventing_potential_oob_in_ada_no_scheme_parsing.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Tue, 18 Apr 2023 15:08:05 +0200 -Subject: fix: preventing potential oob in ada NO_SCHEME parsing - -https://github.com/ada-url/ada/pull/286 - -diff --git a/deps/ada/ada.cpp b/deps/ada/ada.cpp -index 7d2f75fe559c1878e129aa681c86d6780d2e8233..7bf541834d22511eefcc58517cc75117f53eb475 100644 ---- a/deps/ada/ada.cpp -+++ b/deps/ada/ada.cpp -@@ -2243,7 +2243,8 @@ namespace ada::parser { - ada_log("NO_SCHEME ", helpers::substring(url_data, input_position)); - // If base is null, or base has an opaque path and c is not U+0023 (#), validation error, return failure. - // SCHEME state updates the state to NO_SCHEME and validates url_data is not empty. -- if (base_url == nullptr || (base_url->has_opaque_path && url_data[input_position] != '#')) { -+ if (base_url == nullptr || -+ (base_url->has_opaque_path && !fragment.has_value())) { - ada_log("NO_SCHEME validation error"); - url.is_valid = false; - return url; diff --git a/patches/node/fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch b/patches/node/fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch index caba4ad4d5b7c..2b9cf7f55067b 100644 --- a/patches/node/fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch +++ b/patches/node/fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch @@ -10,7 +10,7 @@ if they're missing. We should upstream or otherwise handle this. diff --git a/deps/histogram/src/hdr_atomic.h b/deps/histogram/src/hdr_atomic.h -index ae1056a83612af5e370ce12fea82f334fce0c62c..9acc5c2d78d7f3d718e8b0f69e9a5e17d9609835 100644 +index 11b0cbd3facfdce648d7cf59ef3418e4e1049090..e1dfeaed6f0dd38aed5a0ddd5660d5b4ba4f46ab 100644 --- a/deps/histogram/src/hdr_atomic.h +++ b/deps/histogram/src/hdr_atomic.h @@ -14,6 +14,13 @@ diff --git a/patches/node/pass_all_globals_through_require.patch b/patches/node/pass_all_globals_through_require.patch index 8430a6fcea988..cd9ad3cd452e8 100644 --- a/patches/node/pass_all_globals_through_require.patch +++ b/patches/node/pass_all_globals_through_require.patch @@ -6,7 +6,7 @@ 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 55931329dcddb60fff0bdf681bbfad6f62fdcbb7..65e685a7cacf3f70fddf15b1068d59fa604323ea 100644 +index ebf53afd41454cd2c87050f3c086a9df7021202b..83702fbab45f57f40319a5bbd7e2c7baf217c384 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -142,6 +142,13 @@ const { 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 0bddb008be101..5d48976d26482 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 @@ -22,7 +22,7 @@ index 07c6d5e9351a96aeca1179c20287dc3fb7ec1eab..13ea68c96fd415f976aab0f291a1b7c6 // release cycle, remove the Proxy and setter and update the // getter to either return a read-only object or always return diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index 65e685a7cacf3f70fddf15b1068d59fa604323ea..9783d9235ed43c7919ed2f26e35c96ae7ff1a08b 100644 +index 83702fbab45f57f40319a5bbd7e2c7baf217c384..8ce3d78839944ddd15bed299d89aeb61a7fd53e5 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -94,7 +94,7 @@ const fs = require('fs'); diff --git a/patches/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch b/patches/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch index 5cd31707dfe61..e9e3a4ff27968 100644 --- a/patches/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch +++ b/patches/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch @@ -7,7 +7,7 @@ Subject: refactor: alter child_process.fork to use execute script with When forking a child script, we setup a special environment to make the Electron binary run like the upstream node. On Mac, we use the helper app as node binary. diff --git a/lib/child_process.js b/lib/child_process.js -index 5d3e2d63a744c20fd325e07107c50da5757c0a99..07ad7906a7be156926d0c770c3d766c1a411203b 100644 +index 59c37b97672d39a9da89ca2b78aa28a77ca78699..da553f6556a06d57d7490d74a3b4dd8f0132600c 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -137,7 +137,18 @@ function fork(modulePath, args = [], options) { diff --git a/patches/node/support_v8_sandboxed_pointers.patch b/patches/node/support_v8_sandboxed_pointers.patch index 52ee2398834c2..40da8c5a7f684 100644 --- a/patches/node/support_v8_sandboxed_pointers.patch +++ b/patches/node/support_v8_sandboxed_pointers.patch @@ -7,10 +7,10 @@ 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 89236434d4816f619b30fe30bee1046a61c598ae..53db99ed5d2d9811eef2db26021c982890cc9cbe 100644 +index 7ef6d04794c31064c70dbbb0bfc1dd7bf4d1b8fc..d5a03d5e10faaa204b3f9f290fed79be824c78b1 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc -@@ -86,6 +86,14 @@ MaybeLocal PrepareStackTraceCallback(Local context, +@@ -87,6 +87,14 @@ MaybeLocal PrepareStackTraceCallback(Local context, return result; } @@ -26,10 +26,10 @@ index 89236434d4816f619b30fe30bee1046a61c598ae..53db99ed5d2d9811eef2db26021c9828 void* ret; if (zero_fill_field_ || per_process::cli_options->zero_fill_all_buffers) diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc -index 0fe7358d3f419f6e6f00eb4cc8422e9c5cb6cb9a..1a8337412f2fe1f10df280fbf8bdefb8982b9f74 100644 +index 4d79fbb4a30a7e57a7456413685706d9af36b1b3..13e4d8b532cdb4c39fab30a8f4118ff8d2bca33c 100644 --- a/src/crypto/crypto_util.cc +++ b/src/crypto/crypto_util.cc -@@ -339,10 +339,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept { +@@ -349,10 +349,35 @@ ByteSource& ByteSource::operator=(ByteSource&& other) noexcept { return *this; } @@ -66,7 +66,7 @@ index 0fe7358d3f419f6e6f00eb4cc8422e9c5cb6cb9a..1a8337412f2fe1f10df280fbf8bdefb8 std::unique_ptr ptr = ArrayBuffer::NewBackingStore( allocated_data_, size(), -@@ -354,10 +379,11 @@ std::unique_ptr ByteSource::ReleaseToBackingStore() { +@@ -364,10 +389,11 @@ std::unique_ptr ByteSource::ReleaseToBackingStore() { data_ = nullptr; size_ = 0; return ptr; @@ -79,7 +79,7 @@ index 0fe7358d3f419f6e6f00eb4cc8422e9c5cb6cb9a..1a8337412f2fe1f10df280fbf8bdefb8 return ArrayBuffer::New(env->isolate(), std::move(store)); } -@@ -686,6 +712,16 @@ namespace { +@@ -696,6 +722,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 +96,7 @@ index 0fe7358d3f419f6e6f00eb4cc8422e9c5cb6cb9a..1a8337412f2fe1f10df280fbf8bdefb8 void SecureBuffer(const FunctionCallbackInfo& args) { CHECK(args[0]->IsUint32()); Environment* env = Environment::GetCurrent(args); -@@ -707,6 +743,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { +@@ -717,6 +753,7 @@ void SecureBuffer(const FunctionCallbackInfo& args) { Local buffer = ArrayBuffer::New(env->isolate(), store); args.GetReturnValue().Set(Uint8Array::New(buffer, 0, len)); } 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 5feaad2b9f610..829d03001e68a 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 1cbcefb9712fae45b9a0ec7ed361bfe4ec7790be..6a6b52e9ae4150e7215e3587d8ddb41ce4374780 100644 +index 913ae4b0b10a7d508d864539cf075fa9c2f9362c..985f1c0d0c0c6afc049bf1d89f91412ecf431215 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -5,6 +5,12 @@ prefix parallel @@ -24,7 +24,7 @@ index 1cbcefb9712fae45b9a0ec7ed361bfe4ec7790be..6a6b52e9ae4150e7215e3587d8ddb41c [$system==win32] # https://github.com/nodejs/node/issues/24497 diff --git a/test/sequential/sequential.status b/test/sequential/sequential.status -index 5d88747b7066ce795b091eaaec2a5653f42b2c26..c40cb8827c3e1b91f46147cead5a91a7520019b9 100644 +index 5cefcb95773bedc80bc462e058a11045be176741..33f50be5898754af696468499bcfa8e3c721434d 100644 --- a/test/sequential/sequential.status +++ b/test/sequential/sequential.status @@ -7,6 +7,18 @@ prefix sequential diff --git a/patches/node/v8_api_advance_api_deprecation.patch b/patches/node/v8_api_advance_api_deprecation.patch index 1b1ada3a92c47..92933aeca8488 100644 --- a/patches/node/v8_api_advance_api_deprecation.patch +++ b/patches/node/v8_api_advance_api_deprecation.patch @@ -8,7 +8,7 @@ Refs https://chromium-review.googlesource.com/c/v8/v8/+/3702449 This can be removed when Electron upgrades to Node.js v20. diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc -index e5307b529c88d0e4db7fd7c6bd1b032d219b8c31..f6923be7a9ccdac2396cb625b227094f2686e54b 100644 +index 4c9f7f636aeeb19a87150ac5a05e28159503f051..6f3821247f7a1b9e4615c2f21d4098114e64d798 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -219,7 +219,8 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel, diff --git a/script/node-disabled-tests.json b/script/node-disabled-tests.json index 406deb8fa6cba..8ec96fd5634d7 100644 --- a/script/node-disabled-tests.json +++ b/script/node-disabled-tests.json @@ -6,23 +6,25 @@ "parallel/test-crypto-aes-wrap", "parallel/test-crypto-authenticated-stream", "parallel/test-crypto-des3-wrap", - "parallel/test-crypto-modp1-error", "parallel/test-crypto-dh-modp2", "parallel/test-crypto-dh-modp2-views", "parallel/test-crypto-dh-stateless", "parallel/test-crypto-ecb", "parallel/test-crypto-fips", + "parallel/test-crypto-key-objects", "parallel/test-crypto-keygen", "parallel/test-crypto-keygen-deprecation", - "parallel/test-crypto-key-objects", + "parallel/test-crypto-modp1-error", "parallel/test-crypto-padding-aes256", "parallel/test-crypto-secure-heap", + "parallel/test-debugger-random-port-with-inspect-port", + "parallel/test-dgram-send-cb-quelches-error", "parallel/test-fs-utimes-y2K38", "parallel/test-http2-clean-output", "parallel/test-https-agent-session-reuse", "parallel/test-https-options-boolean-check", - "parallel/test-icu-minimum-version", "parallel/test-icu-env", + "parallel/test-icu-minimum-version", "parallel/test-inspector-port-zero-cluster", "parallel/test-inspector-tracing-domain", "parallel/test-module-loading-globalpaths", @@ -32,21 +34,23 @@ "parallel/test-repl-underscore", "parallel/test-single-executable-application", "parallel/test-snapshot-api", + "parallel/test-snapshot-argv1", "parallel/test-snapshot-basic", - "parallel/test-snapshot-console", "parallel/test-snapshot-cjs-main", + "parallel/test-snapshot-console", "parallel/test-snapshot-dns-lookup-localhost", "parallel/test-snapshot-dns-lookup-localhost-promise", "parallel/test-snapshot-dns-resolve-localhost", "parallel/test-snapshot-dns-resolve-localhost-promise", "parallel/test-snapshot-error", - "parallel/test-snapshot-incompatible", + "parallel/test-snapshot-eval", "parallel/test-snapshot-gzip", + "parallel/test-snapshot-incompatible", + "parallel/test-snapshot-namespaced-builtin", + "parallel/test-snapshot-typescript", "parallel/test-snapshot-umd", - "parallel/test-snapshot-eval", "parallel/test-snapshot-warning", "parallel/test-snapshot-weak-reference", - "parallel/test-snapshot-typescript", "parallel/test-strace-openat-openssl", "parallel/test-tls-cert-chains-concat", "parallel/test-tls-cert-chains-in-ca", @@ -129,10 +133,10 @@ "parallel/test-worker-no-atomics", "parallel/test-worker-no-sab", "parallel/test-zlib-unused-weak", - "report/test-report-fatalerror-oomerror-set", + "report/test-report-fatalerror-oomerror-compact", "report/test-report-fatalerror-oomerror-directory", "report/test-report-fatalerror-oomerror-filename", - "report/test-report-fatalerror-oomerror-compact", + "report/test-report-fatalerror-oomerror-set", "report/test-report-getreport", "report/test-report-signal", "report/test-report-uncaught-exception", From 19abd9776b0062646d7f397c7c1658306934bca9 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 9 Aug 2023 00:32:00 -0700 Subject: [PATCH 39/93] fix: avoid package.json check on built-in modules (#39418) --- ..._do_not_resolve_electron_entrypoints.patch | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/patches/node/fix_do_not_resolve_electron_entrypoints.patch b/patches/node/fix_do_not_resolve_electron_entrypoints.patch index 8d700b8fab6b3..b87b4d4a1b26d 100644 --- a/patches/node/fix_do_not_resolve_electron_entrypoints.patch +++ b/patches/node/fix_do_not_resolve_electron_entrypoints.patch @@ -6,19 +6,42 @@ 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/run_main.js b/lib/internal/modules/run_main.js -index 5a50d5d6afab6e6648f72a1c0efa1df4cd80bcd9..0be45309028b00a6957ee473322a9452a7fa7d67 100644 +index 5a50d5d6afab6e6648f72a1c0efa1df4cd80bcd9..ebc9999358ccf16689dc02322eb1aeb86355f39b 100644 --- a/lib/internal/modules/run_main.js +++ b/lib/internal/modules/run_main.js -@@ -13,6 +13,12 @@ const { +@@ -3,6 +3,7 @@ + const { + ObjectCreate, + StringPrototypeEndsWith, ++ StringPrototypeStartsWith, + } = primordials; + const CJSLoader = require('internal/modules/cjs/loader'); + const { Module, toRealPath, readPackageScope } = CJSLoader; +@@ -13,6 +14,13 @@ const { } = require('internal/modules/esm/handle_process_exit'); function resolveMainPath(main) { + // For built-in modules used as the main entry point we _never_ + // want to waste cycles resolving them to file paths on disk + // that actually might exist -+ if (typeof main === 'string' && main.startsWith('electron/js2c')) { ++ if (typeof main === 'string' && StringPrototypeStartsWith(main, 'electron/js2c')) { + return main; + } ++ // Note extension resolution for the main entry point can be deprecated in a // future major. // Module._findPath is monkey-patchable here. +@@ -28,6 +36,13 @@ function resolveMainPath(main) { + } + + function shouldUseESMLoader(mainPath) { ++ // For built-in modules used as the main entry point we _never_ ++ // want to waste cycles resolving them to file paths on disk ++ // that actually might exist ++ if (typeof mainPath === 'string' && StringPrototypeStartsWith(mainPath, 'electron/js2c')) { ++ return false; ++ } ++ + /** + * @type {string[]} userLoaders A list of custom loaders registered by the user + * (or an empty list when none have been registered). From bb9ae9709c8b49daf32a646d22bd91618496569a Mon Sep 17 00:00:00 2001 From: David Sanders Date: Wed, 9 Aug 2023 02:01:52 -0700 Subject: [PATCH 40/93] test: helper to expect deprecation warnings (#39405) --- spec/lib/deprecate-helpers.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 spec/lib/deprecate-helpers.ts diff --git a/spec/lib/deprecate-helpers.ts b/spec/lib/deprecate-helpers.ts new file mode 100644 index 0000000000000..ed59c921844d6 --- /dev/null +++ b/spec/lib/deprecate-helpers.ts @@ -0,0 +1,26 @@ +import { expect } from 'chai'; + +export async function expectDeprecationMessages (func: () => any, ...expected: string[]) { + const messages: string[] = []; + + const originalWarn = console.warn; + console.warn = (message) => { + messages.push(message); + }; + + const warningListener = (error: Error) => { + messages.push(error.message); + }; + + process.on('warning', warningListener); + + try { + return await func(); + } finally { + // process.emitWarning seems to need us to wait a tick + await new Promise(process.nextTick); + console.warn = originalWarn; + process.off('warning', warningListener); + expect(messages).to.deep.equal(expected); + } +} From 9f447d249054346e6cd50df83803e9c7413d8595 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 9 Aug 2023 14:47:19 +0200 Subject: [PATCH 41/93] feat: add support for `chrome.tabs.query` (#39330) * feat: add support for tabs.query * fix: scope to webContents in current session * test: add test for session behavior --- docs/api/extensions.md | 10 +- .../browser/api/electron_api_web_contents.cc | 10 ++ shell/browser/api/electron_api_web_contents.h | 1 + shell/browser/extensions/api/tabs/tabs_api.cc | 98 ++++++++++++ shell/browser/extensions/api/tabs/tabs_api.h | 8 + shell/common/extensions/api/tabs.json | 140 ++++++++++++++++++ spec/extensions-spec.ts | 60 ++++++++ .../extensions/tabs-api-async/background.js | 6 + .../extensions/tabs-api-async/main.js | 5 + 9 files changed, 336 insertions(+), 2 deletions(-) diff --git a/docs/api/extensions.md b/docs/api/extensions.md index 2c1539d57d73e..c9970d066c7e6 100644 --- a/docs/api/extensions.md +++ b/docs/api/extensions.md @@ -91,8 +91,9 @@ The following events of `chrome.runtime` are supported: ### `chrome.storage` -Only `chrome.storage.local` is supported; `chrome.storage.sync` and -`chrome.storage.managed` are not. +The following methods of `chrome.storage` are supported: + +- `chrome.storage.local` ### `chrome.tabs` @@ -101,6 +102,8 @@ The following methods of `chrome.tabs` are supported: - `chrome.tabs.sendMessage` - `chrome.tabs.reload` - `chrome.tabs.executeScript` +- `chrome.tabs.query` (partial support) + - supported properties: `url`, `title`, `audible`, `active`, `muted`. - `chrome.tabs.update` (partial support) - supported properties: `url`, `muted`. @@ -117,6 +120,9 @@ The following methods of `chrome.management` are supported: - `chrome.management.getSelf` - `chrome.management.getPermissionWarningsById` - `chrome.management.getPermissionWarningsByManifest` + +The following events of `chrome.management` are supported: + - `chrome.management.onEnabled` - `chrome.management.onDisabled` diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index f1f21d35e66c1..479a76a469a9a 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -4405,6 +4405,16 @@ WebContents* WebContents::FromID(int32_t id) { return GetAllWebContents().Lookup(id); } +// static +std::list WebContents::GetWebContentsList() { + std::list list; + for (auto iter = base::IDMap::iterator(&GetAllWebContents()); + !iter.IsAtEnd(); iter.Advance()) { + list.push_back(iter.GetCurrentValue()); + } + return list; +} + // static gin::WrapperInfo WebContents::kWrapperInfo = {gin::kEmbedderNativeGin}; diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 9273cdf95ad6f..fee6f4422458c 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -134,6 +134,7 @@ class WebContents : public ExclusiveAccessContext, // if there is no associated wrapper. static WebContents* From(content::WebContents* web_contents); static WebContents* FromID(int32_t id); + static std::list GetWebContentsList(); // Get the V8 wrapper of the |web_contents|, or create one if not existed. // diff --git a/shell/browser/extensions/api/tabs/tabs_api.cc b/shell/browser/extensions/api/tabs/tabs_api.cc index cde0d41b28cfb..79f595121b6fd 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.cc +++ b/shell/browser/extensions/api/tabs/tabs_api.cc @@ -7,6 +7,7 @@ #include #include +#include "base/strings/pattern.h" #include "chrome/common/url_constants.h" #include "components/url_formatter/url_fixer.h" #include "content/public/browser/navigation_entry.h" @@ -16,7 +17,9 @@ #include "extensions/common/mojom/host_id.mojom.h" #include "extensions/common/permissions/permissions_data.h" #include "shell/browser/api/electron_api_web_contents.h" +#include "shell/browser/native_window.h" #include "shell/browser/web_contents_zoom_controller.h" +#include "shell/browser/window_list.h" #include "shell/common/extensions/api/tabs.h" #include "third_party/blink/public/common/page/page_zoom.h" #include "url/gurl.h" @@ -58,6 +61,13 @@ void ZoomModeToZoomSettings(WebContentsZoomController::ZoomMode zoom_mode, } } +// Returns true if either |boolean| is disengaged, or if |boolean| and +// |value| are equal. This function is used to check if a tab's parameters match +// those of the browser. +bool MatchesBool(const absl::optional& boolean, bool value) { + return !boolean || *boolean == value; +} + api::tabs::MutedInfo CreateMutedInfo(content::WebContents* contents) { DCHECK(contents); api::tabs::MutedInfo info; @@ -65,6 +75,7 @@ api::tabs::MutedInfo CreateMutedInfo(content::WebContents* contents) { info.reason = api::tabs::MUTED_INFO_REASON_USER; return info; } + } // namespace ExecuteCodeInTabFunction::ExecuteCodeInTabFunction() : execute_tab_id_(-1) {} @@ -214,6 +225,93 @@ ExtensionFunction::ResponseAction TabsReloadFunction::Run() { return RespondNow(NoArguments()); } +ExtensionFunction::ResponseAction TabsQueryFunction::Run() { + absl::optional params = + tabs::Query::Params::Create(args()); + EXTENSION_FUNCTION_VALIDATE(params); + + URLPatternSet url_patterns; + if (params->query_info.url) { + std::vector url_pattern_strings; + if (params->query_info.url->as_string) + url_pattern_strings.push_back(*params->query_info.url->as_string); + else if (params->query_info.url->as_strings) + url_pattern_strings.swap(*params->query_info.url->as_strings); + // It is o.k. to use URLPattern::SCHEME_ALL here because this function does + // not grant access to the content of the tabs, only to seeing their URLs + // and meta data. + std::string error; + if (!url_patterns.Populate(url_pattern_strings, URLPattern::SCHEME_ALL, + true, &error)) { + return RespondNow(Error(std::move(error))); + } + } + + std::string title = params->query_info.title.value_or(std::string()); + absl::optional audible = params->query_info.audible; + absl::optional muted = params->query_info.muted; + + base::Value::List result; + + // Filter out webContents that don't belong to the current browser context. + auto* bc = browser_context(); + auto all_contents = electron::api::WebContents::GetWebContentsList(); + all_contents.remove_if([&bc](electron::api::WebContents* wc) { + return (bc != wc->web_contents()->GetBrowserContext()); + }); + + for (auto* contents : all_contents) { + if (!contents || !contents->web_contents()) + continue; + + auto* wc = contents->web_contents(); + + // Match webContents audible value. + if (!MatchesBool(audible, wc->IsCurrentlyAudible())) + continue; + + // Match webContents muted value. + if (!MatchesBool(muted, wc->IsAudioMuted())) + continue; + + // Match webContents active status. + if (!MatchesBool(params->query_info.active, contents->IsFocused())) + continue; + + if (!title.empty() || !url_patterns.is_empty()) { + // "title" and "url" properties are considered privileged data and can + // only be checked if the extension has the "tabs" permission or it has + // access to the WebContents's origin. Otherwise, this tab is considered + // not matched. + if (!extension()->permissions_data()->HasAPIPermissionForTab( + contents->ID(), mojom::APIPermissionID::kTab) && + !extension()->permissions_data()->HasHostPermission(wc->GetURL())) { + continue; + } + + // Match webContents title. + if (!title.empty() && + !base::MatchPattern(wc->GetTitle(), base::UTF8ToUTF16(title))) + continue; + + // Match webContents url. + if (!url_patterns.is_empty() && !url_patterns.MatchesURL(wc->GetURL())) + continue; + } + + tabs::Tab tab; + tab.id = contents->ID(); + tab.url = wc->GetLastCommittedURL().spec(); + tab.active = contents->IsFocused(); + tab.audible = contents->IsCurrentlyAudible(); + tab.muted_info = CreateMutedInfo(wc); + + result.Append(tab.ToValue()); + } + + return RespondNow(WithArguments(std::move(result))); +} + ExtensionFunction::ResponseAction TabsGetFunction::Run() { absl::optional params = tabs::Get::Params::Create(args()); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/shell/browser/extensions/api/tabs/tabs_api.h b/shell/browser/extensions/api/tabs/tabs_api.h index fd6c94f2c9f76..1c18dae41f990 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.h +++ b/shell/browser/extensions/api/tabs/tabs_api.h @@ -55,6 +55,14 @@ class TabsReloadFunction : public ExtensionFunction { DECLARE_EXTENSION_FUNCTION("tabs.reload", TABS_RELOAD) }; +class TabsQueryFunction : public ExtensionFunction { + ~TabsQueryFunction() override {} + + ResponseAction Run() override; + + DECLARE_EXTENSION_FUNCTION("tabs.query", TABS_QUERY) +}; + class TabsGetFunction : public ExtensionFunction { ~TabsGetFunction() override {} diff --git a/shell/common/extensions/api/tabs.json b/shell/common/extensions/api/tabs.json index c39e67a88c733..53a835f6cb585 100644 --- a/shell/common/extensions/api/tabs.json +++ b/shell/common/extensions/api/tabs.json @@ -3,6 +3,16 @@ "namespace": "tabs", "description": "Use the chrome.tabs API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.", "types": [ + { + "id": "TabStatus", + "type": "string", + "enum": [ + "unloaded", + "loading", + "complete" + ], + "description": "The tab's loading status." + }, { "id": "MutedInfoReason", "type": "string", @@ -210,6 +220,18 @@ "description": "Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings." } } + }, + { + "id": "WindowType", + "type": "string", + "enum": [ + "normal", + "popup", + "panel", + "app", + "devtools" + ], + "description": "The type of window." } ], "functions": [ @@ -489,6 +511,124 @@ ] } }, + { + "name": "query", + "type": "function", + "description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.", + "parameters": [ + { + "type": "object", + "name": "queryInfo", + "properties": { + "active": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are active in their windows." + }, + "pinned": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are pinned." + }, + "audible": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are audible." + }, + "muted": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are muted." + }, + "highlighted": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are highlighted." + }, + "discarded": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content is reloaded the next time it is activated." + }, + "autoDiscardable": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs can be discarded automatically by the browser when resources are low." + }, + "currentWindow": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are in the current window." + }, + "lastFocusedWindow": { + "type": "boolean", + "optional": true, + "description": "Whether the tabs are in the last focused window." + }, + "status": { + "$ref": "TabStatus", + "optional": true, + "description": "The tab loading status." + }, + "title": { + "type": "string", + "optional": true, + "description": "Match page titles against a pattern. This property is ignored if the extension does not have the \"tabs\" permission." + }, + "url": { + "choices": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "optional": true, + "description": "Match tabs against one or more URL patterns. Fragment identifiers are not matched. This property is ignored if the extension does not have the \"tabs\" permission." + }, + "groupId": { + "type": "integer", + "optional": true, + "minimum": -1, + "description": "The ID of the group that the tabs are in, or $(ref:tabGroups.TAB_GROUP_ID_NONE) for ungrouped tabs." + }, + "windowId": { + "type": "integer", + "optional": true, + "minimum": -2, + "description": "The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the current window." + }, + "windowType": { + "$ref": "WindowType", + "optional": true, + "description": "The type of window the tabs are in." + }, + "index": { + "type": "integer", + "optional": true, + "minimum": 0, + "description": "The position of the tabs within their windows." + } + } + } + ], + "returns_async": { + "name": "callback", + "parameters": [ + { + "name": "result", + "type": "array", + "items": { + "$ref": "Tab" + } + } + ] + } + }, { "name": "update", "type": "function", diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index c55964c990d83..03da89c715839 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -967,6 +967,66 @@ describe('chrome extensions', () => { reason: 'user' }); }); + + describe('query', () => { + it('can query for a tab with specific properties', async () => { + await w.loadURL(url); + + expect(w.webContents.isAudioMuted()).to.be.false('muted'); + w.webContents.setAudioMuted(true); + expect(w.webContents.isAudioMuted()).to.be.true('not muted'); + + const message = { method: 'query', args: [{ muted: true }] }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [, , responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + expect(response).to.have.lengthOf(1); + + const tab = response[0]; + expect(tab.mutedInfo).to.deep.equal({ + muted: true, + reason: 'user' + }); + }); + + it('only returns tabs in the same session', async () => { + await w.loadURL(url); + w.webContents.setAudioMuted(true); + + const sameSessionWin = new BrowserWindow({ + show: false, + webPreferences: { + session: customSession + } + }); + + sameSessionWin.webContents.setAudioMuted(true); + + const newSession = session.fromPartition(`persist:${uuid.v4()}`); + const differentSessionWin = new BrowserWindow({ + show: false, + webPreferences: { + session: newSession + } + }); + + differentSessionWin.webContents.setAudioMuted(true); + + const message = { method: 'query', args: [{ muted: true }] }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + + const [, , responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + expect(response).to.have.lengthOf(2); + for (const tab of response) { + expect(tab.mutedInfo).to.deep.equal({ + muted: true, + reason: 'user' + }); + } + }); + }); }); }); }); diff --git a/spec/fixtures/extensions/tabs-api-async/background.js b/spec/fixtures/extensions/tabs-api-async/background.js index 2e3eb8ebf5cd0..9133bd4fb6f25 100644 --- a/spec/fixtures/extensions/tabs-api-async/background.js +++ b/spec/fixtures/extensions/tabs-api-async/background.js @@ -38,6 +38,12 @@ const handleRequest = (request, sender, sendResponse) => { break; } + case 'query': { + const [params] = args; + chrome.tabs.query(params).then(sendResponse); + break; + } + case 'reload': { chrome.tabs.reload(tabId).then(() => { sendResponse({ status: 'reloaded' }); diff --git a/spec/fixtures/extensions/tabs-api-async/main.js b/spec/fixtures/extensions/tabs-api-async/main.js index 4360681115ab2..91030070bc018 100644 --- a/spec/fixtures/extensions/tabs-api-async/main.js +++ b/spec/fixtures/extensions/tabs-api-async/main.js @@ -15,6 +15,11 @@ const testMap = { console.log(JSON.stringify(response)); }); }, + query (params) { + chrome.runtime.sendMessage({ method: 'query', args: [params] }, response => { + console.log(JSON.stringify(response)); + }); + }, getZoom () { chrome.runtime.sendMessage({ method: 'getZoom', args: [] }, response => { console.log(JSON.stringify(response)); From a9ea2b49872d7ba7e7a6607fba7c6701940ec829 Mon Sep 17 00:00:00 2001 From: Tomasz <30628471+TomaszMa@users.noreply.github.com> Date: Wed, 9 Aug 2023 16:06:39 +0200 Subject: [PATCH 42/93] fix: promise resolved to early when browser initiated in-page navigation (#39260) --- lib/browser/api/web-contents.ts | 11 +++++++++-- spec/api-web-contents-spec.ts | 10 ++++++++++ spec/fixtures/pages/navigate_in_page_and_wait.html | 13 +++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 spec/fixtures/pages/navigate_in_page_and_wait.html diff --git a/lib/browser/api/web-contents.ts b/lib/browser/api/web-contents.ts index 8f0f53aa2ba74..0c1cb11d9e5fe 100644 --- a/lib/browser/api/web-contents.ts +++ b/lib/browser/api/web-contents.ts @@ -446,6 +446,7 @@ WebContents.prototype.loadURL = function (url, options) { }; let navigationStarted = false; + let browserInitiatedInPageNavigation = false; const navigationListener = (event: Electron.Event, url: string, isSameDocument: boolean, isMainFrame: boolean) => { if (isMainFrame) { if (navigationStarted && !isSameDocument) { @@ -460,6 +461,7 @@ WebContents.prototype.loadURL = function (url, options) { // as the routing does not leave the document return rejectAndCleanup(-3, 'ERR_ABORTED', url); } + browserInitiatedInPageNavigation = navigationStarted && isSameDocument; navigationStarted = true; } }; @@ -474,17 +476,22 @@ WebContents.prototype.loadURL = function (url, options) { // would be more appropriate. rejectAndCleanup(-2, 'ERR_FAILED', url); }; + const finishListenerWhenUserInitiatedNavigation = () => { + if (!browserInitiatedInPageNavigation) { + finishListener(); + } + }; const removeListeners = () => { this.removeListener('did-finish-load', finishListener); this.removeListener('did-fail-load', failListener); - this.removeListener('did-navigate-in-page', finishListener); + this.removeListener('did-navigate-in-page', finishListenerWhenUserInitiatedNavigation); this.removeListener('did-start-navigation', navigationListener); this.removeListener('did-stop-loading', stopLoadingListener); this.removeListener('destroyed', stopLoadingListener); }; this.on('did-finish-load', finishListener); this.on('did-fail-load', failListener); - this.on('did-navigate-in-page', finishListener); + this.on('did-navigate-in-page', finishListenerWhenUserInitiatedNavigation); this.on('did-start-navigation', navigationListener); this.on('did-stop-loading', stopLoadingListener); this.on('destroyed', stopLoadingListener); diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index aeb2a11349882..0be6172bb90b9 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -375,6 +375,16 @@ describe('webContents module', () => { await expect(w.loadURL(w.getURL() + '#foo')).to.eventually.be.fulfilled(); }); + it('resolves after browser initiated navigation', async () => { + let finishedLoading = false; + w.webContents.on('did-finish-load', function () { + finishedLoading = true; + }); + + await w.loadFile(path.join(fixturesPath, 'pages', 'navigate_in_page_and_wait.html')); + expect(finishedLoading).to.be.true(); + }); + it('rejects when failing to load a file URL', async () => { await expect(w.loadURL('file:non-existent')).to.eventually.be.rejected() .and.have.property('code', 'ERR_FILE_NOT_FOUND'); diff --git a/spec/fixtures/pages/navigate_in_page_and_wait.html b/spec/fixtures/pages/navigate_in_page_and_wait.html new file mode 100644 index 0000000000000..40b12b738522d --- /dev/null +++ b/spec/fixtures/pages/navigate_in_page_and_wait.html @@ -0,0 +1,13 @@ + +
+ +
+ + + From ace8aff1cb317f9347b75ad9db0b6a797eec78c9 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 9 Aug 2023 16:38:13 +0200 Subject: [PATCH 43/93] chore: update `_api_features` manifest requirements (#39412) chore: update api_resources manifest requirements --- shell/common/extensions/api/_api_features.json | 12 +++++++++++- shell/common/extensions/api/resources_private.idl | 8 ++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/shell/common/extensions/api/_api_features.json b/shell/common/extensions/api/_api_features.json index 2ee99309a6faf..11f019b57a9bc 100644 --- a/shell/common/extensions/api/_api_features.json +++ b/shell/common/extensions/api/_api_features.json @@ -4,6 +4,15 @@ "extension_types": ["extension"], "contexts": ["blessed_extension"] }, + "tabs.executeScript": { + "max_manifest_version": 2 + }, + "tabs.insertCSS": { + "max_manifest_version": 2 + }, + "tabs.removeCSS": { + "max_manifest_version": 2 + }, "extension": { "channel": "stable", "extension_types": ["extension"], @@ -14,7 +23,8 @@ "disallow_for_service_workers": true }, "extension.getURL": { - "contexts": ["blessed_extension", "unblessed_extension", "content_script"] + "contexts": ["blessed_extension", "unblessed_extension", "content_script"], + "max_manifest_version": 2 }, "i18n": { "channel": "stable", diff --git a/shell/common/extensions/api/resources_private.idl b/shell/common/extensions/api/resources_private.idl index 836b366d0e6b2..31a85ce5c1485 100644 --- a/shell/common/extensions/api/resources_private.idl +++ b/shell/common/extensions/api/resources_private.idl @@ -1,4 +1,4 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. +// Copyright 2015 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -15,9 +15,9 @@ namespace resourcesPrivate { // chrome/browser/extensions/api/resources_private/resources_private_api.cc // for instructions on adding a new component to this API. // - // |component| : Internal chrome component to get strings for. + // |component| : Internal Chrome component to get strings for. // |callback| : Called with a dictionary mapping names to strings. - static void getStrings(Component component, - GetStringsCallback callback); + [supportsPromises] static void getStrings(Component component, + GetStringsCallback callback); }; }; From 843b2b2aa3c9c7bea491d19976654091ea889997 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 9 Aug 2023 16:38:48 +0200 Subject: [PATCH 44/93] chore: deprecate `senderId` and `senderIsMainFrame` (#39381) --- docs/api/structures/ipc-renderer-event.md | 4 ++-- docs/breaking-changes.md | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/api/structures/ipc-renderer-event.md b/docs/api/structures/ipc-renderer-event.md index 8c4fe1bceea7d..4e8b32f47c781 100644 --- a/docs/api/structures/ipc-renderer-event.md +++ b/docs/api/structures/ipc-renderer-event.md @@ -1,8 +1,8 @@ # IpcRendererEvent Object extends `Event` * `sender` [IpcRenderer](../ipc-renderer.md) - The `IpcRenderer` instance that emitted the event originally -* `senderId` Integer - The `webContents.id` that sent the message, you can call `event.sender.sendTo(event.senderId, ...)` to reply to the message, see [ipcRenderer.sendTo][ipc-renderer-sendto] for more information. This only applies to messages sent from a different renderer. Messages sent directly from the main process set `event.senderId` to `0`. -* `senderIsMainFrame` boolean (optional) - Whether the message sent via [ipcRenderer.sendTo][ipc-renderer-sendto] was sent by the main frame. This is relevant when `nodeIntegrationInSubFrames` is enabled in the originating `webContents`. +* `senderId` Integer _Deprecated_ - The `webContents.id` that sent the message, you can call `event.sender.sendTo(event.senderId, ...)` to reply to the message, see [ipcRenderer.sendTo][ipc-renderer-sendto] for more information. This only applies to messages sent from a different renderer. Messages sent directly from the main process set `event.senderId` to `0`. +* `senderIsMainFrame` boolean (optional) _Deprecated_ - Whether the message sent via [ipcRenderer.sendTo][ipc-renderer-sendto] was sent by the main frame. This is relevant when `nodeIntegrationInSubFrames` is enabled in the originating `webContents`. * `ports` [MessagePort][][] - A list of MessagePorts that were transferred with this message [ipc-renderer-sendto]: ../ipc-renderer.md#ipcrenderersendtowebcontentsid-channel-args-deprecated diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index a0ed15a13acbe..4b473c158f0d4 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -25,6 +25,8 @@ or later will be required to run Electron v27.0.0 and higher. The `ipcRenderer.sendTo()` API has been deprecated. It should be replaced by setting up a [`MessageChannel`](tutorial/message-ports.md#setting-up-a-messagechannel-between-two-renderers) between the renderers. +The `senderId` and `senderIsMainFrame` properties of `IpcRendererEvent` have been deprecated as well. + ## Planned Breaking API Changes (25.0) ### Deprecated: `protocol.{register,intercept}{Buffer,String,Stream,File,Http}Protocol` From 2f080cde7a4106b3a45cc71593f56bd32c967667 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 10 Aug 2023 10:52:52 +0200 Subject: [PATCH 45/93] docs: remove duplicate fiddles (#39419) --- .../basic-notification/index.html | 22 ---------------- .../notifications/basic-notification/main.js | 26 ------------------- .../basic-notification/renderer.js | 14 ---------- .../notification-with-image/index.html | 22 ---------------- .../notification-with-image/main.js | 26 ------------------- .../notification-with-image/renderer.js | 14 ---------- .../create-frameless-window/index.html | 26 ------------------- .../create-frameless-window/main.js | 23 ---------------- .../create-frameless-window/renderer.js | 8 ------ 9 files changed, 181 deletions(-) delete mode 100644 docs/fiddles/native-ui/notifications/basic-notification/index.html delete mode 100644 docs/fiddles/native-ui/notifications/basic-notification/main.js delete mode 100644 docs/fiddles/native-ui/notifications/basic-notification/renderer.js delete mode 100644 docs/fiddles/native-ui/notifications/notification-with-image/index.html delete mode 100644 docs/fiddles/native-ui/notifications/notification-with-image/main.js delete mode 100644 docs/fiddles/native-ui/notifications/notification-with-image/renderer.js delete mode 100644 docs/fiddles/windows/manage-windows/create-frameless-window/index.html delete mode 100644 docs/fiddles/windows/manage-windows/create-frameless-window/main.js delete mode 100644 docs/fiddles/windows/manage-windows/create-frameless-window/renderer.js diff --git a/docs/fiddles/native-ui/notifications/basic-notification/index.html b/docs/fiddles/native-ui/notifications/basic-notification/index.html deleted file mode 100644 index e4a440c0eb996..0000000000000 --- a/docs/fiddles/native-ui/notifications/basic-notification/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -
-

Basic notification

- Supports: Win 7+, macOS, Linux (that supports libnotify)| Process: Renderer -
-
- -
-

This demo demonstrates a basic notification. Text only.

-
-
- - - diff --git a/docs/fiddles/native-ui/notifications/basic-notification/main.js b/docs/fiddles/native-ui/notifications/basic-notification/main.js deleted file mode 100644 index 501299afb7107..0000000000000 --- a/docs/fiddles/native-ui/notifications/basic-notification/main.js +++ /dev/null @@ -1,26 +0,0 @@ -const { BrowserWindow, app } = require('electron') - -let mainWindow = null - -function createWindow () { - const windowOptions = { - width: 600, - height: 300, - title: 'Basic Notification', - webPreferences: { - contextIsolation: false, - nodeIntegration: true - } - } - - mainWindow = new BrowserWindow(windowOptions) - mainWindow.loadFile('index.html') - - mainWindow.on('closed', () => { - mainWindow = null - }) -} - -app.whenReady().then(() => { - createWindow() -}) diff --git a/docs/fiddles/native-ui/notifications/basic-notification/renderer.js b/docs/fiddles/native-ui/notifications/basic-notification/renderer.js deleted file mode 100644 index a46583c683dea..0000000000000 --- a/docs/fiddles/native-ui/notifications/basic-notification/renderer.js +++ /dev/null @@ -1,14 +0,0 @@ -const notification = { - title: 'Basic Notification', - body: 'Short message part' -} - -const notificationButton = document.getElementById('basic-noti') - -notificationButton.addEventListener('click', () => { - const myNotification = new window.Notification(notification.title, notification) - - myNotification.onclick = () => { - console.log('Notification clicked') - } -}) diff --git a/docs/fiddles/native-ui/notifications/notification-with-image/index.html b/docs/fiddles/native-ui/notifications/notification-with-image/index.html deleted file mode 100644 index 5b9df4e78ecb5..0000000000000 --- a/docs/fiddles/native-ui/notifications/notification-with-image/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -
-

Notification with image

- Supports: Win 7+, macOS, Linux (that supports libnotify)| Process: Renderer -
-
- -
-

This demo demonstrates an advanced notification. Both text and image.

-
-
- - - diff --git a/docs/fiddles/native-ui/notifications/notification-with-image/main.js b/docs/fiddles/native-ui/notifications/notification-with-image/main.js deleted file mode 100644 index 1b2de53aeb468..0000000000000 --- a/docs/fiddles/native-ui/notifications/notification-with-image/main.js +++ /dev/null @@ -1,26 +0,0 @@ -const { BrowserWindow, app } = require('electron') - -let mainWindow = null - -function createWindow () { - const windowOptions = { - width: 600, - height: 300, - title: 'Advanced Notification', - webPreferences: { - contextIsolation: false, - nodeIntegration: true - } - } - - mainWindow = new BrowserWindow(windowOptions) - mainWindow.loadFile('index.html') - - mainWindow.on('closed', () => { - mainWindow = null - }) -} - -app.whenReady().then(() => { - createWindow() -}) diff --git a/docs/fiddles/native-ui/notifications/notification-with-image/renderer.js b/docs/fiddles/native-ui/notifications/notification-with-image/renderer.js deleted file mode 100644 index 84c43d2e111be..0000000000000 --- a/docs/fiddles/native-ui/notifications/notification-with-image/renderer.js +++ /dev/null @@ -1,14 +0,0 @@ -const notification = { - title: 'Notification with image', - body: 'Short message plus a custom image', - icon: 'https://raw.githubusercontent.com/electron/electron-api-demos/v2.0.2/assets/img/programming.png' -} -const notificationButton = document.getElementById('advanced-noti') - -notificationButton.addEventListener('click', () => { - const myNotification = new window.Notification(notification.title, notification) - - myNotification.onclick = () => { - console.log('Notification clicked') - } -}) diff --git a/docs/fiddles/windows/manage-windows/create-frameless-window/index.html b/docs/fiddles/windows/manage-windows/create-frameless-window/index.html deleted file mode 100644 index f4fd84e3428e7..0000000000000 --- a/docs/fiddles/windows/manage-windows/create-frameless-window/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - -
-
-

Create a frameless window

- Supports: Win, macOS, Linux | Process: Main -
-

A frameless window is a window that has no "chrome", - such as toolbars, title bars, status bars, borders, etc. You can make - a browser window frameless by setting - frame to false when creating the window.

-
- -
-
-
-
- - - diff --git a/docs/fiddles/windows/manage-windows/create-frameless-window/main.js b/docs/fiddles/windows/manage-windows/create-frameless-window/main.js deleted file mode 100644 index c5685f97d3bf1..0000000000000 --- a/docs/fiddles/windows/manage-windows/create-frameless-window/main.js +++ /dev/null @@ -1,23 +0,0 @@ -const { app, BrowserWindow, ipcMain } = require('electron') - -ipcMain.on('create-frameless-window', (event, { url }) => { - const win = new BrowserWindow({ frame: false }) - win.loadURL(url) -}) - -function createWindow () { - const mainWindow = new BrowserWindow({ - width: 600, - height: 400, - title: 'Create a frameless window', - webPreferences: { - contextIsolation: false, - nodeIntegration: true - } - }) - mainWindow.loadFile('index.html') -} - -app.whenReady().then(() => { - createWindow() -}) diff --git a/docs/fiddles/windows/manage-windows/create-frameless-window/renderer.js b/docs/fiddles/windows/manage-windows/create-frameless-window/renderer.js deleted file mode 100644 index 21f91ad561b37..0000000000000 --- a/docs/fiddles/windows/manage-windows/create-frameless-window/renderer.js +++ /dev/null @@ -1,8 +0,0 @@ -const { ipcRenderer } = require('electron') - -const newWindowBtn = document.getElementById('frameless-window') - -newWindowBtn.addEventListener('click', () => { - const url = 'data:text/html,

Hello World!

Close this Window' - ipcRenderer.send('create-frameless-window', { url }) -}) From f8fd0a6643cc810110e2bcaed454e70e019cb731 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 10 Aug 2023 10:53:23 +0200 Subject: [PATCH 46/93] docs: fix take-screenshot fiddle to use desktopCapturer in main.js (#39420) --- .../media/screenshot/take-screenshot/main.js | 6 +++- .../screenshot/take-screenshot/renderer.js | 31 ++++++++----------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/docs/fiddles/media/screenshot/take-screenshot/main.js b/docs/fiddles/media/screenshot/take-screenshot/main.js index 5754ff62a89eb..cb09498a0d44a 100644 --- a/docs/fiddles/media/screenshot/take-screenshot/main.js +++ b/docs/fiddles/media/screenshot/take-screenshot/main.js @@ -1,4 +1,4 @@ -const { BrowserWindow, app, screen, ipcMain } = require('electron') +const { BrowserWindow, app, screen, ipcMain, desktopCapturer } = require('electron') let mainWindow = null @@ -6,6 +6,10 @@ ipcMain.handle('get-screen-size', () => { return screen.getPrimaryDisplay().workAreaSize }) +ipcMain.handle('get-sources', (event, options) => { + return desktopCapturer.getSources(options) +}) + function createWindow () { const windowOptions = { width: 600, diff --git a/docs/fiddles/media/screenshot/take-screenshot/renderer.js b/docs/fiddles/media/screenshot/take-screenshot/renderer.js index ab07d1ceaca0d..fd615325b8f3b 100644 --- a/docs/fiddles/media/screenshot/take-screenshot/renderer.js +++ b/docs/fiddles/media/screenshot/take-screenshot/renderer.js @@ -1,6 +1,6 @@ -const { desktopCapturer, shell, ipcRenderer } = require('electron') +const { shell, ipcRenderer } = require('electron') -const fs = require('node:fs') +const fs = require('node:fs').promises const os = require('node:os') const path = require('node:path') @@ -12,24 +12,19 @@ screenshot.addEventListener('click', async (event) => { const thumbSize = await determineScreenShotSize() const options = { types: ['screen'], thumbnailSize: thumbSize } - desktopCapturer.getSources(options, (error, sources) => { - if (error) return console.log(error) + const sources = await ipcRenderer.invoke('get-sources', options) + for (const source of sources) { + const sourceName = source.name.toLowerCase() + if (sourceName === 'entire screen' || sourceName === 'screen 1') { + const screenshotPath = path.join(os.tmpdir(), 'screenshot.png') - sources.forEach((source) => { - const sourceName = source.name.toLowerCase() - if (sourceName === 'entire screen' || sourceName === 'screen 1') { - const screenshotPath = path.join(os.tmpdir(), 'screenshot.png') + await fs.writeFile(screenshotPath, source.thumbnail.toPNG()) + shell.openExternal(`file://${screenshotPath}`) - fs.writeFile(screenshotPath, source.thumbnail.toPNG(), (error) => { - if (error) return console.log(error) - shell.openExternal(`file://${screenshotPath}`) - - const message = `Saved screenshot to: ${screenshotPath}` - screenshotMsg.textContent = message - }) - } - }) - }) + const message = `Saved screenshot to: ${screenshotPath}` + screenshotMsg.textContent = message + } + } }) async function determineScreenShotSize () { From e72af899d9df1284746c3d13ae28b6b58d33572b Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 10 Aug 2023 02:50:30 -0700 Subject: [PATCH 47/93] chore: document deprecated webContents.getPrinters API (#39356) * chore: document deprecated webContents.getPrinters API * chore: remove duplicate deprecation warning --- docs/breaking-changes.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 4b473c158f0d4..a0cbfc2e76c4c 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -27,6 +27,24 @@ The `ipcRenderer.sendTo()` API has been deprecated. It should be replaced by set The `senderId` and `senderIsMainFrame` properties of `IpcRendererEvent` have been deprecated as well. +## Planned Breaking API Changes (26.0) + +### Deprecated: `webContents.getPrinters` + +The `webContents.getPrinters` method has been deprecated. Use +`webContents.getPrintersAsync` instead. + +```js +const w = new BrowserWindow({ show: false }) + +// Deprecated +console.log(w.webContents.getPrinters()) +// Replace with +w.webContents.getPrintersAsync().then((printers) => { + console.log(printers) +}) +``` + ## Planned Breaking API Changes (25.0) ### Deprecated: `protocol.{register,intercept}{Buffer,String,Stream,File,Http}Protocol` From e92e322fa813fb99f21709dab7f16c457b02c955 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 10 Aug 2023 11:55:52 +0200 Subject: [PATCH 48/93] docs: update external links (#39421) --- docs/api/cookies.md | 4 ++-- docs/api/session.md | 2 +- docs/api/web-contents.md | 8 ++++---- docs/api/webview-tag.md | 6 +++--- docs/development/build-instructions-windows.md | 4 ++-- docs/development/debugging-on-windows.md | 2 +- docs/development/issues.md | 2 +- docs/fiddles/menus/customize-menus/index.html | 10 +++++----- docs/fiddles/menus/shortcuts/index.html | 12 ++++++------ .../native-ui/dialogs/error-dialog/index.html | 2 +- .../native-ui/dialogs/information-dialog/index.html | 2 +- .../dialogs/open-file-or-directory/index.html | 2 +- .../fiddles/native-ui/dialogs/save-dialog/index.html | 2 +- docs/fiddles/native-ui/drag-and-drop/index.html | 2 +- .../native-ui/external-links-file-manager/index.html | 2 +- docs/fiddles/native-ui/notifications/index.html | 2 +- docs/fiddles/native-ui/tray/index.html | 4 ++-- docs/fiddles/screen/fit-screen/main.js | 2 +- .../launch-app-from-URL-in-another-app/index.html | 2 +- .../app-information/index.html | 2 +- .../get-version-information/index.html | 2 +- .../manage-windows/frameless-window/index.html | 4 ++-- .../manage-windows/manage-window-state/index.html | 4 ++-- .../windows/manage-windows/new-window/renderer.js | 2 +- .../windows/manage-windows/window-events/index.html | 2 +- docs/tutorial/automated-testing.md | 2 +- docs/tutorial/electron-timelines.md | 2 +- docs/tutorial/introduction.md | 2 +- docs/tutorial/tutorial-6-publishing-updating.md | 2 +- docs/tutorial/windows-store-guide.md | 6 +++--- 30 files changed, 51 insertions(+), 51 deletions(-) diff --git a/docs/api/cookies.md b/docs/api/cookies.md index 0c733266c9a55..41e448b713b83 100644 --- a/docs/api/cookies.md +++ b/docs/api/cookies.md @@ -22,7 +22,7 @@ session.defaultSession.cookies.get({}) }) // Query all cookies associated with a specific url. -session.defaultSession.cookies.get({ url: 'http://www.github.com' }) +session.defaultSession.cookies.get({ url: 'https://www.github.com' }) .then((cookies) => { console.log(cookies) }).catch((error) => { @@ -31,7 +31,7 @@ session.defaultSession.cookies.get({ url: 'http://www.github.com' }) // Set a cookie with the given cookie data; // may overwrite equivalent cookies if they exist. -const cookie = { url: 'http://www.github.com', name: 'dummy_name', value: 'dummy' } +const cookie = { url: 'https://www.github.com', name: 'dummy_name', value: 'dummy' } session.defaultSession.cookies.set(cookie) .then(() => { // success diff --git a/docs/api/session.md b/docs/api/session.md index 7be9461b10a40..d157e3464a81b 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -13,7 +13,7 @@ property of [`WebContents`](web-contents.md), or from the `session` module. const { BrowserWindow } = require('electron') const win = new BrowserWindow({ width: 800, height: 600 }) -win.loadURL('http://github.com') +win.loadURL('https://github.com') const ses = win.webContents.session console.log(ses.getUserAgent()) diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 0b4cdfe4a0cd3..3e1770d91f556 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -13,7 +13,7 @@ the [`BrowserWindow`](browser-window.md) object. An example of accessing the const { BrowserWindow } = require('electron') const win = new BrowserWindow({ width: 800, height: 1500 }) -win.loadURL('http://github.com') +win.loadURL('https://github.com') const contents = win.webContents console.log(contents) @@ -895,7 +895,7 @@ const win = new BrowserWindow({ webPreferences: { offscreen: true } }) win.webContents.on('paint', (event, dirty, image) => { // updateBitmap(dirty, image.getBitmap()) }) -win.loadURL('http://github.com') +win.loadURL('https://github.com') ``` #### Event: 'devtools-reload-page' @@ -1071,7 +1071,7 @@ Returns `string` - The URL of the current web page. ```javascript const { BrowserWindow } = require('electron') const win = new BrowserWindow({ width: 800, height: 600 }) -win.loadURL('http://github.com').then(() => { +win.loadURL('https://github.com').then(() => { const currentURL = win.webContents.getURL() console.log(currentURL) }) @@ -1651,7 +1651,7 @@ const path = require('path') const os = require('os') const win = new BrowserWindow() -win.loadURL('http://github.com') +win.loadURL('https://github.com') win.webContents.on('did-finish-load', () => { // Use default printing options diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index 322a5b6d39348..60927b5ce3cdf 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -112,7 +112,7 @@ The `src` attribute can also accept data URLs, such as ### `nodeintegration` ```html - + ``` A `boolean`. When this attribute is present the guest page in `webview` will have node @@ -123,7 +123,7 @@ page. ### `nodeintegrationinsubframes` ```html - + ``` A `boolean` for the experimental option for enabling NodeJS support in sub-frames such as iframes @@ -161,7 +161,7 @@ after this script has finished executing. ### `httpreferrer` ```html - + ``` A `string` that sets the referrer URL for the guest page. diff --git a/docs/development/build-instructions-windows.md b/docs/development/build-instructions-windows.md index d47bb3a78d5ef..8d7e7943308a4 100644 --- a/docs/development/build-instructions-windows.md +++ b/docs/development/build-instructions-windows.md @@ -23,7 +23,7 @@ store from `.pdb` files. SDK, open Visual Studio Installer, select `Modify` → `Individual Components`, scroll down and select the appropriate Windows SDK to install. Another option would be to look at the - [Windows SDK and emulator archive](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive) + [Windows SDK and emulator archive](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/) and download the standalone version of the SDK respectively. * The SDK Debugging Tools must also be installed. If the Windows 10 SDK was installed via the Visual Studio installer, then they can be installed by going to: @@ -32,7 +32,7 @@ store from `.pdb` files. Or, you can download the standalone SDK installer and use it to install the Debugging Tools. If you don't currently have a Windows installation, -[dev.microsoftedge.com](https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/) +[developer.microsoft.com](https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/) has timebombed versions of Windows that you can use to build Electron. Building Electron is done entirely with command-line scripts and cannot be done diff --git a/docs/development/debugging-on-windows.md b/docs/development/debugging-on-windows.md index 855fe5f95179f..6aecc0d3818fa 100644 --- a/docs/development/debugging-on-windows.md +++ b/docs/development/debugging-on-windows.md @@ -88,7 +88,7 @@ is doing to the operating system, it can be a valuable resource. For an introduction to ProcMon's basic and advanced debugging features, go check out [this video tutorial][procmon-instructions] provided by Microsoft. -[sys-internals]: https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx +[sys-internals]: https://learn.microsoft.com/en-us/sysinternals/downloads/procmon [procmon-instructions]: https://learn.microsoft.com/en-us/shows/defrag-tools/4-process-monitor ## Using WinDbg diff --git a/docs/development/issues.md b/docs/development/issues.md index 88e99eb734f52..76b126bf07550 100644 --- a/docs/development/issues.md +++ b/docs/development/issues.md @@ -24,7 +24,7 @@ contribute: ## Asking for General Help -[The Electron website](https://electronjs.org/community) has a +[The Electron website](https://www.electronjs.org/community) has a list of resources for getting programming help, reporting security issues, contributing, and more. Please use the issue tracker for bugs only! diff --git a/docs/fiddles/menus/customize-menus/index.html b/docs/fiddles/menus/customize-menus/index.html index 9d077d35d510f..798745c173f82 100644 --- a/docs/fiddles/menus/customize-menus/index.html +++ b/docs/fiddles/menus/customize-menus/index.html @@ -21,7 +21,7 @@

Open the - full API documentation(opens in new window)ProTip

  • macOS(opens in new window)ProTip
  • Windows(opens in new window)ProTip
  • Linux(opens in new window)Create a context menu

    See the full context-menu event documentation for all the available properties. diff --git a/docs/fiddles/menus/shortcuts/index.html b/docs/fiddles/menus/shortcuts/index.html index 6ab24f828bdf7..cabca0bf715a8 100644 --- a/docs/fiddles/menus/shortcuts/index.html +++ b/docs/fiddles/menus/shortcuts/index.html @@ -21,10 +21,10 @@

    The globalShortcut and Menu modules can be used to

    Open the full documentation for the - Menu, - Accelerator, + Menu, + Accelerator, and - globalShortcut + globalShortcut APIs in your browser.

    @@ -56,12 +56,12 @@

    ProTip

    • macOS + href="https://developer.apple.com/design/human-interface-guidelines/keyboards">macOS
    • Windows
    • + href="https://support.microsoft.com/en-us/windows/keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec">Windows
    • Linux
    • + href="https://developer.gnome.org/hig/guidelines/keyboard.html">Linux
    diff --git a/docs/fiddles/native-ui/dialogs/error-dialog/index.html b/docs/fiddles/native-ui/dialogs/error-dialog/index.html index 4f5c0a675f408..bce7d0db845bc 100644 --- a/docs/fiddles/native-ui/dialogs/error-dialog/index.html +++ b/docs/fiddles/native-ui/dialogs/error-dialog/index.html @@ -23,7 +23,7 @@

    Open the - + full API documentation (opens in new window) in your browser. diff --git a/docs/fiddles/native-ui/dialogs/information-dialog/index.html b/docs/fiddles/native-ui/dialogs/information-dialog/index.html index 005674e99b4ca..4823946cb809b 100644 --- a/docs/fiddles/native-ui/dialogs/information-dialog/index.html +++ b/docs/fiddles/native-ui/dialogs/information-dialog/index.html @@ -23,7 +23,7 @@

    Open the - + full API documentation (opens in new window) in your browser. diff --git a/docs/fiddles/native-ui/dialogs/open-file-or-directory/index.html b/docs/fiddles/native-ui/dialogs/open-file-or-directory/index.html index dcf66587a8e9e..226888218f9eb 100644 --- a/docs/fiddles/native-ui/dialogs/open-file-or-directory/index.html +++ b/docs/fiddles/native-ui/dialogs/open-file-or-directory/index.html @@ -23,7 +23,7 @@

    Open the - + full API documentation (opens in new window) in your browser. diff --git a/docs/fiddles/native-ui/dialogs/save-dialog/index.html b/docs/fiddles/native-ui/dialogs/save-dialog/index.html index cd6b0ad4cc35d..6165af46ae1db 100644 --- a/docs/fiddles/native-ui/dialogs/save-dialog/index.html +++ b/docs/fiddles/native-ui/dialogs/save-dialog/index.html @@ -23,7 +23,7 @@

    Open the - + full API documentation (opens in new window) in your browser. diff --git a/docs/fiddles/native-ui/drag-and-drop/index.html b/docs/fiddles/native-ui/drag-and-drop/index.html index 53aee6ddfcf37..5f7d4853c342a 100644 --- a/docs/fiddles/native-ui/drag-and-drop/index.html +++ b/docs/fiddles/native-ui/drag-and-drop/index.html @@ -16,7 +16,7 @@

    Open the - + full API documentation (opens in new window) in your browser. diff --git a/docs/fiddles/native-ui/external-links-file-manager/index.html b/docs/fiddles/native-ui/external-links-file-manager/index.html index cd4bd02153c80..32e6dd1da2c67 100644 --- a/docs/fiddles/native-ui/external-links-file-manager/index.html +++ b/docs/fiddles/native-ui/external-links-file-manager/index.html @@ -17,7 +17,7 @@

    This module works in both the main and renderer process.

    Open the - + full API documentation (opens in new window) in your browser. diff --git a/docs/fiddles/native-ui/notifications/index.html b/docs/fiddles/native-ui/notifications/index.html index b7d86f23aa89f..27725a448d0f0 100644 --- a/docs/fiddles/native-ui/notifications/index.html +++ b/docs/fiddles/native-ui/notifications/index.html @@ -26,7 +26,7 @@

    Open the - + full API documentation(opens in new window) in your browser. diff --git a/docs/fiddles/native-ui/tray/index.html b/docs/fiddles/native-ui/tray/index.html index 482abeeab85c9..22156f39239c3 100644 --- a/docs/fiddles/native-ui/tray/index.html +++ b/docs/fiddles/native-ui/tray/index.html @@ -15,7 +15,7 @@

    Open the - + full API documentation in your browser. @@ -29,7 +29,7 @@

    ProTip

    On Linux distributions that only have app indicator support, users will need to install libappindicator1 to make the tray icon work. See the - + full API documentation for more details about using Tray on Linux. diff --git a/docs/fiddles/screen/fit-screen/main.js b/docs/fiddles/screen/fit-screen/main.js index 8fbaabcc5b850..559e0f24e436e 100644 --- a/docs/fiddles/screen/fit-screen/main.js +++ b/docs/fiddles/screen/fit-screen/main.js @@ -1,7 +1,7 @@ // Retrieve information about screen size, displays, cursor position, etc. // // For more info, see: -// https://electronjs.org/docs/api/screen +// https://www.electronjs.org/docs/latest/api/screen const { app, BrowserWindow } = require('electron') diff --git a/docs/fiddles/system/protocol-handler/launch-app-from-URL-in-another-app/index.html b/docs/fiddles/system/protocol-handler/launch-app-from-URL-in-another-app/index.html index a3ddd1b933fc0..bc0e8c569c0a5 100644 --- a/docs/fiddles/system/protocol-handler/launch-app-from-URL-in-another-app/index.html +++ b/docs/fiddles/system/protocol-handler/launch-app-from-URL-in-another-app/index.html @@ -16,7 +16,7 @@

    App Default Protocol Demo

    These methods allow you to set and unset the protocols your app should be the default app for. Similar to when a browser asks to be your default for viewing web pages.

    -

    Open the full protocol API documentation in your +

    Open the full protocol API documentation in your browser.

    ----- diff --git a/docs/fiddles/system/system-app-user-information/app-information/index.html b/docs/fiddles/system/system-app-user-information/app-information/index.html index 68e3143ea7332..b08a8d0c82e2d 100644 --- a/docs/fiddles/system/system-app-user-information/app-information/index.html +++ b/docs/fiddles/system/system-app-user-information/app-information/index.html @@ -14,7 +14,7 @@

    App Information

    The main process app module can be used to get the path at which your app is located on the user's computer.

    In this example, to get that information from the renderer process, we use the ipc module to send a message to the main process requesting the app's path.

    -

    See the app module documentation(opens in new window) for more.

    +

    See the app module documentation(opens in new window) for more.

    diff --git a/docs/fiddles/system/system-information/get-version-information/index.html b/docs/fiddles/system/system-information/get-version-information/index.html index b19df1f2b534b..de0a39b423aea 100644 --- a/docs/fiddles/system/system-information/get-version-information/index.html +++ b/docs/fiddles/system/system-information/get-version-information/index.html @@ -15,7 +15,7 @@

    Get version information

    The process module is built into Node.js (therefore you can use this in both the main and renderer processes) and in Electron apps this object has a few more useful properties on it.

    The example below gets the version of Electron in use by the app.

    -

    See the process documentation (opens in new window) for more.

    +

    See the process documentation (opens in new window) for more.

    diff --git a/docs/fiddles/windows/manage-windows/frameless-window/index.html b/docs/fiddles/windows/manage-windows/frameless-window/index.html index 78895119dc72f..5041b1939e0d1 100644 --- a/docs/fiddles/windows/manage-windows/frameless-window/index.html +++ b/docs/fiddles/windows/manage-windows/frameless-window/index.html @@ -22,7 +22,7 @@

    Open the - + full API documentation (opens in new window) in your browser. @@ -59,7 +59,7 @@

    Create a frameless window

    For more details, see the - + Window Customization diff --git a/docs/fiddles/windows/manage-windows/manage-window-state/index.html b/docs/fiddles/windows/manage-windows/manage-window-state/index.html index 3521dd66ac58b..eca1d0a4757df 100644 --- a/docs/fiddles/windows/manage-windows/manage-window-state/index.html +++ b/docs/fiddles/windows/manage-windows/manage-window-state/index.html @@ -22,7 +22,7 @@

    Open the - + full API documentation (opens in new window) in your browser. @@ -47,7 +47,7 @@

    Manage window state

    There are a lot of methods for controlling the state of the window such as the size, location, and focus status as well as events to listen to for window changes. Visit the - + documentation (opens in new window) for the full list. diff --git a/docs/fiddles/windows/manage-windows/new-window/renderer.js b/docs/fiddles/windows/manage-windows/new-window/renderer.js index 0b5288d4f919a..3ce7216148dff 100644 --- a/docs/fiddles/windows/manage-windows/new-window/renderer.js +++ b/docs/fiddles/windows/manage-windows/new-window/renderer.js @@ -10,5 +10,5 @@ newWindowBtn.addEventListener('click', (event) => { link.addEventListener('click', (e) => { e.preventDefault() - shell.openExternal('https://electronjs.org/docs/api/browser-window') + shell.openExternal('https://www.electronjs.org/docs/latest/api/browser-window') }) diff --git a/docs/fiddles/windows/manage-windows/window-events/index.html b/docs/fiddles/windows/manage-windows/window-events/index.html index b89dca080c63b..028a70b6c19e2 100644 --- a/docs/fiddles/windows/manage-windows/window-events/index.html +++ b/docs/fiddles/windows/manage-windows/window-events/index.html @@ -22,7 +22,7 @@

    Open the - + full API documentation (opens in new window) in your browser. diff --git a/docs/tutorial/automated-testing.md b/docs/tutorial/automated-testing.md index 650d5ca882cc6..61206412ba841 100644 --- a/docs/tutorial/automated-testing.md +++ b/docs/tutorial/automated-testing.md @@ -103,7 +103,7 @@ const driver = new webdriver.Builder() }) .forBrowser('chrome') // note: use .forBrowser('electron') for selenium-webdriver <= 3.6.0 .build() -driver.get('http://www.google.com') +driver.get('https://www.google.com') driver.findElement(webdriver.By.name('q')).sendKeys('webdriver') driver.findElement(webdriver.By.name('btnG')).click() driver.wait(() => { diff --git a/docs/tutorial/electron-timelines.md b/docs/tutorial/electron-timelines.md index 4f671fe8c08ba..bc6421c917303 100644 --- a/docs/tutorial/electron-timelines.md +++ b/docs/tutorial/electron-timelines.md @@ -43,7 +43,7 @@ check out our [Electron Versioning](./electron-versioning.md) doc. **Historical changes:** -* Since Electron 5, Electron has been publicizing its release dates ([see blog post](https://electronjs.org/blog/electron-5-0-timeline)). +* Since Electron 5, Electron has been publicizing its release dates ([see blog post](https://www.electronjs.org/blog/electron-5-0-timeline)). * Since Electron 6, Electron major versions have been targeting every other Chromium major version. Each Electron stable should happen on the same day as Chrome stable ([see blog post](https://www.electronjs.org/blog/12-week-cadence)). * Since Electron 16, Electron has been releasing major versions on an 8-week cadence in accordance to Chrome's change to a 4-week release cadence ([see blog post](https://www.electronjs.org/blog/8-week-cadence)). diff --git a/docs/tutorial/introduction.md b/docs/tutorial/introduction.md index b7bfba0734e09..ad310790b7119 100644 --- a/docs/tutorial/introduction.md +++ b/docs/tutorial/introduction.md @@ -71,6 +71,6 @@ Are you getting stuck anywhere? Here are a few links to places to look: [chromium]: https://www.chromium.org/ [discord]: https://discord.gg/electronjs [examples]: examples.md -[fiddle]: https://electronjs.org/fiddle +[fiddle]: https://www.electronjs.org/fiddle [issue-tracker]: https://github.com/electron/electron/issues [node]: https://nodejs.org/ diff --git a/docs/tutorial/tutorial-6-publishing-updating.md b/docs/tutorial/tutorial-6-publishing-updating.md index bb099bef9b800..81fb7deda11dd 100644 --- a/docs/tutorial/tutorial-6-publishing-updating.md +++ b/docs/tutorial/tutorial-6-publishing-updating.md @@ -221,7 +221,7 @@ rest of our docs and happy developing! If you have questions, please stop by our [autoupdater]: ../api/auto-updater.md [code-signed]: ./code-signing.md [discord server]: https://discord.gg/electronjs -[electron fiddle]: https://electronjs.org/fiddle +[electron fiddle]: https://www.electronjs.org/fiddle [fiddle-build]: https://github.com/electron/fiddle/blob/main/.github/workflows/build.yaml [fiddle-forge-config]: https://github.com/electron/fiddle/blob/main/forge.config.js [github actions]: https://github.com/features/actions diff --git a/docs/tutorial/windows-store-guide.md b/docs/tutorial/windows-store-guide.md index 762ab02585caa..d0755660fc995 100644 --- a/docs/tutorial/windows-store-guide.md +++ b/docs/tutorial/windows-store-guide.md @@ -148,9 +148,9 @@ You will receive two files: `DesktopAppConverter.zip` and `BaseImage-14316.wim`. Once installation succeeded, you can move on to compiling your Electron app. -[windows-sdk]: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk -[app-converter]: https://docs.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-run-desktop-app-converter -[add-appxpackage]: https://technet.microsoft.com/en-us/library/hh856048.aspx +[windows-sdk]: https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/ +[app-converter]: https://learn.microsoft.com/en-us/windows/msix/packaging-tool/tool-overview +[add-appxpackage]: https://learn.microsoft.com/en-us/previous-versions//hh856048(v=technet.10)?redirectedfrom=MSDN [electron-packager]: https://github.com/electron/electron-packager [electron-windows-store]: https://github.com/electron-userland/electron-windows-store [background-task]: https://github.com/felixrieseberg/electron-uwp-background From 5f21dc62e0cccb69c637f29dd2dafcb936c46d48 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Thu, 10 Aug 2023 12:40:58 -0400 Subject: [PATCH 49/93] ci: fixup known hosts for linux publish (#39437) * ci: fixup known hosts for linux publish * build: use 2023 known hosts * build: use rebuilt docker image * Revert "build: use rebuilt docker image" This reverts commit f9506a9cc04c1fa2ecf26436372f1bb2a44937a5. --------- Co-authored-by: Samuel Attard --- .circleci/config/base.yml | 1 + .circleci/fix-known-hosts.sh | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 468a45f103b54..864ff2e37efa9 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -1568,6 +1568,7 @@ commands: - *step-minimize-workspace-size-from-checkout - *step-fix-sync - *step-setup-env-for-build + - *step-fix-known-hosts-linux - *step-setup-goma-for-build - *step-wait-for-goma - *step-gn-gen-default diff --git a/.circleci/fix-known-hosts.sh b/.circleci/fix-known-hosts.sh index d6d36e791ad5e..9820dbf5255f1 100755 --- a/.circleci/fix-known-hosts.sh +++ b/.circleci/fix-known-hosts.sh @@ -3,5 +3,6 @@ set -e mkdir -p ~/.ssh -echo "|1|B3r+7aO0/x90IdefihIjxIoJrrk=|OJddGDfhbuLFc1bUyy84hhIw57M= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== -|1|rGlEvW55DtzNZp+pzw9gvyOyKi4=|LLWr+7qlkAlw3YGGVfLHHxB/kR0= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts +echo "github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl +github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg= +github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk=" >> ~/.ssh/known_hosts From 22f639e8bba36c27b259a33122cf9f60c09f44fe Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 14 Aug 2023 06:13:15 +0200 Subject: [PATCH 50/93] revert: promise resolved too early when browser initiates in-page navigation (#39481) This reverts commit a0effaf9b85b8efbec819d3d5a18851a3a9a3e5c. --- lib/browser/api/web-contents.ts | 11 ++--------- spec/api-web-contents-spec.ts | 10 ---------- spec/fixtures/pages/navigate_in_page_and_wait.html | 13 ------------- 3 files changed, 2 insertions(+), 32 deletions(-) delete mode 100644 spec/fixtures/pages/navigate_in_page_and_wait.html diff --git a/lib/browser/api/web-contents.ts b/lib/browser/api/web-contents.ts index 0c1cb11d9e5fe..8f0f53aa2ba74 100644 --- a/lib/browser/api/web-contents.ts +++ b/lib/browser/api/web-contents.ts @@ -446,7 +446,6 @@ WebContents.prototype.loadURL = function (url, options) { }; let navigationStarted = false; - let browserInitiatedInPageNavigation = false; const navigationListener = (event: Electron.Event, url: string, isSameDocument: boolean, isMainFrame: boolean) => { if (isMainFrame) { if (navigationStarted && !isSameDocument) { @@ -461,7 +460,6 @@ WebContents.prototype.loadURL = function (url, options) { // as the routing does not leave the document return rejectAndCleanup(-3, 'ERR_ABORTED', url); } - browserInitiatedInPageNavigation = navigationStarted && isSameDocument; navigationStarted = true; } }; @@ -476,22 +474,17 @@ WebContents.prototype.loadURL = function (url, options) { // would be more appropriate. rejectAndCleanup(-2, 'ERR_FAILED', url); }; - const finishListenerWhenUserInitiatedNavigation = () => { - if (!browserInitiatedInPageNavigation) { - finishListener(); - } - }; const removeListeners = () => { this.removeListener('did-finish-load', finishListener); this.removeListener('did-fail-load', failListener); - this.removeListener('did-navigate-in-page', finishListenerWhenUserInitiatedNavigation); + this.removeListener('did-navigate-in-page', finishListener); this.removeListener('did-start-navigation', navigationListener); this.removeListener('did-stop-loading', stopLoadingListener); this.removeListener('destroyed', stopLoadingListener); }; this.on('did-finish-load', finishListener); this.on('did-fail-load', failListener); - this.on('did-navigate-in-page', finishListenerWhenUserInitiatedNavigation); + this.on('did-navigate-in-page', finishListener); this.on('did-start-navigation', navigationListener); this.on('did-stop-loading', stopLoadingListener); this.on('destroyed', stopLoadingListener); diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index 0be6172bb90b9..aeb2a11349882 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -375,16 +375,6 @@ describe('webContents module', () => { await expect(w.loadURL(w.getURL() + '#foo')).to.eventually.be.fulfilled(); }); - it('resolves after browser initiated navigation', async () => { - let finishedLoading = false; - w.webContents.on('did-finish-load', function () { - finishedLoading = true; - }); - - await w.loadFile(path.join(fixturesPath, 'pages', 'navigate_in_page_and_wait.html')); - expect(finishedLoading).to.be.true(); - }); - it('rejects when failing to load a file URL', async () => { await expect(w.loadURL('file:non-existent')).to.eventually.be.rejected() .and.have.property('code', 'ERR_FILE_NOT_FOUND'); diff --git a/spec/fixtures/pages/navigate_in_page_and_wait.html b/spec/fixtures/pages/navigate_in_page_and_wait.html deleted file mode 100644 index 40b12b738522d..0000000000000 --- a/spec/fixtures/pages/navigate_in_page_and_wait.html +++ /dev/null @@ -1,13 +0,0 @@ - -

    - -
    - - - From d68408ca2c2b47d4ba9e88869c6205809c1688b9 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 14 Aug 2023 10:04:29 +0200 Subject: [PATCH 51/93] docs: handle opening links in the default browser in main.js (part #2) (#39473) docs: handle opening links in the default browser in main.js --- .../app-information/main.js | 35 +++++++++++++++++-- .../app-information/renderer.js | 16 ++------- .../manage-windows/new-window/index.html | 2 +- .../windows/manage-windows/new-window/main.js | 8 ++++- .../manage-windows/new-window/renderer.js | 8 +---- 5 files changed, 44 insertions(+), 25 deletions(-) diff --git a/docs/fiddles/system/system-app-user-information/app-information/main.js b/docs/fiddles/system/system-app-user-information/app-information/main.js index 97e612c4b2e81..bfbfcfac553bd 100644 --- a/docs/fiddles/system/system-app-user-information/app-information/main.js +++ b/docs/fiddles/system/system-app-user-information/app-information/main.js @@ -1,5 +1,34 @@ -const { app, ipcMain } = require('electron') +const { app, BrowserWindow, ipcMain, shell } = require('electron') -ipcMain.on('get-app-path', (event) => { - event.sender.send('got-app-path', app.getAppPath()) +let mainWindow = null + +ipcMain.handle('get-app-path', (event) => app.getAppPath()) + +function createWindow () { + const windowOptions = { + width: 600, + height: 400, + title: 'Get app information', + webPreferences: { + contextIsolation: false, + nodeIntegration: true + } + } + + mainWindow = new BrowserWindow(windowOptions) + mainWindow.loadFile('index.html') + + mainWindow.on('closed', () => { + mainWindow = null + }) + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) +} + +app.whenReady().then(() => { + createWindow() }) diff --git a/docs/fiddles/system/system-app-user-information/app-information/renderer.js b/docs/fiddles/system/system-app-user-information/app-information/renderer.js index d209e29021eca..e8a9b1b745d20 100644 --- a/docs/fiddles/system/system-app-user-information/app-information/renderer.js +++ b/docs/fiddles/system/system-app-user-information/app-information/renderer.js @@ -1,19 +1,9 @@ -const { ipcRenderer, shell } = require('electron') +const { ipcRenderer } = require('electron') const appInfoBtn = document.getElementById('app-info') -const electronDocLink = document.querySelectorAll('a[href]') -appInfoBtn.addEventListener('click', () => { - ipcRenderer.send('get-app-path') -}) - -ipcRenderer.on('got-app-path', (event, path) => { +appInfoBtn.addEventListener('click', async () => { + const path = await ipcRenderer.invoke('get-app-path') const message = `This app is located at: ${path}` document.getElementById('got-app-info').innerHTML = message }) - -electronDocLink.addEventListener('click', (e) => { - e.preventDefault() - const url = e.target.getAttribute('href') - shell.openExternal(url) -}) diff --git a/docs/fiddles/windows/manage-windows/new-window/index.html b/docs/fiddles/windows/manage-windows/new-window/index.html index 08fbcab03c943..19e3c33e0b1b6 100644 --- a/docs/fiddles/windows/manage-windows/new-window/index.html +++ b/docs/fiddles/windows/manage-windows/new-window/index.html @@ -8,7 +8,7 @@

    Create a new window

    Supports: Win, macOS, Linux | Process: Main

    The BrowserWindow module gives you the ability to create new windows in your app.

    -

    There are a lot of options when creating a new window. A few are in this demo, but visit the documentation(opens in new window) +

    There are a lot of options when creating a new window. A few are in this demo, but visit the documentation(opens in new window)

    ProTip

    Use an invisible browser window to run background tasks. diff --git a/docs/fiddles/windows/manage-windows/new-window/main.js b/docs/fiddles/windows/manage-windows/new-window/main.js index 7744cbd3e72eb..4e4a4e0ad59a2 100644 --- a/docs/fiddles/windows/manage-windows/new-window/main.js +++ b/docs/fiddles/windows/manage-windows/new-window/main.js @@ -1,5 +1,5 @@ // Modules to control application life and create native browser window -const { app, BrowserWindow, ipcMain } = require('electron') +const { app, BrowserWindow, ipcMain, shell } = require('electron') ipcMain.on('new-window', (event, { url, width, height }) => { const win = new BrowserWindow({ width, height }) @@ -19,6 +19,12 @@ function createWindow () { // and load the index.html of the app. mainWindow.loadFile('index.html') + + // Open external links in the default browser + mainWindow.webContents.on('will-navigate', (event, url) => { + event.preventDefault() + shell.openExternal(url) + }) } // This method will be called when Electron has finished diff --git a/docs/fiddles/windows/manage-windows/new-window/renderer.js b/docs/fiddles/windows/manage-windows/new-window/renderer.js index 3ce7216148dff..0d80d2ee2c528 100644 --- a/docs/fiddles/windows/manage-windows/new-window/renderer.js +++ b/docs/fiddles/windows/manage-windows/new-window/renderer.js @@ -1,14 +1,8 @@ -const { shell, ipcRenderer } = require('electron') +const { ipcRenderer } = require('electron') const newWindowBtn = document.getElementById('new-window') -const link = document.getElementById('browser-window-link') newWindowBtn.addEventListener('click', (event) => { const url = 'https://electronjs.org' ipcRenderer.send('new-window', { url, width: 400, height: 320 }) }) - -link.addEventListener('click', (e) => { - e.preventDefault() - shell.openExternal('https://www.electronjs.org/docs/latest/api/browser-window') -}) From 9f3b6e90ad472a4ce414c37ddbcd42d290f7aa60 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 14 Aug 2023 17:35:37 +0900 Subject: [PATCH 52/93] fix: use nested run loop in clipboard.readImage (#39466) --- shell/common/api/electron_api_clipboard.cc | 11 ++++++++++- spec/api-clipboard-spec.ts | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/shell/common/api/electron_api_clipboard.cc b/shell/common/api/electron_api_clipboard.cc index 0db9fabb296f0..84a3a1337f7ed 100644 --- a/shell/common/api/electron_api_clipboard.cc +++ b/shell/common/api/electron_api_clipboard.cc @@ -9,6 +9,7 @@ #include "base/containers/contains.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" +#include "shell/browser/browser.h" #include "shell/common/gin_converters/image_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/node_includes.h" @@ -220,10 +221,18 @@ void Clipboard::WriteBookmark(const std::u16string& title, } gfx::Image Clipboard::ReadImage(gin_helper::Arguments* args) { + // The ReadPng uses thread pool which requires app ready. + if (IsBrowserProcess() && !Browser::Get()->is_ready()) { + args->ThrowError( + "clipboard.readImage is available only after app ready in the main " + "process"); + return gfx::Image(); + } + ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); absl::optional image; - base::RunLoop run_loop; + base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed); base::RepeatingClosure callback = run_loop.QuitClosure(); clipboard->ReadPng( GetClipboardBuffer(args), diff --git a/spec/api-clipboard-spec.ts b/spec/api-clipboard-spec.ts index 89ed06e243a60..e0bcba165780c 100644 --- a/spec/api-clipboard-spec.ts +++ b/spec/api-clipboard-spec.ts @@ -16,6 +16,11 @@ ifdescribe(process.platform !== 'win32' || process.arch !== 'arm64')('clipboard const readImage = clipboard.readImage(); expect(readImage.toDataURL()).to.equal(i.toDataURL()); }); + + it('works for empty image', () => { + clipboard.writeText('Not an Image'); + expect(clipboard.readImage().isEmpty()).to.be.true(); + }); }); describe('clipboard.readText()', () => { From 4f15181478db3f0c4119315981c9b19f7d1453fb Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 14 Aug 2023 01:37:18 -0700 Subject: [PATCH 53/93] chore: remove deprecated systemPreferences color scheme events (#39341) --- docs/api/system-preferences.md | 18 ------------------ docs/breaking-changes.md | 18 ++++++++++++++++++ .../api/electron_api_system_preferences.cc | 10 ---------- .../api/electron_api_system_preferences.h | 6 ------ .../api/electron_api_system_preferences_win.cc | 15 --------------- spec/ts-smoke/electron/main.ts | 3 +++ 6 files changed, 21 insertions(+), 49 deletions(-) diff --git a/docs/api/system-preferences.md b/docs/api/system-preferences.md index e66e5d0d4e9b3..1110ff94f4b23 100644 --- a/docs/api/system-preferences.md +++ b/docs/api/system-preferences.md @@ -27,24 +27,6 @@ Returns: * `event` Event -### Event: 'inverted-color-scheme-changed' _Windows_ _Deprecated_ - -Returns: - -* `event` Event -* `invertedColorScheme` boolean - `true` if an inverted color scheme (a high contrast color scheme with light text and dark backgrounds) is being used, `false` otherwise. - -**Deprecated:** Should use the new [`updated`](native-theme.md#event-updated) event on the `nativeTheme` module. - -### Event: 'high-contrast-color-scheme-changed' _Windows_ _Deprecated_ - -Returns: - -* `event` Event -* `highContrastColorScheme` boolean - `true` if a high contrast theme is being used, `false` otherwise. - -**Deprecated:** Should use the new [`updated`](native-theme.md#event-updated) event on the `nativeTheme` module. - ## Methods ### `systemPreferences.isSwipeTrackingFromScrollEventsEnabled()` _macOS_ diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index a0cbfc2e76c4c..25833fb39fa5c 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -27,6 +27,24 @@ The `ipcRenderer.sendTo()` API has been deprecated. It should be replaced by set The `senderId` and `senderIsMainFrame` properties of `IpcRendererEvent` have been deprecated as well. +### Removed: color scheme events in `systemPreferences` + +The following `systemPreferences` events have been removed: + +* `inverted-color-scheme-changed` +* `high-contrast-color-scheme-changed` + +Use the new `updated` event on the `nativeTheme` module instead. + +```js +// Removed +systemPreferences.on('inverted-color-scheme-changed', () => { /* ... */ }) +systemPreferences.on('high-contrast-color-scheme-changed', () => { /* ... */ }) + +// Replace with +nativeTheme.on('updated', () => { /* ... */ }) +``` + ## Planned Breaking API Changes (26.0) ### Deprecated: `webContents.getPrinters` diff --git a/shell/browser/api/electron_api_system_preferences.cc b/shell/browser/api/electron_api_system_preferences.cc index f78d72d00d21a..e199cf30e8943 100644 --- a/shell/browser/api/electron_api_system_preferences.cc +++ b/shell/browser/api/electron_api_system_preferences.cc @@ -33,16 +33,6 @@ SystemPreferences::~SystemPreferences() { SystemPreferences::~SystemPreferences() = default; #endif -bool SystemPreferences::IsInvertedColorScheme() { - return ui::NativeTheme::GetInstanceForNativeUi() - ->GetPlatformHighContrastColorScheme() == - ui::NativeTheme::PlatformHighContrastColorScheme::kDark; -} - -bool SystemPreferences::IsHighContrastColorScheme() { - return ui::NativeTheme::GetInstanceForNativeUi()->UserHasContrastPreference(); -} - v8::Local SystemPreferences::GetAnimationSettings( v8::Isolate* isolate) { gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); diff --git a/shell/browser/api/electron_api_system_preferences.h b/shell/browser/api/electron_api_system_preferences.h index b311e97fc6831..cd4fce5cc77bd 100644 --- a/shell/browser/api/electron_api_system_preferences.h +++ b/shell/browser/api/electron_api_system_preferences.h @@ -115,8 +115,6 @@ class SystemPreferences v8::Local GetAppLevelAppearance(v8::Isolate* isolate); void SetAppLevelAppearance(gin::Arguments* args); #endif - bool IsInvertedColorScheme(); - bool IsHighContrastColorScheme(); v8::Local GetAnimationSettings(v8::Isolate* isolate); // disable copy @@ -158,10 +156,6 @@ class SystemPreferences std::string current_color_; - bool inverted_color_scheme_ = false; - - bool high_contrast_color_scheme_ = false; - std::unique_ptr color_change_listener_; #endif }; diff --git a/shell/browser/api/electron_api_system_preferences_win.cc b/shell/browser/api/electron_api_system_preferences_win.cc index a63c7fef28403..982edd2131c63 100644 --- a/shell/browser/api/electron_api_system_preferences_win.cc +++ b/shell/browser/api/electron_api_system_preferences_win.cc @@ -158,9 +158,6 @@ std::string SystemPreferences::GetMediaAccessStatus( } void SystemPreferences::InitializeWindow() { - inverted_color_scheme_ = IsInvertedColorScheme(); - high_contrast_color_scheme_ = IsHighContrastColorScheme(); - // Wait until app is ready before creating sys color listener // Creating this listener before the app is ready causes global shortcuts // to not fire @@ -216,18 +213,6 @@ LRESULT CALLBACK SystemPreferences::WndProc(HWND hwnd, } void SystemPreferences::OnSysColorChange() { - bool new_inverted_color_scheme = IsInvertedColorScheme(); - if (new_inverted_color_scheme != inverted_color_scheme_) { - inverted_color_scheme_ = new_inverted_color_scheme; - Emit("inverted-color-scheme-changed", new_inverted_color_scheme); - } - - bool new_high_contrast_color_scheme = IsHighContrastColorScheme(); - if (new_high_contrast_color_scheme != high_contrast_color_scheme_) { - high_contrast_color_scheme_ = new_high_contrast_color_scheme; - Emit("high-contrast-color-scheme-changed", new_high_contrast_color_scheme); - } - Emit("color-changed"); } diff --git a/spec/ts-smoke/electron/main.ts b/spec/ts-smoke/electron/main.ts index a81377cbe1651..f83f4ea470cf7 100644 --- a/spec/ts-smoke/electron/main.ts +++ b/spec/ts-smoke/electron/main.ts @@ -365,7 +365,10 @@ if (process.platform !== 'win32' || systemPreferences.isAeroGlassEnabled()) { if (process.platform === 'win32') { systemPreferences.on('color-changed', () => { console.log('color changed'); }); + // @ts-expect-error Removed API systemPreferences.on('inverted-color-scheme-changed', (_, inverted) => console.log(inverted ? 'inverted' : 'not inverted')); + // @ts-expect-error Removed API + systemPreferences.on('high-contrast-color-scheme-changed', (_, highContrast) => console.log(highContrast ? 'high contrast' : 'not high contrast')); console.log('Color for menu is', systemPreferences.getColor('menu')); } From 5740d5368f1437a001b6ccde5fb19d3a674ee7fc Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 14 Aug 2023 10:44:07 +0200 Subject: [PATCH 54/93] docs: remove duplicate fiddles (part #2) (#39474) docs: remove duplicate fiddles --- .../external-links/index.html | 68 ------------------- .../external-links/main.js | 26 ------- .../external-links/renderer.js | 7 -- .../path-in-file-manager/index.html | 24 ------- .../path-in-file-manager/main.js | 26 ------- .../path-in-file-manager/renderer.js | 8 --- 6 files changed, 159 deletions(-) delete mode 100644 docs/fiddles/native-ui/external-links-file-manager/external-links/index.html delete mode 100644 docs/fiddles/native-ui/external-links-file-manager/external-links/main.js delete mode 100644 docs/fiddles/native-ui/external-links-file-manager/external-links/renderer.js delete mode 100644 docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/index.html delete mode 100644 docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/main.js delete mode 100644 docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/renderer.js diff --git a/docs/fiddles/native-ui/external-links-file-manager/external-links/index.html b/docs/fiddles/native-ui/external-links-file-manager/external-links/index.html deleted file mode 100644 index 94fc2f4385560..0000000000000 --- a/docs/fiddles/native-ui/external-links-file-manager/external-links/index.html +++ /dev/null @@ -1,68 +0,0 @@ - - - - - Open external links - - -
    -
    -
    -
    - -
    -

    - If you do not want your app to open website links - within the app, you can use the shell module - to open them externally. When clicked, the links will open outside - of your app and in the user's default web browser. -

    -

    - When the demo button is clicked, the electron website will open in - your browser. -

    -

    -
    Renderer Process
    -
    
    -                const { shell } = require('electron')
    -                const exLinksBtn = document.getElementById('open-ex-links')
    -                exLinksBtn.addEventListener('click', (event) => {
    -                shell.openExternal('https://electronjs.org')
    -                })
    -            
    - -
    -

    ProTip

    - Open all outbound links externally. -

    - You may want to open all http and - https links outside of your app. To do this, query - the document and loop through each link and add a listener. This - app uses the code below which is located in - assets/ex-links.js. -

    -
    Renderer Process
    -
    
    -                const { shell } = require('electron')
    -                const links = document.querySelectorAll('a[href]')
    -                for (const link of links) {
    -                    const url = link.getAttribute('href')
    -                    if (url.indexOf('http') === 0) {
    -                        link.addEventListener('click', (e) => {
    -                            e.preventDefault()
    -                            shell.openExternal(url)
    -                        })
    -                    }
    -                }
    -            
    -
    -
    -
    -
    - - - - diff --git a/docs/fiddles/native-ui/external-links-file-manager/external-links/main.js b/docs/fiddles/native-ui/external-links-file-manager/external-links/main.js deleted file mode 100644 index d068254d1cddc..0000000000000 --- a/docs/fiddles/native-ui/external-links-file-manager/external-links/main.js +++ /dev/null @@ -1,26 +0,0 @@ -const { app, BrowserWindow } = require('electron') - -let mainWindow = null - -function createWindow () { - const windowOptions = { - width: 600, - height: 400, - title: 'Open External Links', - webPreferences: { - contextIsolation: false, - nodeIntegration: true - } - } - - mainWindow = new BrowserWindow(windowOptions) - mainWindow.loadFile('index.html') - - mainWindow.on('closed', () => { - mainWindow = null - }) -} - -app.whenReady().then(() => { - createWindow() -}) diff --git a/docs/fiddles/native-ui/external-links-file-manager/external-links/renderer.js b/docs/fiddles/native-ui/external-links-file-manager/external-links/renderer.js deleted file mode 100644 index 8a9b14505a07a..0000000000000 --- a/docs/fiddles/native-ui/external-links-file-manager/external-links/renderer.js +++ /dev/null @@ -1,7 +0,0 @@ -const { shell } = require('electron') - -const exLinksBtn = document.getElementById('open-ex-links') - -exLinksBtn.addEventListener('click', (event) => { - shell.openExternal('https://electronjs.org') -}) diff --git a/docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/index.html b/docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/index.html deleted file mode 100644 index be6a38c9fa167..0000000000000 --- a/docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - -
    -
    -

    Open Path in File Manager

    - Supports: Win, macOS, Linux | Process: Both -
    -

    This demonstrates using the shell module to open the system file manager at a particular location.

    -

    Clicking the demo button will open your file manager at the root.

    -
    - -
    -
    -
    -
    - - - \ No newline at end of file diff --git a/docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/main.js b/docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/main.js deleted file mode 100644 index c5901ffd223cc..0000000000000 --- a/docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/main.js +++ /dev/null @@ -1,26 +0,0 @@ -const { app, BrowserWindow } = require('electron') - -let mainWindow = null - -function createWindow () { - const windowOptions = { - width: 600, - height: 400, - title: 'Open Path in File Manager', - webPreferences: { - contextIsolation: false, - nodeIntegration: true - } - } - - mainWindow = new BrowserWindow(windowOptions) - mainWindow.loadFile('index.html') - - mainWindow.on('closed', () => { - mainWindow = null - }) -} - -app.whenReady().then(() => { - createWindow() -}) diff --git a/docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/renderer.js b/docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/renderer.js deleted file mode 100644 index 600045d1e047c..0000000000000 --- a/docs/fiddles/native-ui/external-links-file-manager/path-in-file-manager/renderer.js +++ /dev/null @@ -1,8 +0,0 @@ -const { shell } = require('electron') -const os = require('node:os') - -const fileManagerBtn = document.getElementById('open-file-manager') - -fileManagerBtn.addEventListener('click', (event) => { - shell.showItemInFolder(os.homedir()) -}) From fb3125dfb5cacbd6f02f4898a3fbc12f85cb43d5 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 14 Aug 2023 02:34:04 -0700 Subject: [PATCH 55/93] chore: document deprecated systemPreferences APIs (#39343) * chore: document deprecated systemPreferences APIs * chore: forgot systemPreferences.appLevelAppearance * test: expect deprecation messages --- docs/api/system-preferences.md | 2 +- docs/breaking-changes.md | 35 +++++++++++++++++++++++ lib/browser/api/system-preferences.ts | 23 +++++++++++++-- spec/api-native-theme-spec.ts | 16 +++++++---- spec/api-system-preferences-spec.ts | 40 +++++++++++++++++++-------- 5 files changed, 97 insertions(+), 19 deletions(-) diff --git a/docs/api/system-preferences.md b/docs/api/system-preferences.md index 1110ff94f4b23..37a9154111ed1 100644 --- a/docs/api/system-preferences.md +++ b/docs/api/system-preferences.md @@ -417,7 +417,7 @@ Returns an object with system animation settings. ## Properties -### `systemPreferences.appLevelAppearance` _macOS_ +### `systemPreferences.appLevelAppearance` _macOS_ _Deprecated_ A `string` property that can be `dark`, `light` or `unknown`. It determines the macOS appearance setting for your application. This maps to values in: [NSApplication.appearance](https://developer.apple.com/documentation/appkit/nsapplication/2967170-appearance?language=objc). Setting this will override the diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 25833fb39fa5c..e71bb5690d76b 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -63,6 +63,41 @@ w.webContents.getPrintersAsync().then((printers) => { }) ``` +### Deprecated: `systemPreferences.{get,set}AppLevelAppearance` and `systemPreferences.appLevelAppearance` + +The `systemPreferences.getAppLevelAppearance` and `systemPreferences.setAppLevelAppearance` +methods have been deprecated, as well as the `systemPreferences.appLevelAppearance` property. +Use the `nativeTheme` module instead. + +```js +// Deprecated +systemPreferences.getAppLevelAppearance() +// Replace with +nativeTheme.shouldUseDarkColors + +// Deprecated +systemPreferences.appLevelAppearance +// Replace with +nativeTheme.shouldUseDarkColors + +// Deprecated +systemPreferences.setAppLevelAppearance('dark') +// Replace with +nativeTheme.themeSource = 'dark' +``` + +### Deprecated: `alternate-selected-control-text` value for `systemPreferences.getColor` + +The `alternate-selected-control-text` value for `systemPreferences.getColor` +has been deprecated. Use `selected-content-background` instead. + +```js +// Deprecated +systemPreferences.getColor('alternate-selected-control-text') +// Replace with +systemPreferences.getColor('selected-content-background') +``` + ## Planned Breaking API Changes (25.0) ### Deprecated: `protocol.{register,intercept}{Buffer,String,Stream,File,Http}Protocol` diff --git a/lib/browser/api/system-preferences.ts b/lib/browser/api/system-preferences.ts index 424c276c636c7..52962e754c390 100644 --- a/lib/browser/api/system-preferences.ts +++ b/lib/browser/api/system-preferences.ts @@ -1,12 +1,31 @@ +import * as deprecate from '@electron/internal/common/deprecate'; + const { systemPreferences } = process._linkedBinding('electron_browser_system_preferences'); if ('getAppLevelAppearance' in systemPreferences) { const nativeALAGetter = systemPreferences.getAppLevelAppearance; const nativeALASetter = systemPreferences.setAppLevelAppearance; + const warnALA = deprecate.warnOnce('appLevelAppearance'); + const warnALAGetter = deprecate.warnOnce('getAppLevelAppearance function'); + const warnALASetter = deprecate.warnOnce('setAppLevelAppearance function'); Object.defineProperty(systemPreferences, 'appLevelAppearance', { - get: () => nativeALAGetter.call(systemPreferences), - set: (appearance) => nativeALASetter.call(systemPreferences, appearance) + get: () => { + warnALA(); + return nativeALAGetter.call(systemPreferences); + }, + set: (appearance) => { + warnALA(); + nativeALASetter.call(systemPreferences, appearance); + } }); + systemPreferences.getAppLevelAppearance = () => { + warnALAGetter(); + return nativeALAGetter.call(systemPreferences); + }; + systemPreferences.setAppLevelAppearance = (appearance) => { + warnALASetter(); + nativeALASetter.call(systemPreferences, appearance); + }; } if ('getEffectiveAppearance' in systemPreferences) { diff --git a/spec/api-native-theme-spec.ts b/spec/api-native-theme-spec.ts index ec463839452e6..1f6fe2a236d3d 100644 --- a/spec/api-native-theme-spec.ts +++ b/spec/api-native-theme-spec.ts @@ -4,6 +4,7 @@ import { once } from 'node:events'; import * as path from 'node:path'; import { setTimeout } from 'node:timers/promises'; +import { expectDeprecationMessages } from './lib/deprecate-helpers'; import { ifdescribe } from './lib/spec-helpers'; import { closeAllWindows } from './lib/window-helpers'; @@ -59,11 +60,16 @@ describe('nativeTheme module', () => { }); ifdescribe(process.platform === 'darwin')('on macOS', () => { - it('should update appLevelAppearance when set', () => { - nativeTheme.themeSource = 'dark'; - expect(systemPreferences.appLevelAppearance).to.equal('dark'); - nativeTheme.themeSource = 'light'; - expect(systemPreferences.appLevelAppearance).to.equal('light'); + it('should update appLevelAppearance when set', async () => { + await expectDeprecationMessages( + () => { + nativeTheme.themeSource = 'dark'; + expect(systemPreferences.appLevelAppearance).to.equal('dark'); + nativeTheme.themeSource = 'light'; + expect(systemPreferences.appLevelAppearance).to.equal('light'); + }, + "(electron) 'appLevelAppearance' is deprecated and will be removed." + ); }); }); diff --git a/spec/api-system-preferences-spec.ts b/spec/api-system-preferences-spec.ts index 7d12bdb4ed48f..6a9395f5e986f 100644 --- a/spec/api-system-preferences-spec.ts +++ b/spec/api-system-preferences-spec.ts @@ -1,5 +1,6 @@ import { expect } from 'chai'; import { systemPreferences } from 'electron/main'; +import { expectDeprecationMessages } from './lib/deprecate-helpers'; import { ifdescribe } from './lib/spec-helpers'; describe('systemPreferences module', () => { @@ -174,9 +175,8 @@ describe('systemPreferences module', () => { }).to.throw(`Unknown color: ${color}`); }); - it('returns a valid color', () => { + it('returns a valid color', async () => { const colors = [ - 'alternate-selected-control-text', 'control-background', 'control', 'control-text', @@ -209,12 +209,20 @@ describe('systemPreferences module', () => { 'unemphasized-selected-text', 'window-background', 'window-frame-text' - ]; + ] as const; colors.forEach(color => { - const sysColor = systemPreferences.getColor(color as any); + const sysColor = systemPreferences.getColor(color); expect(sysColor).to.be.a('string'); }); + + await expectDeprecationMessages( + () => { + const sysColor = systemPreferences.getColor('alternate-selected-control-text'); + expect(sysColor).to.be.a('string'); + }, + "'alternate-selected-control-text' is deprecated as an input to getColor. Use 'selected-content-background' instead." + ); }); }); @@ -233,15 +241,25 @@ describe('systemPreferences module', () => { }); describe('with functions', () => { - it('returns a valid appearance', () => { - const appearance = systemPreferences.getAppLevelAppearance(); - expect(options).to.include(appearance); + it('returns a valid appearance', async () => { + await expectDeprecationMessages( + () => { + const appearance = systemPreferences.getAppLevelAppearance(); + expect(options).to.include(appearance); + }, + "(electron) 'getAppLevelAppearance function' is deprecated and will be removed." + ); }); - it('can be changed', () => { - systemPreferences.setAppLevelAppearance('dark'); - const appearance = systemPreferences.getAppLevelAppearance(); - expect(appearance).to.eql('dark'); + it('can be changed', async () => { + await expectDeprecationMessages( + () => { + systemPreferences.setAppLevelAppearance('dark'); + const appearance = systemPreferences.getAppLevelAppearance(); + expect(appearance).to.eql('dark'); + }, + "(electron) 'setAppLevelAppearance function' is deprecated and will be removed." + ); }); }); }); From d83a3a98e414fe20d9a3d948ef28ca9b6f1f092a Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 14 Aug 2023 19:08:55 +0200 Subject: [PATCH 56/93] test: resolve failing Node.js line number failure (#39490) --- .../chore_update_fixtures_errors_force_colors_snapshot.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch b/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch index 3aea2d4d028f4..1e2351093211c 100644 --- a/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch +++ b/patches/node/chore_update_fixtures_errors_force_colors_snapshot.patch @@ -11,7 +11,7 @@ trying to see whether or not the lines are greyed out. One possibility would be to upstream a changed test that doesn't hardcode line numbers. diff --git a/test/fixtures/errors/force_colors.snapshot b/test/fixtures/errors/force_colors.snapshot -index 0334a0b4faa3633aa8617b9538873e7f3540513b..d8c710e07602b68c9ad4eaaeab2bdf399ed5150b 100644 +index 0334a0b4faa3633aa8617b9538873e7f3540513b..28ba4d18fe5e3caf4d904a055550110fd4faa609 100644 --- a/test/fixtures/errors/force_colors.snapshot +++ b/test/fixtures/errors/force_colors.snapshot @@ -4,11 +4,12 @@ throw new Error('Should include grayed stack trace') @@ -28,7 +28,7 @@ index 0334a0b4faa3633aa8617b9538873e7f3540513b..d8c710e07602b68c9ad4eaaeab2bdf39 + at Module.load (node:internal*modules*cjs*loader:1126:32) + at node:internal*modules*cjs*loader:967:12 + at Function._load (node:electron*js2c*asar_bundle:756:32) -+ at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:87:12) ++ at Function.executeUserEntryPoint [as runMain] (node:internal*modules*run_main:96:12)  at node:internal*main*run_main_module:23:47 Node.js * From 02a45ae44ca9b87ef56a13ebce532f1676e5f6a8 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 14 Aug 2023 18:24:32 -0700 Subject: [PATCH 57/93] test: use as const to remove some usages of as any (#39475) --- spec/api-session-spec.ts | 12 ++++++------ spec/api-system-preferences-spec.ts | 16 ++++++++-------- spec/api-web-contents-spec.ts | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/spec/api-session-spec.ts b/spec/api-session-spec.ts index 840748167a24e..592d43eb6982e 100644 --- a/spec/api-session-spec.ts +++ b/spec/api-session-spec.ts @@ -419,33 +419,33 @@ describe('session module', () => { }); it('allows configuring proxy settings with mode `direct`', async () => { - const config = { mode: 'direct' as any, proxyRules: 'http=myproxy:80' }; + const config = { mode: 'direct' as const, proxyRules: 'http=myproxy:80' }; await customSession.setProxy(config); const proxy = await customSession.resolveProxy('http://example.com/'); expect(proxy).to.equal('DIRECT'); }); it('allows configuring proxy settings with mode `auto_detect`', async () => { - const config = { mode: 'auto_detect' as any }; + const config = { mode: 'auto_detect' as const }; await customSession.setProxy(config); }); it('allows configuring proxy settings with mode `pac_script`', async () => { - const config = { mode: 'pac_script' as any }; + const config = { mode: 'pac_script' as const }; await customSession.setProxy(config); const proxy = await customSession.resolveProxy('http://example.com/'); expect(proxy).to.equal('DIRECT'); }); it('allows configuring proxy settings with mode `fixed_servers`', async () => { - const config = { mode: 'fixed_servers' as any, proxyRules: 'http=myproxy:80' }; + const config = { mode: 'fixed_servers' as const, proxyRules: 'http=myproxy:80' }; await customSession.setProxy(config); const proxy = await customSession.resolveProxy('http://example.com/'); expect(proxy).to.equal('PROXY myproxy:80'); }); it('allows configuring proxy settings with mode `system`', async () => { - const config = { mode: 'system' as any }; + const config = { mode: 'system' as const }; await customSession.setProxy(config); }); @@ -468,7 +468,7 @@ describe('session module', () => { res.end(pac); }); const { url } = await listen(server); - const config = { mode: 'pac_script' as any, pacScript: url }; + const config = { mode: 'pac_script' as const, pacScript: url }; await customSession.setProxy(config); { const proxy = await customSession.resolveProxy('https://google.com'); diff --git a/spec/api-system-preferences-spec.ts b/spec/api-system-preferences-spec.ts index 6a9395f5e986f..ab4f33b171bed 100644 --- a/spec/api-system-preferences-spec.ts +++ b/spec/api-system-preferences-spec.ts @@ -29,7 +29,7 @@ describe('systemPreferences module', () => { { key: 'one', type: 'string', value: 'ONE' }, { key: 'two', value: 2, type: 'integer' }, { key: 'three', value: [1, 2, 3], type: 'array' } - ]; + ] as const; const defaultsDict: Record = {}; defaultsMap.forEach(row => { defaultsDict[row.key] = row.value; }); @@ -38,7 +38,7 @@ describe('systemPreferences module', () => { for (const userDefault of defaultsMap) { const { key, value: expectedValue, type } = userDefault; - const actualValue = systemPreferences.getUserDefault(key, type as any); + const actualValue = systemPreferences.getUserDefault(key, type); expect(actualValue).to.deep.equal(expectedValue); } }); @@ -91,12 +91,12 @@ describe('systemPreferences module', () => { ['url', 'https://github.com/electron'], ['array', [1, 2, 3]], ['dictionary', { a: 1, b: 2 }] - ]; + ] as const; it('sets values', () => { for (const [type, value] of TEST_CASES) { - systemPreferences.setUserDefault(KEY, type as any, value as any); - const retrievedValue = systemPreferences.getUserDefault(KEY, type as any); + systemPreferences.setUserDefault(KEY, type, value as any); + const retrievedValue = systemPreferences.getUserDefault(KEY, type); expect(retrievedValue).to.deep.equal(value); } }); @@ -104,7 +104,7 @@ describe('systemPreferences module', () => { it('throws when type and value conflict', () => { for (const [type, value] of TEST_CASES) { expect(() => { - systemPreferences.setUserDefault(KEY, type as any, typeof value === 'string' ? {} : 'foo' as any); + systemPreferences.setUserDefault(KEY, type, typeof value === 'string' ? {} : 'foo' as any); }).to.throw(`Unable to convert value to: ${type}`); } }); @@ -158,10 +158,10 @@ describe('systemPreferences module', () => { }); it('returns a valid system color', () => { - const colors = ['blue', 'brown', 'gray', 'green', 'orange', 'pink', 'purple', 'red', 'yellow']; + const colors = ['blue', 'brown', 'gray', 'green', 'orange', 'pink', 'purple', 'red', 'yellow'] as const; colors.forEach(color => { - const sysColor = systemPreferences.getSystemColor(color as any); + const sysColor = systemPreferences.getSystemColor(color); expect(sysColor).to.be.a('string'); }); }); diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index aeb2a11349882..38f77ece94605 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -1280,9 +1280,9 @@ describe('webContents module', () => { 'default_public_interface_only', 'default_public_and_private_interfaces', 'disable_non_proxied_udp' - ]; + ] as const; policies.forEach((policy) => { - w.webContents.setWebRTCIPHandlingPolicy(policy as any); + w.webContents.setWebRTCIPHandlingPolicy(policy); expect(w.webContents.getWebRTCIPHandlingPolicy()).to.equal(policy); }); }); @@ -2254,7 +2254,7 @@ describe('webContents module', () => { const promise = once(w.webContents, 'context-menu') as Promise<[any, Electron.ContextMenuParams]>; // Simulate right-click to create context-menu event. - const opts = { x: 0, y: 0, button: 'right' as any }; + const opts = { x: 0, y: 0, button: 'right' as const }; w.webContents.sendInputEvent({ ...opts, type: 'mouseDown' }); w.webContents.sendInputEvent({ ...opts, type: 'mouseUp' }); From 9bf1f3ef016499b0226195e4b6a14e522d97917a Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 14 Aug 2023 18:28:17 -0700 Subject: [PATCH 58/93] ci: automation for issue triage board (#39464) --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + .github/workflows/issue-labeled.yml | 25 +++++++++++++++- .github/workflows/issue-unlabeled.yml | 42 +++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/issue-unlabeled.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 66196fe99ba90..489c6369100e4 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -2,6 +2,7 @@ name: Bug Report description: Report an Electron bug title: "[Bug]: " labels: "bug :beetle:" +projects: ["electron/90"] body: - type: checkboxes attributes: diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 48c027613403b..6578c3c78f3ea 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -8,7 +8,30 @@ permissions: # added using https://github.com/step-security/secure-workflows contents: read jobs: - issue-labeled: + issue-labeled-blocked: + name: blocked/* label added + if: startsWith(github.event.label.name, 'blocked/') + runs-on: ubuntu-latest + steps: + - name: Generate GitHub App token + id: generate-token + env: + RELEASE_BOARD_GH_APP_CREDS: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }} + run: | + set -eo pipefail + TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org electron) + echo "TOKEN=$TOKEN" >> "$GITHUB_OUTPUT" + - name: Set status + if: ${{ steps.generate-token.outputs.TOKEN }} + uses: github/update-project-action@2d475e08804f11f4022df7e21f5816531e97cb64 # v2 + with: + github_token: ${{ steps.generate-token.outputs.TOKEN }} + organization: electron + project_number: 90 + content_id: ${{ github.event.issue.node_id }} + field: Status + value: 🛑 Blocked + issue-labeled-blocked-need-repro: name: blocked/need-repro label added if: github.event.label.name == 'blocked/need-repro' permissions: diff --git a/.github/workflows/issue-unlabeled.yml b/.github/workflows/issue-unlabeled.yml new file mode 100644 index 0000000000000..41d4658470a1d --- /dev/null +++ b/.github/workflows/issue-unlabeled.yml @@ -0,0 +1,42 @@ +name: Issue Unlabeled + +on: + issues: + types: [unlabeled] + +permissions: + contents: read + +jobs: + issue-unlabeled-blocked: + name: All blocked/* labels removed + if: startsWith(github.event.label.name, 'blocked/') + runs-on: ubuntu-latest + steps: + - name: Check for any blocked labels + id: check-for-blocked-labels + run: | + set -eo pipefail + BLOCKED_LABEL_COUNT=$(echo '${{ toJSON(github.event.issue.labels.*.name) }}' | jq '[ .[] | select(startswith("blocked/")) ] | length') + if [[ $BLOCKED_LABEL_COUNT -eq 0 ]]; then + echo "NOT_BLOCKED=1" >> "$GITHUB_OUTPUT" + fi + - name: Generate GitHub App token + if: ${{ steps.check-for-blocked-labels.outputs.NOT_BLOCKED }} + id: generate-token + env: + RELEASE_BOARD_GH_APP_CREDS: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }} + run: | + set -eo pipefail + TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org electron) + echo "TOKEN=$TOKEN" >> "$GITHUB_OUTPUT" + - name: Set status + if: ${{ steps.generate-token.outputs.TOKEN }} + uses: github/update-project-action@2d475e08804f11f4022df7e21f5816531e97cb64 # v2 + with: + github_token: ${{ steps.generate-token.outputs.TOKEN }} + organization: electron + project_number: 90 + content_id: ${{ github.event.issue.node_id }} + field: Status + value: 📥 Was Blocked From f6ade001ca7fbb81565c9d753090f2cadba3cbfe Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 14 Aug 2023 18:28:42 -0700 Subject: [PATCH 59/93] ci: automation for deprecation project board (#39477) --- .github/workflows/pull-request-labeled.yml | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/pull-request-labeled.yml diff --git a/.github/workflows/pull-request-labeled.yml b/.github/workflows/pull-request-labeled.yml new file mode 100644 index 0000000000000..a60279b5c372f --- /dev/null +++ b/.github/workflows/pull-request-labeled.yml @@ -0,0 +1,33 @@ +name: Pull Request Labeled + +on: + pull_request: + types: [labeled] + +permissions: + contents: read + +jobs: + pull-request-labeled-deprecation-review-complete: + name: deprecation-review/complete label added + if: github.event.label.name == 'deprecation-review/complete ✅' + runs-on: ubuntu-latest + steps: + - name: Generate GitHub App token + id: generate-token + env: + RELEASE_BOARD_GH_APP_CREDS: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }} + run: | + set -eo pipefail + TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org electron) + echo "TOKEN=$TOKEN" >> "$GITHUB_OUTPUT" + - name: Set status + if: ${{ steps.generate-token.outputs.TOKEN }} + uses: github/update-project-action@2d475e08804f11f4022df7e21f5816531e97cb64 # v2 + with: + github_token: ${{ steps.generate-token.outputs.TOKEN }} + organization: electron + project_number: 94 + content_id: ${{ github.event.pull_request.node_id }} + field: Status + value: ✅ Reviewed From 7321f91647e9b3ba3550c35615f6d4ff626eb678 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 14 Aug 2023 18:32:38 -0700 Subject: [PATCH 60/93] ci: improve blocked/need-repro workflow (#39451) * ci: improve blocked/need-repro workflow * ci: let maintainer comments suppress bot comment * ci: ensure failures bubble up --- .github/workflows/issue-labeled.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 6578c3c78f3ea..3cf7e33783a73 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -38,15 +38,29 @@ jobs: issues: write # for actions-cool/issues-helper to update issues runs-on: ubuntu-latest steps: + - name: Check if comment needed + id: check-for-comment + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: electron/electron + run: | + set -eo pipefail + COMMENT_COUNT=$(gh issue view ${{ github.event.issue.number }} --comments --json comments | jq '[ .comments[] | select(.author.login == "github-actions" or .authorAssociation == "OWNER" or .authorAssociation == "MEMBER") | select(.body | startswith("")) ] | length') + if [[ $COMMENT_COUNT -eq 0 ]]; then + echo "SHOULD_COMMENT=1" >> "$GITHUB_OUTPUT" + fi - name: Create comment - uses: actions-cool/issues-helper@dad28fdb88da5f082c04659b7373d85790f9b135 # v3.3.0 + if: ${{ steps.check-for-comment.outputs.SHOULD_COMMENT }} + uses: actions-cool/issues-helper@275328970dbc3bfc3bc43f5fe741bf3638300c0a # v3.3.3 with: actions: 'create-comment' body: | + + Hello @${{ github.event.issue.user.login }}. Thanks for reporting this and helping to make Electron better! Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, [Electron Fiddle](https://www.electronjs.org/fiddle) is a great tool for making small test cases and makes it easy to publish your test case to a [gist](https://gist.github.com) that Electron maintainers can use. Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests. - Now adding the `blocked/need-repro` label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed. + Now adding the https://github.com/electron/electron/labels/blocked%2Fneed-repro label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed. From e285243af93b15ac62e76ef18390312ff6d83b52 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 15 Aug 2023 03:33:30 +0200 Subject: [PATCH 61/93] refactor: update `WebContentsZoomController` (#39428) refactor: update WebContentsZoomController --- filenames.gni | 1 + shell/browser/extensions/api/tabs/tabs_api.cc | 18 +- shell/browser/web_contents_zoom_controller.cc | 251 +++++++++++++----- shell/browser/web_contents_zoom_controller.h | 94 ++++--- shell/browser/web_contents_zoom_observer.h | 29 ++ shell/browser/web_view_guest_delegate.cc | 20 +- shell/browser/web_view_guest_delegate.h | 13 +- 7 files changed, 305 insertions(+), 121 deletions(-) create mode 100644 shell/browser/web_contents_zoom_observer.h diff --git a/filenames.gni b/filenames.gni index b4b01068e8f50..c06f6ba484bab 100644 --- a/filenames.gni +++ b/filenames.gni @@ -494,6 +494,7 @@ filenames = { "shell/browser/web_contents_preferences.h", "shell/browser/web_contents_zoom_controller.cc", "shell/browser/web_contents_zoom_controller.h", + "shell/browser/web_contents_zoom_observer.h", "shell/browser/web_view_guest_delegate.cc", "shell/browser/web_view_guest_delegate.h", "shell/browser/web_view_manager.cc", diff --git a/shell/browser/extensions/api/tabs/tabs_api.cc b/shell/browser/extensions/api/tabs/tabs_api.cc index 79f595121b6fd..0cdc96819f70b 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.cc +++ b/shell/browser/extensions/api/tabs/tabs_api.cc @@ -42,19 +42,19 @@ void ZoomModeToZoomSettings(WebContentsZoomController::ZoomMode zoom_mode, api::tabs::ZoomSettings* zoom_settings) { DCHECK(zoom_settings); switch (zoom_mode) { - case WebContentsZoomController::ZoomMode::kDefault: + case WebContentsZoomController::ZOOM_MODE_DEFAULT: zoom_settings->mode = api::tabs::ZOOM_SETTINGS_MODE_AUTOMATIC; zoom_settings->scope = api::tabs::ZOOM_SETTINGS_SCOPE_PER_ORIGIN; break; - case WebContentsZoomController::ZoomMode::kIsolated: + case WebContentsZoomController::ZOOM_MODE_ISOLATED: zoom_settings->mode = api::tabs::ZOOM_SETTINGS_MODE_AUTOMATIC; zoom_settings->scope = api::tabs::ZOOM_SETTINGS_SCOPE_PER_TAB; break; - case WebContentsZoomController::ZoomMode::kManual: + case WebContentsZoomController::ZOOM_MODE_MANUAL: zoom_settings->mode = api::tabs::ZOOM_SETTINGS_MODE_MANUAL; zoom_settings->scope = api::tabs::ZOOM_SETTINGS_SCOPE_PER_TAB; break; - case WebContentsZoomController::ZoomMode::kDisabled: + case WebContentsZoomController::ZOOM_MODE_DISABLED: zoom_settings->mode = api::tabs::ZOOM_SETTINGS_MODE_DISABLED; zoom_settings->scope = api::tabs::ZOOM_SETTINGS_SCOPE_PER_TAB; break; @@ -427,24 +427,24 @@ ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() { // Determine the correct internal zoom mode to set |web_contents| to from the // user-specified |zoom_settings|. WebContentsZoomController::ZoomMode zoom_mode = - WebContentsZoomController::ZoomMode::kDefault; + WebContentsZoomController::ZOOM_MODE_DEFAULT; switch (params->zoom_settings.mode) { case tabs::ZOOM_SETTINGS_MODE_NONE: case tabs::ZOOM_SETTINGS_MODE_AUTOMATIC: switch (params->zoom_settings.scope) { case tabs::ZOOM_SETTINGS_SCOPE_NONE: case tabs::ZOOM_SETTINGS_SCOPE_PER_ORIGIN: - zoom_mode = WebContentsZoomController::ZoomMode::kDefault; + zoom_mode = WebContentsZoomController::ZOOM_MODE_DEFAULT; break; case tabs::ZOOM_SETTINGS_SCOPE_PER_TAB: - zoom_mode = WebContentsZoomController::ZoomMode::kIsolated; + zoom_mode = WebContentsZoomController::ZOOM_MODE_ISOLATED; } break; case tabs::ZOOM_SETTINGS_MODE_MANUAL: - zoom_mode = WebContentsZoomController::ZoomMode::kManual; + zoom_mode = WebContentsZoomController::ZOOM_MODE_MANUAL; break; case tabs::ZOOM_SETTINGS_MODE_DISABLED: - zoom_mode = WebContentsZoomController::ZoomMode::kDisabled; + zoom_mode = WebContentsZoomController::ZOOM_MODE_DISABLED; } contents->GetZoomController()->SetZoomMode(zoom_mode); diff --git a/shell/browser/web_contents_zoom_controller.cc b/shell/browser/web_contents_zoom_controller.cc index 6562122fe95b7..b0fb6bee9d93b 100644 --- a/shell/browser/web_contents_zoom_controller.cc +++ b/shell/browser/web_contents_zoom_controller.cc @@ -6,6 +6,7 @@ #include +#include "content/public/browser/browser_thread.h" #include "content/public/browser/navigation_details.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/navigation_handle.h" @@ -16,72 +17,122 @@ #include "content/public/browser/web_contents_user_data.h" #include "content/public/common/page_type.h" #include "net/base/url_util.h" +#include "shell/browser/web_contents_zoom_observer.h" #include "third_party/blink/public/common/page/page_zoom.h" +using content::BrowserThread; + namespace electron { +namespace { + +const double kPageZoomEpsilon = 0.001; + +} // namespace + WebContentsZoomController::WebContentsZoomController( content::WebContents* web_contents) : content::WebContentsObserver(web_contents), content::WebContentsUserData(*web_contents) { - default_zoom_factor_ = kPageZoomEpsilon; + DCHECK_CURRENTLY_ON(BrowserThread::UI); host_zoom_map_ = content::HostZoomMap::GetForWebContents(web_contents); + zoom_level_ = host_zoom_map_->GetDefaultZoomLevel(); + default_zoom_factor_ = kPageZoomEpsilon; + + zoom_subscription_ = host_zoom_map_->AddZoomLevelChangedCallback( + base::BindRepeating(&WebContentsZoomController::OnZoomLevelChanged, + base::Unretained(this))); + + UpdateState(std::string()); } -WebContentsZoomController::~WebContentsZoomController() = default; +WebContentsZoomController::~WebContentsZoomController() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + for (auto& observer : observers_) { + observer.OnZoomControllerDestroyed(this); + } +} -void WebContentsZoomController::AddObserver( - WebContentsZoomController::Observer* observer) { +void WebContentsZoomController::AddObserver(WebContentsZoomObserver* observer) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); observers_.AddObserver(observer); } void WebContentsZoomController::RemoveObserver( - WebContentsZoomController::Observer* observer) { + WebContentsZoomObserver* observer) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); observers_.RemoveObserver(observer); } void WebContentsZoomController::SetEmbedderZoomController( WebContentsZoomController* controller) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); embedder_zoom_controller_ = controller; } -void WebContentsZoomController::SetZoomLevel(double level) { - if (!web_contents()->GetPrimaryMainFrame()->IsRenderFrameLive() || - blink::PageZoomValuesEqual(GetZoomLevel(), level) || - zoom_mode_ == ZoomMode::kDisabled) - return; - - content::GlobalRenderFrameHostId rfh_id = - web_contents()->GetPrimaryMainFrame()->GetGlobalId(); - - if (zoom_mode_ == ZoomMode::kManual) { +bool WebContentsZoomController::SetZoomLevel(double level) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + content::NavigationEntry* entry = + web_contents()->GetController().GetLastCommittedEntry(); + // Cannot zoom in disabled mode. Also, don't allow changing zoom level on + // a crashed tab, an error page or an interstitial page. + if (zoom_mode_ == ZOOM_MODE_DISABLED || + !web_contents()->GetPrimaryMainFrame()->IsRenderFrameLive()) + return false; + + // Do not actually rescale the page in manual mode. + if (zoom_mode_ == ZOOM_MODE_MANUAL) { + // If the zoom level hasn't changed, early out to avoid sending an event. + if (blink::PageZoomValuesEqual(zoom_level_, level)) + return true; + + double old_zoom_level = zoom_level_; zoom_level_ = level; - for (Observer& observer : observers_) - observer.OnZoomLevelChanged(web_contents(), level, true); + ZoomChangedEventData zoom_change_data(web_contents(), old_zoom_level, + zoom_level_, false /* temporary */, + zoom_mode_); + for (auto& observer : observers_) + observer.OnZoomChanged(zoom_change_data); - return; + return true; } content::HostZoomMap* zoom_map = content::HostZoomMap::GetForWebContents(web_contents()); - if (zoom_mode_ == ZoomMode::kIsolated || + DCHECK(zoom_map); + DCHECK(!event_data_); + event_data_ = std::make_unique( + web_contents(), GetZoomLevel(), level, false /* temporary */, zoom_mode_); + + content::GlobalRenderFrameHostId rfh_id = + web_contents()->GetPrimaryMainFrame()->GetGlobalId(); + if (zoom_mode_ == ZOOM_MODE_ISOLATED || zoom_map->UsesTemporaryZoomLevel(rfh_id)) { zoom_map->SetTemporaryZoomLevel(rfh_id, level); - // Notify observers of zoom level changes. - for (Observer& observer : observers_) - observer.OnZoomLevelChanged(web_contents(), level, true); + ZoomChangedEventData zoom_change_data(web_contents(), zoom_level_, level, + true /* temporary */, zoom_mode_); + for (auto& observer : observers_) + observer.OnZoomChanged(zoom_change_data); } else { - content::HostZoomMap::SetZoomLevel(web_contents(), level); - - // Notify observers of zoom level changes. - for (Observer& observer : observers_) - observer.OnZoomLevelChanged(web_contents(), level, false); + if (!entry) { + // If we exit without triggering an update, we should clear event_data_, + // else we may later trigger a DCHECK(event_data_). + event_data_.reset(); + return false; + } + std::string host = + net::GetHostOrSpecFromURL(content::HostZoomMap::GetURLFromEntry(entry)); + zoom_map->SetZoomLevelForHost(host, level); } + + DCHECK(!event_data_); + return true; } -double WebContentsZoomController::GetZoomLevel() { - return zoom_mode_ == ZoomMode::kManual +double WebContentsZoomController::GetZoomLevel() const { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + return zoom_mode_ == ZOOM_MODE_MANUAL ? zoom_level_ : content::HostZoomMap::GetZoomLevel(web_contents()); } @@ -95,32 +146,44 @@ double WebContentsZoomController::GetDefaultZoomFactor() { } void WebContentsZoomController::SetTemporaryZoomLevel(double level) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); content::GlobalRenderFrameHostId old_rfh_id_ = web_contents()->GetPrimaryMainFrame()->GetGlobalId(); host_zoom_map_->SetTemporaryZoomLevel(old_rfh_id_, level); + // Notify observers of zoom level changes. - for (Observer& observer : observers_) - observer.OnZoomLevelChanged(web_contents(), level, true); + ZoomChangedEventData zoom_change_data(web_contents(), zoom_level_, level, + true /* temporary */, zoom_mode_); + for (WebContentsZoomObserver& observer : observers_) + observer.OnZoomChanged(zoom_change_data); } bool WebContentsZoomController::UsesTemporaryZoomLevel() { + DCHECK_CURRENTLY_ON(BrowserThread::UI); content::GlobalRenderFrameHostId rfh_id = web_contents()->GetPrimaryMainFrame()->GetGlobalId(); return host_zoom_map_->UsesTemporaryZoomLevel(rfh_id); } void WebContentsZoomController::SetZoomMode(ZoomMode new_mode) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (new_mode == zoom_mode_) return; content::HostZoomMap* zoom_map = content::HostZoomMap::GetForWebContents(web_contents()); + DCHECK(zoom_map); content::GlobalRenderFrameHostId rfh_id = web_contents()->GetPrimaryMainFrame()->GetGlobalId(); double original_zoom_level = GetZoomLevel(); + DCHECK(!event_data_); + event_data_ = std::make_unique( + web_contents(), original_zoom_level, original_zoom_level, + false /* temporary */, new_mode); + switch (new_mode) { - case ZoomMode::kDefault: { + case ZOOM_MODE_DEFAULT: { content::NavigationEntry* entry = web_contents()->GetController().GetLastCommittedEntry(); @@ -135,6 +198,7 @@ void WebContentsZoomController::SetZoomMode(ZoomMode new_mode) { // the correct zoom level. double origin_zoom_level = zoom_map->GetZoomLevelForHostAndScheme(url.scheme(), host); + event_data_->new_zoom_level = origin_zoom_level; zoom_map->SetTemporaryZoomLevel(rfh_id, origin_zoom_level); } else { // The host will need a level prior to removing the temporary level. @@ -147,101 +211,128 @@ void WebContentsZoomController::SetZoomMode(ZoomMode new_mode) { zoom_map->ClearTemporaryZoomLevel(rfh_id); break; } - case ZoomMode::kIsolated: { - // Unless the zoom mode was |ZoomMode::kDisabled| before this call, the + case ZOOM_MODE_ISOLATED: { + // Unless the zoom mode was |ZOOM_MODE_DISABLED| before this call, the // page needs an initial isolated zoom back to the same level it was at // in the other mode. - if (zoom_mode_ != ZoomMode::kDisabled) { + if (zoom_mode_ != ZOOM_MODE_DISABLED) { zoom_map->SetTemporaryZoomLevel(rfh_id, original_zoom_level); } else { // When we don't call any HostZoomMap set functions, we send the event // manually. - for (Observer& observer : observers_) - observer.OnZoomLevelChanged(web_contents(), original_zoom_level, - false); + for (auto& observer : observers_) + observer.OnZoomChanged(*event_data_); + event_data_.reset(); } break; } - case ZoomMode::kManual: { - // Unless the zoom mode was |ZoomMode::kDisabled| before this call, the + case ZOOM_MODE_MANUAL: { + // Unless the zoom mode was |ZOOM_MODE_DISABLED| before this call, the // page needs to be resized to the default zoom. While in manual mode, // the zoom level is handled independently. - if (zoom_mode_ != ZoomMode::kDisabled) { + if (zoom_mode_ != ZOOM_MODE_DISABLED) { zoom_map->SetTemporaryZoomLevel(rfh_id, GetDefaultZoomLevel()); zoom_level_ = original_zoom_level; } else { // When we don't call any HostZoomMap set functions, we send the event // manually. - for (Observer& observer : observers_) - observer.OnZoomLevelChanged(web_contents(), original_zoom_level, - false); + for (auto& observer : observers_) + observer.OnZoomChanged(*event_data_); + event_data_.reset(); } break; } - case ZoomMode::kDisabled: { + case ZOOM_MODE_DISABLED: { // The page needs to be zoomed back to default before disabling the zoom - zoom_map->SetTemporaryZoomLevel(rfh_id, GetDefaultZoomLevel()); + double new_zoom_level = GetDefaultZoomLevel(); + event_data_->new_zoom_level = new_zoom_level; + zoom_map->SetTemporaryZoomLevel(rfh_id, new_zoom_level); break; } } + // Any event data we've stored should have been consumed by this point. + DCHECK(!event_data_); zoom_mode_ = new_mode; } void WebContentsZoomController::ResetZoomModeOnNavigationIfNeeded( const GURL& url) { - if (zoom_mode_ != ZoomMode::kIsolated && zoom_mode_ != ZoomMode::kManual) + DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (zoom_mode_ != ZOOM_MODE_ISOLATED && zoom_mode_ != ZOOM_MODE_MANUAL) return; - content::GlobalRenderFrameHostId rfh_id = - web_contents()->GetPrimaryMainFrame()->GetGlobalId(); content::HostZoomMap* zoom_map = content::HostZoomMap::GetForWebContents(web_contents()); zoom_level_ = zoom_map->GetDefaultZoomLevel(); + double old_zoom_level = zoom_map->GetZoomLevel(web_contents()); double new_zoom_level = zoom_map->GetZoomLevelForHostAndScheme( url.scheme(), net::GetHostOrSpecFromURL(url)); - for (Observer& observer : observers_) - observer.OnZoomLevelChanged(web_contents(), new_zoom_level, false); - zoom_map->ClearTemporaryZoomLevel(rfh_id); - zoom_mode_ = ZoomMode::kDefault; + event_data_ = std::make_unique( + web_contents(), old_zoom_level, new_zoom_level, false, ZOOM_MODE_DEFAULT); + // The call to ClearTemporaryZoomLevel() doesn't generate any events from + // HostZoomMap, but the call to UpdateState() at the end of + // DidFinishNavigation will notify our observers. + // Note: it's possible the render_process/frame ids have disappeared (e.g. + // if we navigated to a new origin), but this won't cause a problem in the + // call below. + zoom_map->ClearTemporaryZoomLevel( + web_contents()->GetPrimaryMainFrame()->GetGlobalId()); + zoom_mode_ = ZOOM_MODE_DEFAULT; } void WebContentsZoomController::DidFinishNavigation( content::NavigationHandle* navigation_handle) { - if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) + DCHECK_CURRENTLY_ON(BrowserThread::UI); + if (!navigation_handle->IsInPrimaryMainFrame() || + !navigation_handle->HasCommitted()) { return; + } - if (navigation_handle->IsErrorPage()) { + if (navigation_handle->IsErrorPage()) content::HostZoomMap::SendErrorPageZoomLevelRefresh(web_contents()); - return; + + if (!navigation_handle->IsSameDocument()) { + ResetZoomModeOnNavigationIfNeeded(navigation_handle->GetURL()); + SetZoomFactorOnNavigationIfNeeded(navigation_handle->GetURL()); } - ResetZoomModeOnNavigationIfNeeded(navigation_handle->GetURL()); - SetZoomFactorOnNavigationIfNeeded(navigation_handle->GetURL()); + // If the main frame's content has changed, the new page may have a different + // zoom level from the old one. + UpdateState(std::string()); + DCHECK(!event_data_); } void WebContentsZoomController::WebContentsDestroyed() { - for (Observer& observer : observers_) - observer.OnZoomControllerWebContentsDestroyed(); + DCHECK_CURRENTLY_ON(BrowserThread::UI); + // At this point we should no longer be sending any zoom events with this + // WebContents. + for (auto& observer : observers_) { + observer.OnZoomControllerDestroyed(this); + } - observers_.Clear(); embedder_zoom_controller_ = nullptr; } void WebContentsZoomController::RenderFrameHostChanged( content::RenderFrameHost* old_host, content::RenderFrameHost* new_host) { - // If our associated HostZoomMap changes, update our event subscription. + DCHECK_CURRENTLY_ON(BrowserThread::UI); + // If our associated HostZoomMap changes, update our subscription. content::HostZoomMap* new_host_zoom_map = content::HostZoomMap::GetForWebContents(web_contents()); if (new_host_zoom_map == host_zoom_map_) return; host_zoom_map_ = new_host_zoom_map; + zoom_subscription_ = host_zoom_map_->AddZoomLevelChangedCallback( + base::BindRepeating(&WebContentsZoomController::OnZoomLevelChanged, + base::Unretained(this))); } void WebContentsZoomController::SetZoomFactorOnNavigationIfNeeded( const GURL& url) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (blink::PageZoomValuesEqual(GetDefaultZoomFactor(), kPageZoomEpsilon)) return; @@ -276,6 +367,42 @@ void WebContentsZoomController::SetZoomFactorOnNavigationIfNeeded( SetZoomLevel(zoom_level); } +void WebContentsZoomController::OnZoomLevelChanged( + const content::HostZoomMap::ZoomLevelChange& change) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + UpdateState(change.host); +} + +void WebContentsZoomController::UpdateState(const std::string& host) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + // If |host| is empty, all observers should be updated. + if (!host.empty()) { + // Use the navigation entry's URL instead of the WebContents' so virtual + // URLs work (e.g. chrome://settings). http://crbug.com/153950 + content::NavigationEntry* entry = + web_contents()->GetController().GetLastCommittedEntry(); + if (!entry || host != net::GetHostOrSpecFromURL( + content::HostZoomMap::GetURLFromEntry(entry))) { + return; + } + } + + if (event_data_) { + // For state changes initiated within the ZoomController, information about + // the change should be sent. + ZoomChangedEventData zoom_change_data = *event_data_; + event_data_.reset(); + for (auto& observer : observers_) + observer.OnZoomChanged(zoom_change_data); + } else { + double zoom_level = GetZoomLevel(); + ZoomChangedEventData zoom_change_data(web_contents(), zoom_level, + zoom_level, false, zoom_mode_); + for (auto& observer : observers_) + observer.OnZoomChanged(zoom_change_data); + } +} + WEB_CONTENTS_USER_DATA_KEY_IMPL(WebContentsZoomController); } // namespace electron diff --git a/shell/browser/web_contents_zoom_controller.h b/shell/browser/web_contents_zoom_controller.h index c8e912464857f..dcfe20b27da9d 100644 --- a/shell/browser/web_contents_zoom_controller.h +++ b/shell/browser/web_contents_zoom_controller.h @@ -14,40 +14,49 @@ namespace electron { +class WebContentsZoomObserver; + // Manages the zoom changes of WebContents. class WebContentsZoomController : public content::WebContentsObserver, public content::WebContentsUserData { public: - class Observer : public base::CheckedObserver { - public: - virtual void OnZoomLevelChanged(content::WebContents* web_contents, - double level, - bool is_temporary) {} - virtual void OnZoomControllerWebContentsDestroyed() {} - - protected: - ~Observer() override {} - }; - // Defines how zoom changes are handled. - enum class ZoomMode { + enum ZoomMode { // Results in default zoom behavior, i.e. zoom changes are handled // automatically and on a per-origin basis, meaning that other tabs // navigated to the same origin will also zoom. - kDefault, + ZOOM_MODE_DEFAULT, // Results in zoom changes being handled automatically, but on a per-tab // basis. Tabs in this zoom mode will not be affected by zoom changes in // other tabs, and vice versa. - kIsolated, + ZOOM_MODE_ISOLATED, // Overrides the automatic handling of zoom changes. The |onZoomChange| // event will still be dispatched, but the page will not actually be zoomed. // These zoom changes can be handled manually by listening for the // |onZoomChange| event. Zooming in this mode is also on a per-tab basis. - kManual, + ZOOM_MODE_MANUAL, // Disables all zooming in this tab. The tab will revert to the default // zoom level, and all attempted zoom changes will be ignored. - kDisabled, + ZOOM_MODE_DISABLED, + }; + + struct ZoomChangedEventData { + ZoomChangedEventData(content::WebContents* web_contents, + double old_zoom_level, + double new_zoom_level, + bool temporary, + WebContentsZoomController::ZoomMode zoom_mode) + : web_contents(web_contents), + old_zoom_level(old_zoom_level), + new_zoom_level(new_zoom_level), + temporary(temporary), + zoom_mode(zoom_mode) {} + raw_ptr web_contents; + double old_zoom_level; + double new_zoom_level; + bool temporary; + WebContentsZoomController::ZoomMode zoom_mode; }; explicit WebContentsZoomController(content::WebContents* web_contents); @@ -58,24 +67,29 @@ class WebContentsZoomController WebContentsZoomController& operator=(const WebContentsZoomController&) = delete; - void AddObserver(Observer* observer); - void RemoveObserver(Observer* observer); + void AddObserver(WebContentsZoomObserver* observer); + void RemoveObserver(WebContentsZoomObserver* observer); void SetEmbedderZoomController(WebContentsZoomController* controller); - // Methods for managing zoom levels. - void SetZoomLevel(double level); - double GetZoomLevel(); + // Gets the current zoom level by querying HostZoomMap (if not in manual zoom + // mode) or from the ZoomController local value otherwise. + double GetZoomLevel() const; + + // Sets the zoom level through HostZoomMap. + // Returns true on success. + bool SetZoomLevel(double zoom_level); + void SetDefaultZoomFactor(double factor); double GetDefaultZoomFactor(); + + // Sets the temporary zoom level through HostZoomMap. void SetTemporaryZoomLevel(double level); bool UsesTemporaryZoomLevel(); // Sets the zoom mode, which defines zoom behavior (see enum ZoomMode). void SetZoomMode(ZoomMode zoom_mode); - void ResetZoomModeOnNavigationIfNeeded(const GURL& url); - ZoomMode zoom_mode() const { return zoom_mode_; } // Convenience method to get default zoom level. Implemented here for @@ -86,8 +100,9 @@ class WebContentsZoomController } protected: - // content::WebContentsObserver: - void DidFinishNavigation(content::NavigationHandle* handle) override; + // content::WebContentsObserver overrides: + void DidFinishNavigation( + content::NavigationHandle* navigation_handle) override; void WebContentsDestroyed() override; void RenderFrameHostChanged(content::RenderFrameHost* old_host, content::RenderFrameHost* new_host) override; @@ -95,29 +110,40 @@ class WebContentsZoomController private: friend class content::WebContentsUserData; - // Called after a navigation has committed to set default zoom factor. + void ResetZoomModeOnNavigationIfNeeded(const GURL& url); void SetZoomFactorOnNavigationIfNeeded(const GURL& url); + void OnZoomLevelChanged(const content::HostZoomMap::ZoomLevelChange& change); - // The current zoom mode. - ZoomMode zoom_mode_ = ZoomMode::kDefault; + // Updates the zoom icon and zoom percentage based on current values and + // notifies the observer if changes have occurred. |host| may be empty, + // meaning the change should apply to ~all sites. If it is not empty, the + // change only affects sites with the given host. + void UpdateState(const std::string& host); - // Current zoom level. - double zoom_level_ = 1.0; + // The current zoom mode. + ZoomMode zoom_mode_ = ZOOM_MODE_DEFAULT; - // kZoomFactor. - double default_zoom_factor_ = 0; + // The current zoom level. + double zoom_level_; - const double kPageZoomEpsilon = 0.001; + // The current default zoom factor. + double default_zoom_factor_; int old_process_id_ = -1; int old_view_id_ = -1; + std::unique_ptr event_data_; + raw_ptr embedder_zoom_controller_ = nullptr; - base::ObserverList observers_; + // Observer receiving notifications on state changes. + base::ObserverList observers_; + // Keep track of the HostZoomMap we're currently subscribed to. raw_ptr host_zoom_map_; + base::CallbackListSubscription zoom_subscription_; + WEB_CONTENTS_USER_DATA_KEY_DECL(); }; diff --git a/shell/browser/web_contents_zoom_observer.h b/shell/browser/web_contents_zoom_observer.h new file mode 100644 index 0000000000000..fe95e06f1d5be --- /dev/null +++ b/shell/browser/web_contents_zoom_observer.h @@ -0,0 +1,29 @@ +// Copyright (c) 2023 Microsoft, GmbH +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef ELECTRON_SHELL_BROWSER_WEB_CONTENTS_ZOOM_OBSERVER_H_ +#define ELECTRON_SHELL_BROWSER_WEB_CONTENTS_ZOOM_OBSERVER_H_ + +#include "shell/browser/web_contents_zoom_controller.h" + +namespace electron { + +// Interface for objects that wish to be notified of changes in +// WebContentsZoomController. +class WebContentsZoomObserver : public base::CheckedObserver { + public: + // Fired when the ZoomController is destructed. Observers should deregister + // themselves from the ZoomObserver in this event handler. Note that + // ZoomController::FromWebContents() returns nullptr at this point already. + virtual void OnZoomControllerDestroyed( + WebContentsZoomController* zoom_controller) = 0; + + // Notification that the zoom percentage has changed. + virtual void OnZoomChanged( + const WebContentsZoomController::ZoomChangedEventData& data) {} +}; + +} // namespace electron + +#endif // ELECTRON_SHELL_BROWSER_WEB_CONTENTS_ZOOM_OBSERVER_H_ diff --git a/shell/browser/web_view_guest_delegate.cc b/shell/browser/web_view_guest_delegate.cc index e67c84f1b7fa4..686095bc2ee45 100644 --- a/shell/browser/web_view_guest_delegate.cc +++ b/shell/browser/web_view_guest_delegate.cc @@ -73,23 +73,23 @@ content::WebContents* WebViewGuestDelegate::GetOwnerWebContents() { return embedder_web_contents_; } -void WebViewGuestDelegate::OnZoomLevelChanged( - content::WebContents* web_contents, - double level, - bool is_temporary) { - if (web_contents == GetOwnerWebContents()) { - if (is_temporary) { - api_web_contents_->GetZoomController()->SetTemporaryZoomLevel(level); +void WebViewGuestDelegate::OnZoomChanged( + const WebContentsZoomController::ZoomChangedEventData& data) { + if (data.web_contents == GetOwnerWebContents()) { + if (data.temporary) { + api_web_contents_->GetZoomController()->SetTemporaryZoomLevel( + data.new_zoom_level); } else { - api_web_contents_->GetZoomController()->SetZoomLevel(level); + api_web_contents_->GetZoomController()->SetZoomLevel(data.new_zoom_level); } // Change the default zoom factor to match the embedders' new zoom level. - double zoom_factor = blink::PageZoomLevelToZoomFactor(level); + double zoom_factor = blink::PageZoomLevelToZoomFactor(data.new_zoom_level); api_web_contents_->GetZoomController()->SetDefaultZoomFactor(zoom_factor); } } -void WebViewGuestDelegate::OnZoomControllerWebContentsDestroyed() { +void WebViewGuestDelegate::OnZoomControllerDestroyed( + WebContentsZoomController* zoom_controller) { ResetZoomController(); } diff --git a/shell/browser/web_view_guest_delegate.h b/shell/browser/web_view_guest_delegate.h index 0fcde0083100d..9d7a968e83699 100644 --- a/shell/browser/web_view_guest_delegate.h +++ b/shell/browser/web_view_guest_delegate.h @@ -10,6 +10,7 @@ #include "base/memory/raw_ptr.h" #include "content/public/browser/browser_plugin_guest_delegate.h" #include "shell/browser/web_contents_zoom_controller.h" +#include "shell/browser/web_contents_zoom_observer.h" namespace electron { @@ -18,7 +19,7 @@ class WebContents; } class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate, - public WebContentsZoomController::Observer { + public WebContentsZoomObserver { public: WebViewGuestDelegate(content::WebContents* embedder, api::WebContents* api_web_contents); @@ -41,11 +42,11 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate, base::WeakPtr GetGuestDelegateWeakPtr() final; - // WebContentsZoomController::Observer: - void OnZoomLevelChanged(content::WebContents* web_contents, - double level, - bool is_temporary) override; - void OnZoomControllerWebContentsDestroyed() override; + // WebContentsZoomObserver: + void OnZoomControllerDestroyed( + WebContentsZoomController* zoom_controller) override; + void OnZoomChanged( + const WebContentsZoomController::ZoomChangedEventData& data) override; private: void ResetZoomController(); From c857fc4e087896f9a9d337b92db7ba0813e468a0 Mon Sep 17 00:00:00 2001 From: wgsheng <88312105+wugaosheng123@users.noreply.github.com> Date: Tue, 15 Aug 2023 13:32:53 +0800 Subject: [PATCH 62/93] feat: add a 'title' parameter to `openDevTools()` (#39047) * [Feature Request]: Add a parameter to openDevTools() that sets the DevTools window title bar * all titles->title * add GetDevToolsTitle(),update docs * fix:lint error * fix:lint error * add setDevToolTitle * lint errror * lint errror * ling errror (.md) * build error * build error in mac * build error * build error * change docs * std::string->std::u16string * lint error * build error * build error --- docs/api/web-contents.md | 13 ++++++++++++ .../browser/api/electron_api_web_contents.cc | 17 +++++++++++++++ shell/browser/api/electron_api_web_contents.h | 2 ++ .../electron_inspectable_web_contents_view.h | 1 + .../electron_inspectable_web_contents_view.mm | 4 ++++ shell/browser/ui/inspectable_web_contents.cc | 21 ++++++++++++++++--- shell/browser/ui/inspectable_web_contents.h | 3 +++ .../ui/inspectable_web_contents_view.h | 1 + .../ui/inspectable_web_contents_view_mac.h | 1 + .../ui/inspectable_web_contents_view_mac.mm | 4 ++++ .../inspectable_web_contents_view_views.cc | 4 ++++ .../inspectable_web_contents_view_views.h | 3 +-- spec/api-web-contents-spec.ts | 21 +++++++++++++++++++ 13 files changed, 90 insertions(+), 5 deletions(-) diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index 3e1770d91f556..d4aac970368eb 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -1777,6 +1777,7 @@ app.whenReady().then(() => { In `undocked` mode it's possible to dock back. In `detach` mode it's not. * `activate` boolean (optional) - Whether to bring the opened devtools window to the foreground. The default is `true`. + * `title` string (optional) - A title for the DevTools window (only in `undocked` or `detach` mode). Opens the devtools. @@ -1797,6 +1798,18 @@ Returns `boolean` - Whether the devtools is opened. Returns `boolean` - Whether the devtools view is focused . +#### `contents.getDevToolsTitle()` + +Returns `string` - the current title of the DevTools window. This will only be visible +if DevTools is opened in `undocked` or `detach` mode. + +#### `contents.setDevToolsTitle(title)` + +* `title` string + +Changes the title of the DevTools window to `title`. This will only be visible if DevTools is +opened in `undocked` or `detach` mode. + #### `contents.toggleDevTools()` Toggles the developer tools. diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 479a76a469a9a..e4253d2466495 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -2649,16 +2649,19 @@ void WebContents::OpenDevTools(gin::Arguments* args) { #endif bool activate = true; + std::string title; if (args && args->Length() == 1) { gin_helper::Dictionary options; if (args->GetNext(&options)) { options.Get("mode", &state); options.Get("activate", &activate); + options.Get("title", &title); } } DCHECK(inspectable_web_contents_); inspectable_web_contents_->SetDockState(state); + inspectable_web_contents_->SetDevToolsTitle(base::UTF8ToUTF16(title)); inspectable_web_contents_->ShowDevTools(activate); } @@ -2678,6 +2681,18 @@ bool WebContents::IsDevToolsOpened() { return inspectable_web_contents_->IsDevToolsViewShowing(); } +std::u16string WebContents::GetDevToolsTitle() { + if (type_ == Type::kRemote) + return std::u16string(); + + DCHECK(inspectable_web_contents_); + return inspectable_web_contents_->GetDevToolsTitle(); +} + +void WebContents::SetDevToolsTitle(const std::u16string& title) { + inspectable_web_contents_->SetDevToolsTitle(title); +} + bool WebContents::IsDevToolsFocused() { if (type_ == Type::kRemote) return false; @@ -4214,6 +4229,8 @@ void WebContents::FillObjectTemplate(v8::Isolate* isolate, .SetMethod("closeDevTools", &WebContents::CloseDevTools) .SetMethod("isDevToolsOpened", &WebContents::IsDevToolsOpened) .SetMethod("isDevToolsFocused", &WebContents::IsDevToolsFocused) + .SetMethod("getDevToolsTitle", &WebContents::GetDevToolsTitle) + .SetMethod("setDevToolsTitle", &WebContents::SetDevToolsTitle) .SetMethod("enableDeviceEmulation", &WebContents::EnableDeviceEmulation) .SetMethod("disableDeviceEmulation", &WebContents::DisableDeviceEmulation) .SetMethod("toggleDevTools", &WebContents::ToggleDevTools) diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index fee6f4422458c..ae3d9ecd19af3 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -201,6 +201,8 @@ class WebContents : public ExclusiveAccessContext, void CloseDevTools(); bool IsDevToolsOpened(); bool IsDevToolsFocused(); + std::u16string GetDevToolsTitle(); + void SetDevToolsTitle(const std::u16string& title); void ToggleDevTools(); void EnableDeviceEmulation(const blink::DeviceEmulationParams& params); void DisableDeviceEmulation(); diff --git a/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h b/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h index 5d9d3b1b2ce9d..9492feeab0869 100644 --- a/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h +++ b/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h @@ -50,6 +50,7 @@ using electron::InspectableWebContentsViewMac; - (void)setContentsResizingStrategy: (const DevToolsContentsResizingStrategy&)strategy; - (void)setTitle:(NSString*)title; +- (NSString*)getTitle; - (void)redispatchContextMenuEvent:(base::apple::OwnedNSEvent)theEvent; diff --git a/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm b/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm index 7e895183ae840..edaa6f1e319f4 100644 --- a/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm +++ b/shell/browser/ui/cocoa/electron_inspectable_web_contents_view.mm @@ -244,6 +244,10 @@ - (void)setTitle:(NSString*)title { [devtools_window_ setTitle:title]; } +- (NSString*)getTitle { + return [devtools_window_ title]; +} + - (void)viewDidBecomeFirstResponder:(NSNotification*)notification { auto* inspectable_web_contents = inspectableWebContentsView_->inspectable_web_contents(); diff --git a/shell/browser/ui/inspectable_web_contents.cc b/shell/browser/ui/inspectable_web_contents.cc index a0406e8aeadf4..c718ab3249481 100644 --- a/shell/browser/ui/inspectable_web_contents.cc +++ b/shell/browser/ui/inspectable_web_contents.cc @@ -426,6 +426,11 @@ void InspectableWebContents::SetDockState(const std::string& state) { } } +void InspectableWebContents::SetDevToolsTitle(const std::u16string& title) { + devtools_title_ = title; + view_->SetTitle(devtools_title_); +} + void InspectableWebContents::SetDevToolsWebContents( content::WebContents* devtools) { if (!managed_devtools_web_contents_) @@ -481,6 +486,10 @@ bool InspectableWebContents::IsDevToolsViewShowing() { return managed_devtools_web_contents_ && view_->IsDevToolsViewShowing(); } +std::u16string InspectableWebContents::GetDevToolsTitle() { + return view_->GetTitle(); +} + void InspectableWebContents::AttachTo( scoped_refptr host) { Detach(); @@ -565,6 +574,9 @@ void InspectableWebContents::LoadCompleted() { // If the devtools can dock, "SetIsDocked" will be called by devtools itself. if (!can_dock_) { SetIsDocked(DispatchCallback(), false); + if (!devtools_title_.empty()) { + view_->SetTitle(devtools_title_); + } } else { if (dock_state_.empty()) { const base::Value::Dict& prefs = @@ -635,9 +647,12 @@ void InspectableWebContents::SetInspectedPageBounds(const gfx::Rect& rect) { void InspectableWebContents::InspectElementCompleted() {} void InspectableWebContents::InspectedURLChanged(const std::string& url) { - if (managed_devtools_web_contents_) - view_->SetTitle( - base::UTF8ToUTF16(base::StringPrintf(kTitleFormat, url.c_str()))); + if (managed_devtools_web_contents_) { + if (devtools_title_.empty()) { + view_->SetTitle( + base::UTF8ToUTF16(base::StringPrintf(kTitleFormat, url.c_str()))); + } + } } void InspectableWebContents::LoadNetworkResource(DispatchCallback callback, diff --git a/shell/browser/ui/inspectable_web_contents.h b/shell/browser/ui/inspectable_web_contents.h index c5815528c5798..8bf0df37082cb 100644 --- a/shell/browser/ui/inspectable_web_contents.h +++ b/shell/browser/ui/inspectable_web_contents.h @@ -59,9 +59,11 @@ class InspectableWebContents void ReleaseWebContents(); void SetDevToolsWebContents(content::WebContents* devtools); void SetDockState(const std::string& state); + void SetDevToolsTitle(const std::u16string& title); void ShowDevTools(bool activate); void CloseDevTools(); bool IsDevToolsViewShowing(); + std::u16string GetDevToolsTitle(); void AttachTo(scoped_refptr); void Detach(); void CallClientFunction( @@ -207,6 +209,7 @@ class InspectableWebContents gfx::Rect devtools_bounds_; bool can_dock_ = true; std::string dock_state_; + std::u16string devtools_title_; bool activate_ = true; raw_ptr delegate_ = diff --git a/shell/browser/ui/inspectable_web_contents_view.h b/shell/browser/ui/inspectable_web_contents_view.h index 46cbda331219d..c18b8a1de05b5 100644 --- a/shell/browser/ui/inspectable_web_contents_view.h +++ b/shell/browser/ui/inspectable_web_contents_view.h @@ -57,6 +57,7 @@ class InspectableWebContentsView { virtual void SetContentsResizingStrategy( const DevToolsContentsResizingStrategy& strategy) = 0; virtual void SetTitle(const std::u16string& title) = 0; + virtual const std::u16string GetTitle() = 0; protected: // Owns us. diff --git a/shell/browser/ui/inspectable_web_contents_view_mac.h b/shell/browser/ui/inspectable_web_contents_view_mac.h index 7021097af02b3..46ab871d8e0cb 100644 --- a/shell/browser/ui/inspectable_web_contents_view_mac.h +++ b/shell/browser/ui/inspectable_web_contents_view_mac.h @@ -34,6 +34,7 @@ class InspectableWebContentsViewMac : public InspectableWebContentsView { void SetContentsResizingStrategy( const DevToolsContentsResizingStrategy& strategy) override; void SetTitle(const std::u16string& title) override; + const std::u16string GetTitle() override; private: ElectronInspectableWebContentsView* __strong view_; diff --git a/shell/browser/ui/inspectable_web_contents_view_mac.mm b/shell/browser/ui/inspectable_web_contents_view_mac.mm index 7f465e173ba95..028aab4bf24e2 100644 --- a/shell/browser/ui/inspectable_web_contents_view_mac.mm +++ b/shell/browser/ui/inspectable_web_contents_view_mac.mm @@ -61,4 +61,8 @@ [view_ setTitle:base::SysUTF16ToNSString(title)]; } +const std::u16string InspectableWebContentsViewMac::GetTitle() { + return base::SysNSStringToUTF16([view_ getTitle]); +} + } // namespace electron diff --git a/shell/browser/ui/views/inspectable_web_contents_view_views.cc b/shell/browser/ui/views/inspectable_web_contents_view_views.cc index b9def2941a150..bb5085c02af82 100644 --- a/shell/browser/ui/views/inspectable_web_contents_view_views.cc +++ b/shell/browser/ui/views/inspectable_web_contents_view_views.cc @@ -209,6 +209,10 @@ void InspectableWebContentsViewViews::SetTitle(const std::u16string& title) { } } +const std::u16string InspectableWebContentsViewViews::GetTitle() { + return title_; +} + void InspectableWebContentsViewViews::Layout() { if (!devtools_web_view_->GetVisible()) { contents_web_view_->SetBoundsRect(GetContentsBounds()); diff --git a/shell/browser/ui/views/inspectable_web_contents_view_views.h b/shell/browser/ui/views/inspectable_web_contents_view_views.h index f3c364b196a26..f5b45008e6085 100644 --- a/shell/browser/ui/views/inspectable_web_contents_view_views.h +++ b/shell/browser/ui/views/inspectable_web_contents_view_views.h @@ -39,12 +39,11 @@ class InspectableWebContentsViewViews : public InspectableWebContentsView, void SetContentsResizingStrategy( const DevToolsContentsResizingStrategy& strategy) override; void SetTitle(const std::u16string& title) override; + const std::u16string GetTitle() override; // views::View: void Layout() override; - const std::u16string& GetTitle() const { return title_; } - private: std::unique_ptr devtools_window_; raw_ptr devtools_window_web_view_ = nullptr; diff --git a/spec/api-web-contents-spec.ts b/spec/api-web-contents-spec.ts index 38f77ece94605..c53115c636cbe 100644 --- a/spec/api-web-contents-spec.ts +++ b/spec/api-web-contents-spec.ts @@ -608,6 +608,27 @@ describe('webContents module', () => { await devtoolsOpened; expect(w.webContents.isDevToolsOpened()).to.be.true(); }); + + it('can show a DevTools window with custom title', async () => { + const w = new BrowserWindow({ show: false }); + const devtoolsOpened = once(w.webContents, 'devtools-opened'); + w.webContents.openDevTools({ mode: 'detach', activate: false, title: 'myTitle' }); + await devtoolsOpened; + expect(w.webContents.getDevToolsTitle()).to.equal('myTitle'); + }); + }); + + describe('setDevToolsTitle() API', () => { + afterEach(closeAllWindows); + it('can set devtools title with function', async () => { + const w = new BrowserWindow({ show: false }); + const devtoolsOpened = once(w.webContents, 'devtools-opened'); + w.webContents.openDevTools({ mode: 'detach', activate: false }); + await devtoolsOpened; + expect(w.webContents.isDevToolsOpened()).to.be.true(); + w.webContents.setDevToolsTitle('newTitle'); + expect(w.webContents.getDevToolsTitle()).to.equal('newTitle'); + }); }); describe('before-input-event event', () => { From ae7efc6b43216d69f5c947436eace29317e05834 Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Tue, 15 Aug 2023 10:06:55 +0200 Subject: [PATCH 63/93] chore: bump node to v18.17.1 (main) (#39457) * chore: bump node in DEPS to v18.17.1 * chore: update patches * policy: disable process.binding() when enabled https://github.com/nodejs/node/commit/d4570fae358693b8f7fec05294b9bb92a966226d --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr --- DEPS | 2 +- patches/node/build_add_gn_build_files.patch | 2 +- ...de_entrypoint_to_be_a_builtin_module.patch | 2 +- .../node/feat_initialize_asar_support.patch | 25 +++++++++++++++++++ .../pass_all_globals_through_require.patch | 2 +- ...dder_overriding_of_internal_fs_calls.patch | 2 +- shell/common/node_bindings.cc | 10 +++----- 7 files changed, 33 insertions(+), 12 deletions(-) diff --git a/DEPS b/DEPS index c44e0dd0e2fdf..229d5a4b9228c 100644 --- a/DEPS +++ b/DEPS @@ -4,7 +4,7 @@ vars = { 'chromium_version': '117.0.5921.0', 'node_version': - 'v18.17.0', + 'v18.17.1', 'nan_version': '16fa32231e2ccd89d2804b3f765319128b20c4ac', 'squirrel.mac_version': diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index ec9b2069a3985..7cd86fd3735f0 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -2185,7 +2185,7 @@ index 0000000000000000000000000000000000000000..4ab828dcbf322a9e28674e48c4a6868b + args = rebase_path(inputs + outputs, root_build_dir) +} diff --git a/src/node_version.h b/src/node_version.h -index 5509ad145e59ce62341a479c2b2fdc377ede1c30..0bbfeabf2966734d5c6b143be89d7a914e7d9b99 100644 +index 1e898ffcc9104bc50079a9850dc89767199c646e..0f5c5f1cc0845b5d005697d8ab1ab6167c541ced 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -89,7 +89,10 @@ 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 01cfadc80b80a..68519aef7eac5 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,7 +8,7 @@ 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 8ce3d78839944ddd15bed299d89aeb61a7fd53e5..b3a54aecb06b07834e38f9c94c5246df31c7a47a 100644 +index 001343b74ce236f89dca030c0fc9dd0299df0b39..6f277daf4ce846f093f634c473daec07939b4558 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -1230,6 +1230,13 @@ Module.prototype._compile = function(content, filename) { diff --git a/patches/node/feat_initialize_asar_support.patch b/patches/node/feat_initialize_asar_support.patch index 972c40956ed20..ccdc9a9bd43fd 100644 --- a/patches/node/feat_initialize_asar_support.patch +++ b/patches/node/feat_initialize_asar_support.patch @@ -5,6 +5,20 @@ Subject: feat: initialize asar support This patch initializes asar support in Node.js. +diff --git a/lib/internal/process/policy.js b/lib/internal/process/policy.js +index 8e07cb92118c84b2bc1156532cae8b033b9a48f4..2073a024ad548fe80e84cafee012b003454d6c93 100644 +--- a/lib/internal/process/policy.js ++++ b/lib/internal/process/policy.js +@@ -39,9 +39,6 @@ module.exports = ObjectFreeze({ + process.binding = function binding(_module) { + throw new ERR_ACCESS_DENIED('process.binding'); + }; +- process._linkedBinding = function _linkedBinding(_module) { +- throw new ERR_ACCESS_DENIED('process._linkedBinding'); +- }; + }, + + get manifest() { diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js index 250a43c5455b4f9ff72dd3a34d5b0aa270f43cc6..2e35cbba2ac02494c44821af395fe0195b1ab6b5 100644 --- a/lib/internal/process/pre_execution.js @@ -27,3 +41,14 @@ index 250a43c5455b4f9ff72dd3a34d5b0aa270f43cc6..2e35cbba2ac02494c44821af395fe019 function patchProcessObject(expandArgv1) { const binding = internalBinding('process_methods'); binding.patchProcessObject(process); +diff --git a/test/fixtures/policy/process-binding/app.js b/test/fixtures/policy/process-binding/app.js +index 16e26d12a160286b1b6aaeb64b15668b05b9865b..a287d0a2363acbf24077eec040116f96ef18a7b3 100644 +--- a/test/fixtures/policy/process-binding/app.js ++++ b/test/fixtures/policy/process-binding/app.js +@@ -5,6 +5,3 @@ const assert = require('assert'); + assert.throws(() => { process.binding(); }, { + code: 'ERR_ACCESS_DENIED' + }); +-assert.throws(() => { process._linkedBinding(); }, { +- code: 'ERR_ACCESS_DENIED' +-}); diff --git a/patches/node/pass_all_globals_through_require.patch b/patches/node/pass_all_globals_through_require.patch index cd9ad3cd452e8..b182bda63fced 100644 --- a/patches/node/pass_all_globals_through_require.patch +++ b/patches/node/pass_all_globals_through_require.patch @@ -6,7 +6,7 @@ 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 ebf53afd41454cd2c87050f3c086a9df7021202b..83702fbab45f57f40319a5bbd7e2c7baf217c384 100644 +index 88bb870a8fd2e5458cd47f76dc88b952de6c0303..4aa672675b5cf16b609d81d360e8be8c1a345bd8 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -142,6 +142,13 @@ const { 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 5d48976d26482..3fdcc9b8c554f 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 @@ -22,7 +22,7 @@ index 07c6d5e9351a96aeca1179c20287dc3fb7ec1eab..13ea68c96fd415f976aab0f291a1b7c6 // release cycle, remove the Proxy and setter and update the // getter to either return a read-only object or always return diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js -index 83702fbab45f57f40319a5bbd7e2c7baf217c384..8ce3d78839944ddd15bed299d89aeb61a7fd53e5 100644 +index 4aa672675b5cf16b609d81d360e8be8c1a345bd8..001343b74ce236f89dca030c0fc9dd0299df0b39 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -94,7 +94,7 @@ const fs = require('fs'); diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index d3670ed269982..63a99e30e9972 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -258,13 +258,9 @@ bool IsAllowedOption(base::StringPiece option) { // See https://nodejs.org/api/cli.html#cli_node_options_options void SetNodeOptions(base::Environment* env) { // Options that are unilaterally disallowed - static constexpr auto disallowed = base::MakeFixedFlatSet({ - "--enable-fips", - "--force-fips", - "--openssl-config", - "--use-bundled-ca", - "--use-openssl-ca", - }); + static constexpr auto disallowed = base::MakeFixedFlatSet( + {"--enable-fips", "--force-fips", "--openssl-config", "--use-bundled-ca", + "--use-openssl-ca", "--experimental-policy"}); static constexpr auto pkg_opts = base::MakeFixedFlatSet({ "--http-parser", From ed21bf224ac34adba42ea967da7549adb26b18f7 Mon Sep 17 00:00:00 2001 From: Robo Date: Tue, 15 Aug 2023 19:19:45 +0900 Subject: [PATCH 64/93] feat: support dns-result-order Node.js cli flag (#39376) * feat: support dns-result-order Node.js cli flag * chore: update docs Co-authored-by: Erick Zhao * chore: remove patch --------- Co-authored-by: Erick Zhao --- docs/api/command-line-switches.md | 9 +++++++ shell/common/node_bindings.cc | 10 +++++--- spec/api-utility-process-spec.ts | 24 +++++++++++++++++++ .../api/utility-process/dns-result-order.js | 3 +++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 spec/fixtures/api/utility-process/dns-result-order.js diff --git a/docs/api/command-line-switches.md b/docs/api/command-line-switches.md index ee5e746420c25..fd63da4f1cbe6 100644 --- a/docs/api/command-line-switches.md +++ b/docs/api/command-line-switches.md @@ -291,6 +291,15 @@ Print stack traces for deprecations. Print stack traces for process warnings (including deprecations). +### `--dns-result-order=order` + +Set the default value of the `verbatim` parameter in the Node.js [`dns.lookup()`](https://nodejs.org/api/dns.html#dnslookuphostname-options-callback) and [`dnsPromises.lookup()`](https://nodejs.org/api/dns.html#dnspromiseslookuphostname-options) functions. The value could be: + +* `ipv4first`: sets default `verbatim` `false`. +* `verbatim`: sets default `verbatim` `true`. + +The default is `verbatim` and `dns.setDefaultResultOrder()` have higher priority than `--dns-result-order`. + [app]: app.md [append-switch]: command-line.md#commandlineappendswitchswitch-value [debugging-main-process]: ../tutorial/debugging-main-process.md diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 63a99e30e9972..766d043059997 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -244,9 +244,13 @@ bool IsAllowedOption(base::StringPiece option) { }); // This should be aligned with what's possible to set via the process object. - static constexpr auto options = base::MakeFixedFlatSet( - {"--trace-warnings", "--trace-deprecation", "--throw-deprecation", - "--no-deprecation"}); + static constexpr auto options = base::MakeFixedFlatSet({ + "--trace-warnings", + "--trace-deprecation", + "--throw-deprecation", + "--no-deprecation", + "--dns-result-order", + }); if (debug_options.contains(option)) return electron::fuses::IsNodeCliInspectEnabled(); diff --git a/spec/api-utility-process-spec.ts b/spec/api-utility-process-spec.ts index 2afaeca61e774..278fbfba62ef2 100644 --- a/spec/api-utility-process-spec.ts +++ b/spec/api-utility-process-spec.ts @@ -257,6 +257,30 @@ describe('utilityProcess module', () => { child.stdout!.on('data', listener); }); + it('supports changing dns verbatim with --dns-result-order', (done) => { + const child = utilityProcess.fork(path.join(fixturesPath, 'dns-result-order.js'), [], { + stdio: 'pipe', + execArgv: ['--dns-result-order=ipv4first'] + }); + + let output = ''; + const cleanup = () => { + child.stderr!.removeListener('data', listener); + child.stdout!.removeListener('data', listener); + child.once('exit', () => { done(); }); + child.kill(); + }; + + const listener = (data: Buffer) => { + output += data; + expect(output.trim()).to.contain('ipv4first', 'default verbatim should be ipv4first'); + cleanup(); + }; + + child.stderr!.on('data', listener); + child.stdout!.on('data', listener); + }); + ifit(process.platform !== 'win32')('supports redirecting stdout to parent process', async () => { const result = 'Output from utility process'; const appProcess = childProcess.spawn(process.execPath, [path.join(fixturesPath, 'inherit-stdout'), `--payload=${result}`]); diff --git a/spec/fixtures/api/utility-process/dns-result-order.js b/spec/fixtures/api/utility-process/dns-result-order.js new file mode 100644 index 0000000000000..74d1219003c6d --- /dev/null +++ b/spec/fixtures/api/utility-process/dns-result-order.js @@ -0,0 +1,3 @@ +const dns = require('node:dns'); +console.log(dns.getDefaultResultOrder()); +process.exit(0); From c47edde73d87bada8ce14cf83256bfad84b643cf Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Tue, 15 Aug 2023 10:49:41 -0500 Subject: [PATCH 65/93] chore: bump chromium to 117.0.5938.0 (main) (#39375) * chore: bump chromium in DEPS to 117.0.5929.0 * chore: bump chromium in DEPS to 117.0.5931.0 * chore: bump chromium in DEPS to 117.0.5932.0 * chore: update patches * 4728317: Prevent PrintRenderFrameHelper from printing when already printing | https://chromium-review.googlesource.com/c/chromium/src/+/4728317 * 4739501: Use base::SequenceBound to manage SerialPortManagerImpl | https://chromium-review.googlesource.com/c/chromium/src/+/4739501 * 4702051: Allow overriding source in install-sysroot.py | https://chromium-review.googlesource.com/c/chromium/src/+/4702051 * chore: update filenames.libcxx.gni * 4727002: Rename "enable_arc2" to "enable_arc" | https://chromium-review.googlesource.com/c/chromium/src/+/4727002 * chore: bump chromium in DEPS to 117.0.5934.0 * 4736873: Rename ColorSpaces methods on display::Display | https://chromium-review.googlesource.com/c/chromium/src/+/4736873 * 4727203: Replace bool with an enum in as suggested in DevtoolsManagerDelegate. | https://chromium-review.googlesource.com/c/chromium/src/+/4727203 * 4744479: [DevTools] Add 'generateTaggedPDF' option to DevTools Page.printToPDF | https://chromium-review.googlesource.com/c/chromium/src/+/4744479 * 4735893: Don't share WebUSB permissions with webviews | https://chromium-review.googlesource.com/c/chromium/src/+/4735893 * revert: update filenames.libcxx.gni * chore: bump chromium in DEPS to 117.0.5936.0 * chore: update patches * 4746465: SAA: Query for embargoed StorageAccess permissions | https://chromium-review.googlesource.com/c/chromium/src/+/4746465 * 4666325: Move buildtools/third_party/lib*/trunk source paths to third_party/lib*/src. | https://chromium-review.googlesource.com/c/chromium/src/+/4666325 * chore: bump chromium in DEPS to 117.0.5938.0 * chore: bump chromium in DEPS to 118.0.5939.0 * chore: update patches * Send line bounds through CursorAnchorInfo on requestCursorUpdate https://chromium-review.googlesource.com/c/chromium/src/+/4394588 * Fixup lint for Move buildtools/third_party/lib*/trunk source paths to third_party/lib*/src * 4700305: [mac] Fix override of CHILD_PROCESS_EXE https://chromium-review.googlesource.com/c/chromium/src/+/4700305 Needed because of 4729689: Reland "Remove redundant existence check in PathService" | https://chromium-review.googlesource.com/c/chromium/src/+/4729689 * 4753759: More consistent icon handling for menus. https://chromium-review.googlesource.com/c/chromium/src/+/4753759 * chore: bump chromium in DEPS to 118.0.5941.0 * chore: update patches * chore: bump chromium in DEPS to 117.0.5938.0 * test: update nan-spec-runner cflags * build: fix isystem include path in nan-spec-runner * fixup! 4666325: Move buildtools/third_party/lib*/trunk source paths to third_party/lib*/src. | https://chromium-review.googlesource.com/c/chromium/src/+/4666325 fix a few more instances of the old path libc++.a and libc++abi.a are still in buildtools/ --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: VerteDinde Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt Co-authored-by: Charles Kerr --- .circleci/config/base.yml | 2 + BUILD.gn | 8 +- DEPS | 5 +- build/zip_libcxx.py | 6 +- chromium_src/BUILD.gn | 2 - filenames.libcxx.gni | 2006 ++++++++--------- filenames.libcxxabi.gni | 8 +- patches/chromium/.patches | 3 - .../add_didinstallconditionalfeatures.patch | 8 +- ...lectron_deps_to_license_credits_file.patch | 4 +- ...er_to_linuxui_getwindowframeprovider.patch | 4 +- ..._scheduler_throttling_per_renderview.patch | 10 +- ..._windows_to_have_different_web_prefs.patch | 20 +- ...leges_in_unsandboxed_child_processes.patch | 2 +- ..._secondary_label_via_simplemenumodel.patch | 10 +- patches/chromium/blink_local_frame.patch | 2 +- ...build_disable_print_content_analysis.patch | 2 +- ..._depend_on_packed_resource_integrity.patch | 14 +- patches/chromium/build_gn.patch | 2 +- .../build_libc_as_static_library.patch | 4 +- ...ld_config_in_the_required_components.patch | 29 +- patches/chromium/can_create_window.patch | 30 +- ...d_buildflag_guard_around_new_include.patch | 2 +- ...hore_add_electron_deps_to_gitignores.patch | 8 +- ...dle_synthetic_mouse_events_for_touch.patch | 4 +- ...rofile_methods_in_chrome_browser_pdf.patch | 6 +- ...screationoverridden_with_full_params.patch | 14 +- patches/chromium/command-ismediakey.patch | 6 +- .../crash_allow_setting_more_options.patch | 6 +- ...e_browser_v8_snapshot_file_name_fuse.patch | 6 +- .../disable_color_correct_rendering.patch | 6 +- .../disable_compositor_recycling.patch | 4 +- patches/chromium/disable_hidden.patch | 8 +- .../chromium/enable_reset_aspect_ratio.patch | 2 +- ...xpose_setuseragent_on_networkcontext.patch | 12 +- .../extend_apply_webpreferences.patch | 2 +- ...dd_set_theme_source_to_allow_apps_to.patch | 10 +- ...e_launch_options_for_service_process.patch | 8 +- ...screen_rendering_with_viz_compositor.patch | 2 +- ...same_application_can_use_safestorage.patch | 8 +- ..._raw_response_headers_from_urlloader.patch | 12 +- ...indows_in_the_current_application_in.patch | 4 +- ...uest_webcontents_to_enter_fullscreen.patch | 4 +- .../fix_aspect_ratio_with_max_size.patch | 4 +- ...ding_non-standard_schemes_in_iframes.patch | 10 +- ...eme_change_during_context_menu_close.patch | 42 - ...ete_SerialPortManager_on_main_thread.patch | 64 - ...board_hides_on_input_blur_in_webview.patch | 8 +- ..._properly_honor_printing_page_ranges.patch | 10 +- ...x_remove_caption-removing_style_call.patch | 2 +- ...from_localframe_requestexecutescript.patch | 22 +- ...t_menu_item_when_opened_via_keyboard.patch | 14 +- patches/chromium/frame_host_manager.patch | 8 +- .../gin_enable_disable_v8_platform.patch | 6 +- ...sync_with_host_os_mac_on_linux_in_ci.patch | 4 +- ...tform_electron_can_call_x11_property.patch | 2 +- ...reate_a_console_if_logging_to_stderr.patch | 2 +- .../mas-cgdisplayusesforcetogray.patch | 4 +- ...as_avoid_usage_of_private_macos_apis.patch | 6 +- .../chromium/mas_blink_no_private_api.patch | 6 +- .../mas_disable_custom_window_frame.patch | 38 +- .../mas_disable_remote_accessibility.patch | 66 +- .../chromium/mas_disable_remote_layer.patch | 32 +- patches/chromium/mas_no_private_api.patch | 40 +- ...determine_if_a_font_is_a_system_font.patch | 6 +- ...emote_certificate_verification_logic.patch | 18 +- .../chromium/notification_provenance.patch | 12 +- ...utofill_colors_to_the_color_pipeline.patch | 6 +- patches/chromium/printing.patch | 155 +- ...r_changes_to_the_webcontentsobserver.patch | 8 +- .../render_widget_host_view_base.patch | 10 +- .../render_widget_host_view_mac.patch | 12 +- .../support_mixed_sandbox_with_zygote.patch | 4 +- patches/chromium/sysroot.patch | 35 - patches/chromium/web_contents.patch | 6 +- patches/chromium/webview_cross_drag.patch | 4 +- patches/chromium/webview_fullscreen.patch | 4 +- patches/v8/build_gn.patch | 8 +- ...export_private_v8_symbols_on_windows.patch | 4 +- script/gen-libc++-filenames.js | 6 +- script/nan-spec-runner.js | 12 +- script/sysroots.json | 21 +- shell/app/electron_main_delegate_mac.mm | 4 +- .../browser/api/electron_api_web_contents.cc | 5 +- shell/browser/electron_browser_main_parts.cc | 10 +- shell/browser/electron_permission_manager.cc | 7 +- shell/browser/electron_permission_manager.h | 3 +- .../osr/osr_render_widget_host_view.cc | 3 +- .../browser/osr/osr_render_widget_host_view.h | 6 +- shell/browser/ui/devtools_manager_delegate.cc | 3 +- shell/browser/ui/devtools_manager_delegate.h | 2 +- shell/browser/usb/electron_usb_delegate.cc | 30 + shell/browser/usb/electron_usb_delegate.h | 2 + shell/common/gin_converters/gfx_converter.cc | 2 +- 94 files changed, 1513 insertions(+), 1600 deletions(-) delete mode 100644 patches/chromium/fix_crash_on_nativetheme_change_during_context_menu_close.patch delete mode 100644 patches/chromium/fix_dont_delete_SerialPortManager_on_main_thread.patch delete mode 100644 patches/chromium/sysroot.patch diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 864ff2e37efa9..18a316cda1b05 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -1432,6 +1432,8 @@ commands: - src/build/linux - src/buildtools/third_party/libc++ - src/buildtools/third_party/libc++abi + - src/third_party/libc++ + - src/third_party/libc++abi - src/out/Default/obj/buildtools/third_party - src/v8/tools/builtins-pgo - steps: << parameters.after-persist >> diff --git a/BUILD.gn b/BUILD.gn index 59395e581d5b9..2577ec5e0abb2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -794,7 +794,6 @@ if (is_mac) { ] configs += [ - "//build/config/compiler:enable_arc", "//electron/build/config:mas_build", "//third_party/electron_node:node_internals", ] @@ -1534,8 +1533,9 @@ dist_zip("libcxx_headers_zip") { data_deps = [ ":libcxx_headers" ] deps = data_deps flatten = true - flatten_relative_to = rebase_path( - "$target_gen_dir/electron_libcxx_include/buildtools/third_party/libc++/trunk", + flatten_relative_to = + rebase_path( + "$target_gen_dir/electron_libcxx_include/third_party/libc++/src", "$root_out_dir") outputs = [ "$root_build_dir/libcxx_headers.zip" ] @@ -1551,7 +1551,7 @@ dist_zip("libcxxabi_headers_zip") { deps = data_deps flatten = true flatten_relative_to = rebase_path( - "$target_gen_dir/electron_libcxxabi_include/buildtools/third_party/libc++abi/trunk", + "$target_gen_dir/electron_libcxxabi_include/third_party/libc++abi/src", "$root_out_dir") outputs = [ "$root_build_dir/libcxxabi_headers.zip" ] diff --git a/DEPS b/DEPS index 229d5a4b9228c..cb72ae85b56c1 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ gclient_gn_args_from = 'src' vars = { 'chromium_version': - '117.0.5921.0', + '117.0.5938.0', 'node_version': 'v18.17.1', 'nan_version': @@ -23,6 +23,9 @@ vars = { 'squirrel_git': 'https://github.com/Squirrel', 'reactiveobjc_git': 'https://github.com/ReactiveCocoa', 'mantle_git': 'https://github.com/Mantle', + + # The path of the sysroots.json file. + 'sysroots_json_path': 'electron/script/sysroots.json', # KEEP IN SYNC WITH utils.js FILE 'yarn_version': '1.15.2', diff --git a/build/zip_libcxx.py b/build/zip_libcxx.py index daa94fc8fb8a5..cf71cc1c27d9c 100644 --- a/build/zip_libcxx.py +++ b/build/zip_libcxx.py @@ -30,8 +30,8 @@ def get_object_files(base_path, archive_name): def main(argv): dist_zip, = argv out_dir = os.path.dirname(dist_zip) - base_path_libcxx = os.path.join(out_dir, 'obj/buildtools/third_party/libc++') - base_path_libcxxabi = os.path.join(out_dir, 'obj/buildtools/third_party/libc++abi') + base_path_libcxx = os.path.join(out_dir, 'obj/third_party/libc++') + base_path_libcxxabi = os.path.join(out_dir, 'obj/third_party/libc++abi') object_files_libcxx = get_object_files(base_path_libcxx, 'libc++.a') object_files_libcxxabi = get_object_files(base_path_libcxxabi, 'libc++abi.a') with zipfile.ZipFile( @@ -44,4 +44,4 @@ def main(argv): z.write(object_file, os.path.relpath(object_file, base_path_libcxxabi)) if __name__ == '__main__': - sys.exit(main(sys.argv[1:])) \ No newline at end of file + sys.exit(main(sys.argv[1:])) diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index e44ed98478748..a6f7bffe752ae 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -354,8 +354,6 @@ if (is_mac) { "//third_party/webrtc_overrides:webrtc_component", "//v8", ] - - configs += [ "//build/config/compiler:enable_arc" ] } } diff --git a/filenames.libcxx.gni b/filenames.libcxx.gni index cc151d8b4055b..1ed348ed87c54 100644 --- a/filenames.libcxx.gni +++ b/filenames.libcxx.gni @@ -1,1006 +1,1006 @@ libcxx_headers = [ - "//buildtools/third_party/libc++/trunk/include/CMakeLists.txt", - "//buildtools/third_party/libc++/trunk/include/__algorithm/adjacent_find.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/all_of.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/any_of.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/binary_search.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/clamp.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/comp.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/comp_ref_type.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/copy_backward.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/copy_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/copy_move_common.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/copy_n.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/count.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/count_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/equal.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/equal_range.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/fill.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/fill_n.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/find.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/find_end.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/find_first_of.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/find_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/find_if_not.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/for_each.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/for_each_n.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/for_each_segment.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/generate.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/generate_n.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/half_positive.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/in_found_result.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/in_fun_result.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/in_in_out_result.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/in_in_result.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/in_out_out_result.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/in_out_result.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/includes.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/inplace_merge.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/is_heap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/is_heap_until.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/is_partitioned.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/is_permutation.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/is_sorted.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/is_sorted_until.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/iter_swap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/iterator_operations.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/lexicographical_compare.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/lexicographical_compare_three_way.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/lower_bound.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/make_heap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/make_projected.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/max.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/max_element.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/merge.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/min.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/min_element.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/min_max_result.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/minmax.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/minmax_element.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/mismatch.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/move.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/move_backward.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/next_permutation.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/none_of.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/nth_element.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/partial_sort.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/partial_sort_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/partition.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/partition_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/partition_point.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pop_heap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/prev_permutation.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_any_all_none_of.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backend.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backend.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/any_of.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/backend.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/fill.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/find_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/for_each.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/merge.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/serial.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/thread.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/transform.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_count.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_fill.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_find.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_for_each.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_frontend_dispatch.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_generate.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_is_partitioned.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_merge.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_replace.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_stable_sort.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/pstl_transform.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/push_heap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_adjacent_find.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_all_of.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_any_of.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_binary_search.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_clamp.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy_backward.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_copy_n.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_count.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_count_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_equal.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_equal_range.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_fill.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_fill_n.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_end.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_first_of.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_find_if_not.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_for_each.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_for_each_n.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_generate.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_generate_n.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_includes.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_inplace_merge.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_heap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_heap_until.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_partitioned.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_permutation.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_sorted.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_is_sorted_until.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_iterator_concept.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_lexicographical_compare.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_lower_bound.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_make_heap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_max.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_max_element.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_merge.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_min.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_min_element.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_minmax.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_minmax_element.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_mismatch.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_move.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_move_backward.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_next_permutation.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_none_of.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_nth_element.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partial_sort.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partial_sort_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partition.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partition_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_partition_point.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_pop_heap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_prev_permutation.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_push_heap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove_copy_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_remove_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace_copy_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_replace_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_reverse.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_reverse_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_rotate.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_rotate_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_sample.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_search.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_search_n.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_difference.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_intersection.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_symmetric_difference.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_set_union.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_shuffle.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_sort.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_sort_heap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_stable_partition.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_stable_sort.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_starts_with.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_swap_ranges.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_transform.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_unique.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_unique_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/ranges_upper_bound.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/remove.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/remove_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/remove_copy_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/remove_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/replace.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/replace_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/replace_copy_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/replace_if.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/reverse.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/reverse_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/rotate.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/rotate_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/sample.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/search.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/search_n.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/set_difference.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/set_intersection.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/set_symmetric_difference.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/set_union.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/shift_left.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/shift_right.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/shuffle.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/sift_down.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/sort.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/sort_heap.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/stable_partition.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/stable_sort.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/swap_ranges.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/three_way_comp_ref_type.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/transform.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/uniform_random_bit_generator_adaptor.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/unique.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/unique_copy.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/unwrap_iter.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/unwrap_range.h", - "//buildtools/third_party/libc++/trunk/include/__algorithm/upper_bound.h", - "//buildtools/third_party/libc++/trunk/include/__assert", - "//buildtools/third_party/libc++/trunk/include/__atomic/aliases.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/atomic.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/atomic_base.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/atomic_flag.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/atomic_init.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/atomic_lock_free.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/atomic_sync.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/check_memory_order.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/contention_t.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/cxx_atomic_impl.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/fence.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/is_always_lock_free.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/kill_dependency.h", - "//buildtools/third_party/libc++/trunk/include/__atomic/memory_order.h", - "//buildtools/third_party/libc++/trunk/include/__availability", - "//buildtools/third_party/libc++/trunk/include/__bit/bit_cast.h", - "//buildtools/third_party/libc++/trunk/include/__bit/bit_ceil.h", - "//buildtools/third_party/libc++/trunk/include/__bit/bit_floor.h", - "//buildtools/third_party/libc++/trunk/include/__bit/bit_log2.h", - "//buildtools/third_party/libc++/trunk/include/__bit/bit_width.h", - "//buildtools/third_party/libc++/trunk/include/__bit/blsr.h", - "//buildtools/third_party/libc++/trunk/include/__bit/byteswap.h", - "//buildtools/third_party/libc++/trunk/include/__bit/countl.h", - "//buildtools/third_party/libc++/trunk/include/__bit/countr.h", - "//buildtools/third_party/libc++/trunk/include/__bit/endian.h", - "//buildtools/third_party/libc++/trunk/include/__bit/has_single_bit.h", - "//buildtools/third_party/libc++/trunk/include/__bit/popcount.h", - "//buildtools/third_party/libc++/trunk/include/__bit/rotate.h", - "//buildtools/third_party/libc++/trunk/include/__bit_reference", - "//buildtools/third_party/libc++/trunk/include/__charconv/chars_format.h", - "//buildtools/third_party/libc++/trunk/include/__charconv/from_chars_integral.h", - "//buildtools/third_party/libc++/trunk/include/__charconv/from_chars_result.h", - "//buildtools/third_party/libc++/trunk/include/__charconv/tables.h", - "//buildtools/third_party/libc++/trunk/include/__charconv/to_chars.h", - "//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_base_10.h", - "//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_floating_point.h", - "//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_integral.h", - "//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_result.h", - "//buildtools/third_party/libc++/trunk/include/__charconv/traits.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/calendar.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/concepts.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/convert_to_timespec.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/convert_to_tm.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/day.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/duration.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/file_clock.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/formatter.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/hh_mm_ss.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/high_resolution_clock.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/literals.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/month.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/month_weekday.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/monthday.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/ostream.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/parser_std_format_spec.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/statically_widen.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/steady_clock.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/system_clock.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/time_point.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/weekday.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/year.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/year_month.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/year_month_day.h", - "//buildtools/third_party/libc++/trunk/include/__chrono/year_month_weekday.h", - "//buildtools/third_party/libc++/trunk/include/__compare/common_comparison_category.h", - "//buildtools/third_party/libc++/trunk/include/__compare/compare_partial_order_fallback.h", - "//buildtools/third_party/libc++/trunk/include/__compare/compare_strong_order_fallback.h", - "//buildtools/third_party/libc++/trunk/include/__compare/compare_three_way.h", - "//buildtools/third_party/libc++/trunk/include/__compare/compare_three_way_result.h", - "//buildtools/third_party/libc++/trunk/include/__compare/compare_weak_order_fallback.h", - "//buildtools/third_party/libc++/trunk/include/__compare/is_eq.h", - "//buildtools/third_party/libc++/trunk/include/__compare/ordering.h", - "//buildtools/third_party/libc++/trunk/include/__compare/partial_order.h", - "//buildtools/third_party/libc++/trunk/include/__compare/strong_order.h", - "//buildtools/third_party/libc++/trunk/include/__compare/synth_three_way.h", - "//buildtools/third_party/libc++/trunk/include/__compare/three_way_comparable.h", - "//buildtools/third_party/libc++/trunk/include/__compare/weak_order.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/arithmetic.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/assignable.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/boolean_testable.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/class_or_enum.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/common_reference_with.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/common_with.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/constructible.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/convertible_to.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/copyable.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/derived_from.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/destructible.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/different_from.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/equality_comparable.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/invocable.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/movable.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/predicate.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/regular.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/relation.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/same_as.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/semiregular.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/swappable.h", - "//buildtools/third_party/libc++/trunk/include/__concepts/totally_ordered.h", - "//buildtools/third_party/libc++/trunk/include/__condition_variable/condition_variable.h", - "//buildtools/third_party/libc++/trunk/include/__config", - "//buildtools/third_party/libc++/trunk/include/__config_site.in", - "//buildtools/third_party/libc++/trunk/include/__coroutine/coroutine_handle.h", - "//buildtools/third_party/libc++/trunk/include/__coroutine/coroutine_traits.h", - "//buildtools/third_party/libc++/trunk/include/__coroutine/noop_coroutine_handle.h", - "//buildtools/third_party/libc++/trunk/include/__coroutine/trivial_awaitables.h", - "//buildtools/third_party/libc++/trunk/include/__debug", - "//buildtools/third_party/libc++/trunk/include/__debug_utils/randomize_range.h", - "//buildtools/third_party/libc++/trunk/include/__debug_utils/strict_weak_ordering_check.h", - "//buildtools/third_party/libc++/trunk/include/__exception/exception.h", - "//buildtools/third_party/libc++/trunk/include/__exception/exception_ptr.h", - "//buildtools/third_party/libc++/trunk/include/__exception/nested_exception.h", - "//buildtools/third_party/libc++/trunk/include/__exception/operations.h", - "//buildtools/third_party/libc++/trunk/include/__exception/terminate.h", - "//buildtools/third_party/libc++/trunk/include/__expected/bad_expected_access.h", - "//buildtools/third_party/libc++/trunk/include/__expected/expected.h", - "//buildtools/third_party/libc++/trunk/include/__expected/unexpect.h", - "//buildtools/third_party/libc++/trunk/include/__expected/unexpected.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/copy_options.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/directory_entry.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/directory_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/directory_options.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/file_status.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/file_time_type.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/file_type.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/filesystem_error.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/operations.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/path.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/path_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/perm_options.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/perms.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/recursive_directory_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/space_info.h", - "//buildtools/third_party/libc++/trunk/include/__filesystem/u8path.h", - "//buildtools/third_party/libc++/trunk/include/__format/buffer.h", - "//buildtools/third_party/libc++/trunk/include/__format/concepts.h", - "//buildtools/third_party/libc++/trunk/include/__format/container_adaptor.h", - "//buildtools/third_party/libc++/trunk/include/__format/enable_insertable.h", - "//buildtools/third_party/libc++/trunk/include/__format/escaped_output_table.h", - "//buildtools/third_party/libc++/trunk/include/__format/extended_grapheme_cluster_table.h", - "//buildtools/third_party/libc++/trunk/include/__format/format_arg.h", - "//buildtools/third_party/libc++/trunk/include/__format/format_arg_store.h", - "//buildtools/third_party/libc++/trunk/include/__format/format_args.h", - "//buildtools/third_party/libc++/trunk/include/__format/format_context.h", - "//buildtools/third_party/libc++/trunk/include/__format/format_error.h", - "//buildtools/third_party/libc++/trunk/include/__format/format_functions.h", - "//buildtools/third_party/libc++/trunk/include/__format/format_fwd.h", - "//buildtools/third_party/libc++/trunk/include/__format/format_parse_context.h", - "//buildtools/third_party/libc++/trunk/include/__format/format_string.h", - "//buildtools/third_party/libc++/trunk/include/__format/format_to_n_result.h", - "//buildtools/third_party/libc++/trunk/include/__format/formatter.h", - "//buildtools/third_party/libc++/trunk/include/__format/formatter_bool.h", - "//buildtools/third_party/libc++/trunk/include/__format/formatter_char.h", - "//buildtools/third_party/libc++/trunk/include/__format/formatter_floating_point.h", - "//buildtools/third_party/libc++/trunk/include/__format/formatter_integer.h", - "//buildtools/third_party/libc++/trunk/include/__format/formatter_integral.h", - "//buildtools/third_party/libc++/trunk/include/__format/formatter_output.h", - "//buildtools/third_party/libc++/trunk/include/__format/formatter_pointer.h", - "//buildtools/third_party/libc++/trunk/include/__format/formatter_string.h", - "//buildtools/third_party/libc++/trunk/include/__format/formatter_tuple.h", - "//buildtools/third_party/libc++/trunk/include/__format/parser_std_format_spec.h", - "//buildtools/third_party/libc++/trunk/include/__format/range_default_formatter.h", - "//buildtools/third_party/libc++/trunk/include/__format/range_formatter.h", - "//buildtools/third_party/libc++/trunk/include/__format/unicode.h", - "//buildtools/third_party/libc++/trunk/include/__format/width_estimation_table.h", - "//buildtools/third_party/libc++/trunk/include/__functional/binary_function.h", - "//buildtools/third_party/libc++/trunk/include/__functional/binary_negate.h", - "//buildtools/third_party/libc++/trunk/include/__functional/bind.h", - "//buildtools/third_party/libc++/trunk/include/__functional/bind_back.h", - "//buildtools/third_party/libc++/trunk/include/__functional/bind_front.h", - "//buildtools/third_party/libc++/trunk/include/__functional/binder1st.h", - "//buildtools/third_party/libc++/trunk/include/__functional/binder2nd.h", - "//buildtools/third_party/libc++/trunk/include/__functional/boyer_moore_searcher.h", - "//buildtools/third_party/libc++/trunk/include/__functional/compose.h", - "//buildtools/third_party/libc++/trunk/include/__functional/default_searcher.h", - "//buildtools/third_party/libc++/trunk/include/__functional/function.h", - "//buildtools/third_party/libc++/trunk/include/__functional/hash.h", - "//buildtools/third_party/libc++/trunk/include/__functional/identity.h", - "//buildtools/third_party/libc++/trunk/include/__functional/invoke.h", - "//buildtools/third_party/libc++/trunk/include/__functional/is_transparent.h", - "//buildtools/third_party/libc++/trunk/include/__functional/mem_fn.h", - "//buildtools/third_party/libc++/trunk/include/__functional/mem_fun_ref.h", - "//buildtools/third_party/libc++/trunk/include/__functional/not_fn.h", - "//buildtools/third_party/libc++/trunk/include/__functional/operations.h", - "//buildtools/third_party/libc++/trunk/include/__functional/perfect_forward.h", - "//buildtools/third_party/libc++/trunk/include/__functional/pointer_to_binary_function.h", - "//buildtools/third_party/libc++/trunk/include/__functional/pointer_to_unary_function.h", - "//buildtools/third_party/libc++/trunk/include/__functional/ranges_operations.h", - "//buildtools/third_party/libc++/trunk/include/__functional/reference_wrapper.h", - "//buildtools/third_party/libc++/trunk/include/__functional/unary_function.h", - "//buildtools/third_party/libc++/trunk/include/__functional/unary_negate.h", - "//buildtools/third_party/libc++/trunk/include/__functional/weak_result_type.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/array.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/fstream.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/get.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/hash.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/ios.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/istream.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/memory_resource.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/ostream.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/pair.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/span.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/sstream.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/streambuf.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/string.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/string_view.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/subrange.h", - "//buildtools/third_party/libc++/trunk/include/__fwd/tuple.h", - "//buildtools/third_party/libc++/trunk/include/__hash_table", - "//buildtools/third_party/libc++/trunk/include/__ios/fpos.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/access.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/advance.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/back_insert_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/bounded_iter.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/common_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/concepts.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/counted_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/cpp17_iterator_concepts.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/data.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/default_sentinel.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/distance.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/empty.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/erase_if_container.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/front_insert_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/incrementable_traits.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/indirectly_comparable.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/insert_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/istream_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/istreambuf_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/iter_move.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/iter_swap.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/iterator_traits.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/iterator_with_data.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/mergeable.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/move_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/move_sentinel.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/next.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/ostream_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/ostreambuf_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/permutable.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/prev.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/projected.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/readable_traits.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/reverse_access.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/reverse_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/segmented_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/size.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/sortable.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/unreachable_sentinel.h", - "//buildtools/third_party/libc++/trunk/include/__iterator/wrap_iter.h", - "//buildtools/third_party/libc++/trunk/include/__locale", - "//buildtools/third_party/libc++/trunk/include/__locale_dir/locale_base_api/bsd_locale_defaults.h", - "//buildtools/third_party/libc++/trunk/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h", - "//buildtools/third_party/libc++/trunk/include/__locale_dir/locale_base_api/locale_guard.h", - "//buildtools/third_party/libc++/trunk/include/__mbstate_t.h", - "//buildtools/third_party/libc++/trunk/include/__mdspan/extents.h", - "//buildtools/third_party/libc++/trunk/include/__memory/addressof.h", - "//buildtools/third_party/libc++/trunk/include/__memory/align.h", - "//buildtools/third_party/libc++/trunk/include/__memory/aligned_alloc.h", - "//buildtools/third_party/libc++/trunk/include/__memory/allocate_at_least.h", - "//buildtools/third_party/libc++/trunk/include/__memory/allocation_guard.h", - "//buildtools/third_party/libc++/trunk/include/__memory/allocator.h", - "//buildtools/third_party/libc++/trunk/include/__memory/allocator_arg_t.h", - "//buildtools/third_party/libc++/trunk/include/__memory/allocator_destructor.h", - "//buildtools/third_party/libc++/trunk/include/__memory/allocator_traits.h", - "//buildtools/third_party/libc++/trunk/include/__memory/assume_aligned.h", - "//buildtools/third_party/libc++/trunk/include/__memory/auto_ptr.h", - "//buildtools/third_party/libc++/trunk/include/__memory/builtin_new_allocator.h", - "//buildtools/third_party/libc++/trunk/include/__memory/compressed_pair.h", - "//buildtools/third_party/libc++/trunk/include/__memory/concepts.h", - "//buildtools/third_party/libc++/trunk/include/__memory/construct_at.h", - "//buildtools/third_party/libc++/trunk/include/__memory/destruct_n.h", - "//buildtools/third_party/libc++/trunk/include/__memory/pointer_traits.h", - "//buildtools/third_party/libc++/trunk/include/__memory/ranges_construct_at.h", - "//buildtools/third_party/libc++/trunk/include/__memory/ranges_uninitialized_algorithms.h", - "//buildtools/third_party/libc++/trunk/include/__memory/raw_storage_iterator.h", - "//buildtools/third_party/libc++/trunk/include/__memory/shared_ptr.h", - "//buildtools/third_party/libc++/trunk/include/__memory/swap_allocator.h", - "//buildtools/third_party/libc++/trunk/include/__memory/temp_value.h", - "//buildtools/third_party/libc++/trunk/include/__memory/temporary_buffer.h", - "//buildtools/third_party/libc++/trunk/include/__memory/uninitialized_algorithms.h", - "//buildtools/third_party/libc++/trunk/include/__memory/uninitialized_buffer.h", - "//buildtools/third_party/libc++/trunk/include/__memory/unique_ptr.h", - "//buildtools/third_party/libc++/trunk/include/__memory/uses_allocator.h", - "//buildtools/third_party/libc++/trunk/include/__memory/uses_allocator_construction.h", - "//buildtools/third_party/libc++/trunk/include/__memory/voidify.h", - "//buildtools/third_party/libc++/trunk/include/__memory_resource/memory_resource.h", - "//buildtools/third_party/libc++/trunk/include/__memory_resource/monotonic_buffer_resource.h", - "//buildtools/third_party/libc++/trunk/include/__memory_resource/polymorphic_allocator.h", - "//buildtools/third_party/libc++/trunk/include/__memory_resource/pool_options.h", - "//buildtools/third_party/libc++/trunk/include/__memory_resource/synchronized_pool_resource.h", - "//buildtools/third_party/libc++/trunk/include/__memory_resource/unsynchronized_pool_resource.h", - "//buildtools/third_party/libc++/trunk/include/__mutex/lock_guard.h", - "//buildtools/third_party/libc++/trunk/include/__mutex/mutex.h", - "//buildtools/third_party/libc++/trunk/include/__mutex/tag_types.h", - "//buildtools/third_party/libc++/trunk/include/__mutex/unique_lock.h", - "//buildtools/third_party/libc++/trunk/include/__node_handle", - "//buildtools/third_party/libc++/trunk/include/__numeric/accumulate.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/adjacent_difference.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/exclusive_scan.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/gcd_lcm.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/inclusive_scan.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/inner_product.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/iota.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/midpoint.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/partial_sum.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/pstl_reduce.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/pstl_transform_reduce.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/reduce.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/transform_exclusive_scan.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/transform_inclusive_scan.h", - "//buildtools/third_party/libc++/trunk/include/__numeric/transform_reduce.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/algorithm_fwd.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/algorithm_impl.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/execution_defs.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/execution_impl.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/glue_algorithm_defs.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/glue_algorithm_impl.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/glue_memory_defs.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/glue_memory_impl.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/glue_numeric_defs.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/glue_numeric_impl.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/memory_impl.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/numeric_fwd.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/numeric_impl.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/parallel_for.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/parallel_for_each.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/parallel_invoke.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/parallel_merge.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/parallel_reduce.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/parallel_scan.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/parallel_stable_partial_sort.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/parallel_stable_sort.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/parallel_transform_reduce.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/parallel_transform_scan.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/omp/util.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/parallel_backend.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/parallel_backend_omp.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/parallel_backend_serial.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/parallel_backend_tbb.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/parallel_backend_utils.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/unseq_backend_simd.h", - "//buildtools/third_party/libc++/trunk/include/__pstl/internal/utils.h", - "//buildtools/third_party/libc++/trunk/include/__pstl_algorithm", - "//buildtools/third_party/libc++/trunk/include/__pstl_config_site.in", - "//buildtools/third_party/libc++/trunk/include/__pstl_memory", - "//buildtools/third_party/libc++/trunk/include/__pstl_numeric", - "//buildtools/third_party/libc++/trunk/include/__random/bernoulli_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/binomial_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/cauchy_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/chi_squared_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/clamp_to_integral.h", - "//buildtools/third_party/libc++/trunk/include/__random/default_random_engine.h", - "//buildtools/third_party/libc++/trunk/include/__random/discard_block_engine.h", - "//buildtools/third_party/libc++/trunk/include/__random/discrete_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/exponential_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/extreme_value_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/fisher_f_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/gamma_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/generate_canonical.h", - "//buildtools/third_party/libc++/trunk/include/__random/geometric_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/independent_bits_engine.h", - "//buildtools/third_party/libc++/trunk/include/__random/is_seed_sequence.h", - "//buildtools/third_party/libc++/trunk/include/__random/is_valid.h", - "//buildtools/third_party/libc++/trunk/include/__random/knuth_b.h", - "//buildtools/third_party/libc++/trunk/include/__random/linear_congruential_engine.h", - "//buildtools/third_party/libc++/trunk/include/__random/log2.h", - "//buildtools/third_party/libc++/trunk/include/__random/lognormal_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/mersenne_twister_engine.h", - "//buildtools/third_party/libc++/trunk/include/__random/negative_binomial_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/normal_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/piecewise_constant_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/piecewise_linear_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/poisson_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/random_device.h", - "//buildtools/third_party/libc++/trunk/include/__random/ranlux.h", - "//buildtools/third_party/libc++/trunk/include/__random/seed_seq.h", - "//buildtools/third_party/libc++/trunk/include/__random/shuffle_order_engine.h", - "//buildtools/third_party/libc++/trunk/include/__random/student_t_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/subtract_with_carry_engine.h", - "//buildtools/third_party/libc++/trunk/include/__random/uniform_int_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/uniform_random_bit_generator.h", - "//buildtools/third_party/libc++/trunk/include/__random/uniform_real_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__random/weibull_distribution.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/access.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/all.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/as_rvalue_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/common_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/concepts.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/container_compatible_range.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/counted.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/dangling.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/data.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/drop_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/drop_while_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/elements_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/empty.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/empty_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/enable_borrowed_range.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/enable_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/filter_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/from_range.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/iota_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/istream_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/join_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/lazy_split_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/movable_box.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/non_propagating_cache.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/owning_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/range_adaptor.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/rbegin.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/ref_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/rend.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/reverse_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/single_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/size.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/split_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/subrange.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/take_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/take_while_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/transform_view.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/view_interface.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/views.h", - "//buildtools/third_party/libc++/trunk/include/__ranges/zip_view.h", - "//buildtools/third_party/libc++/trunk/include/__split_buffer", - "//buildtools/third_party/libc++/trunk/include/__std_mbstate_t.h", - "//buildtools/third_party/libc++/trunk/include/__stop_token/atomic_unique_lock.h", - "//buildtools/third_party/libc++/trunk/include/__stop_token/intrusive_list_view.h", - "//buildtools/third_party/libc++/trunk/include/__stop_token/intrusive_shared_ptr.h", - "//buildtools/third_party/libc++/trunk/include/__stop_token/stop_callback.h", - "//buildtools/third_party/libc++/trunk/include/__stop_token/stop_source.h", - "//buildtools/third_party/libc++/trunk/include/__stop_token/stop_state.h", - "//buildtools/third_party/libc++/trunk/include/__stop_token/stop_token.h", - "//buildtools/third_party/libc++/trunk/include/__string/char_traits.h", - "//buildtools/third_party/libc++/trunk/include/__string/constexpr_c_functions.h", - "//buildtools/third_party/libc++/trunk/include/__string/extern_template_lists.h", - "//buildtools/third_party/libc++/trunk/include/__support/android/locale_bionic.h", - "//buildtools/third_party/libc++/trunk/include/__support/fuchsia/xlocale.h", - "//buildtools/third_party/libc++/trunk/include/__support/ibm/gettod_zos.h", - "//buildtools/third_party/libc++/trunk/include/__support/ibm/locale_mgmt_zos.h", - "//buildtools/third_party/libc++/trunk/include/__support/ibm/nanosleep.h", - "//buildtools/third_party/libc++/trunk/include/__support/ibm/xlocale.h", - "//buildtools/third_party/libc++/trunk/include/__support/musl/xlocale.h", - "//buildtools/third_party/libc++/trunk/include/__support/newlib/xlocale.h", - "//buildtools/third_party/libc++/trunk/include/__support/openbsd/xlocale.h", - "//buildtools/third_party/libc++/trunk/include/__support/win32/locale_win32.h", - "//buildtools/third_party/libc++/trunk/include/__support/xlocale/__nop_locale_mgmt.h", - "//buildtools/third_party/libc++/trunk/include/__support/xlocale/__posix_l_fallback.h", - "//buildtools/third_party/libc++/trunk/include/__support/xlocale/__strtonum_fallback.h", - "//buildtools/third_party/libc++/trunk/include/__system_error/errc.h", - "//buildtools/third_party/libc++/trunk/include/__system_error/error_category.h", - "//buildtools/third_party/libc++/trunk/include/__system_error/error_code.h", - "//buildtools/third_party/libc++/trunk/include/__system_error/error_condition.h", - "//buildtools/third_party/libc++/trunk/include/__system_error/system_error.h", - "//buildtools/third_party/libc++/trunk/include/__thread/formatter.h", - "//buildtools/third_party/libc++/trunk/include/__thread/poll_with_backoff.h", - "//buildtools/third_party/libc++/trunk/include/__thread/this_thread.h", - "//buildtools/third_party/libc++/trunk/include/__thread/thread.h", - "//buildtools/third_party/libc++/trunk/include/__thread/timed_backoff_policy.h", - "//buildtools/third_party/libc++/trunk/include/__threading_support", - "//buildtools/third_party/libc++/trunk/include/__tree", - "//buildtools/third_party/libc++/trunk/include/__tuple/make_tuple_types.h", - "//buildtools/third_party/libc++/trunk/include/__tuple/pair_like.h", - "//buildtools/third_party/libc++/trunk/include/__tuple/sfinae_helpers.h", - "//buildtools/third_party/libc++/trunk/include/__tuple/tuple_element.h", - "//buildtools/third_party/libc++/trunk/include/__tuple/tuple_indices.h", - "//buildtools/third_party/libc++/trunk/include/__tuple/tuple_like.h", - "//buildtools/third_party/libc++/trunk/include/__tuple/tuple_like_ext.h", - "//buildtools/third_party/libc++/trunk/include/__tuple/tuple_size.h", - "//buildtools/third_party/libc++/trunk/include/__tuple/tuple_types.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/add_const.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/add_cv.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/add_lvalue_reference.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/add_pointer.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/add_rvalue_reference.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/add_volatile.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/aligned_storage.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/aligned_union.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/alignment_of.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/apply_cv.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/can_extract_key.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/common_reference.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/common_type.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/conditional.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/conjunction.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/copy_cv.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/copy_cvref.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/decay.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/dependent_type.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/disjunction.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/enable_if.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/extent.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/has_unique_object_representation.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/has_virtual_destructor.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/integral_constant.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/invoke.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_abstract.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_aggregate.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_allocator.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_always_bitcastable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_arithmetic.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_array.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_assignable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_base_of.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_bounded_array.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_callable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_char_like_type.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_class.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_compound.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_const.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_constant_evaluated.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_convertible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_copy_assignable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_copy_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_core_convertible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_default_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_destructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_empty.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_enum.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_equality_comparable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_execution_policy.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_final.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_floating_point.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_function.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_fundamental.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_implicitly_default_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_integral.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_literal_type.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_member_function_pointer.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_member_object_pointer.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_member_pointer.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_move_assignable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_move_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_assignable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_convertible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_copy_assignable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_copy_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_default_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_destructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_move_assignable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_nothrow_move_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_null_pointer.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_object.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_pod.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_pointer.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_polymorphic.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_primary_template.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_reference.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_reference_wrapper.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_referenceable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_same.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_scalar.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_scoped_enum.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_signed.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_signed_integer.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_specialization.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_standard_layout.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_swappable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivial.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_assignable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_copy_assignable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_copy_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_copyable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_default_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_destructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_lexicographically_comparable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_move_assignable.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_trivially_move_constructible.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_unbounded_array.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_union.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_unsigned.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_unsigned_integer.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_valid_expansion.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_void.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/is_volatile.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/lazy.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/make_32_64_or_128_bit.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/make_const_lvalue_ref.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/make_signed.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/make_unsigned.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/maybe_const.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/nat.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/negation.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/noexcept_move_assign_container.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/operation_traits.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/predicate_traits.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/promote.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/rank.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/remove_all_extents.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/remove_const.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/remove_const_ref.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/remove_cv.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/remove_cvref.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/remove_extent.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/remove_pointer.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/remove_reference.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/remove_volatile.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/result_of.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/strip_signature.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/type_identity.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/type_list.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/underlying_type.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/unwrap_ref.h", - "//buildtools/third_party/libc++/trunk/include/__type_traits/void_t.h", - "//buildtools/third_party/libc++/trunk/include/__undef_macros", - "//buildtools/third_party/libc++/trunk/include/__utility/as_const.h", - "//buildtools/third_party/libc++/trunk/include/__utility/auto_cast.h", - "//buildtools/third_party/libc++/trunk/include/__utility/cmp.h", - "//buildtools/third_party/libc++/trunk/include/__utility/convert_to_integral.h", - "//buildtools/third_party/libc++/trunk/include/__utility/declval.h", - "//buildtools/third_party/libc++/trunk/include/__utility/exception_guard.h", - "//buildtools/third_party/libc++/trunk/include/__utility/exchange.h", - "//buildtools/third_party/libc++/trunk/include/__utility/forward.h", - "//buildtools/third_party/libc++/trunk/include/__utility/forward_like.h", - "//buildtools/third_party/libc++/trunk/include/__utility/in_place.h", - "//buildtools/third_party/libc++/trunk/include/__utility/integer_sequence.h", - "//buildtools/third_party/libc++/trunk/include/__utility/is_pointer_in_range.h", - "//buildtools/third_party/libc++/trunk/include/__utility/move.h", - "//buildtools/third_party/libc++/trunk/include/__utility/pair.h", - "//buildtools/third_party/libc++/trunk/include/__utility/piecewise_construct.h", - "//buildtools/third_party/libc++/trunk/include/__utility/priority_tag.h", - "//buildtools/third_party/libc++/trunk/include/__utility/rel_ops.h", - "//buildtools/third_party/libc++/trunk/include/__utility/swap.h", - "//buildtools/third_party/libc++/trunk/include/__utility/terminate_on_exception.h", - "//buildtools/third_party/libc++/trunk/include/__utility/to_underlying.h", - "//buildtools/third_party/libc++/trunk/include/__utility/unreachable.h", - "//buildtools/third_party/libc++/trunk/include/__variant/monostate.h", - "//buildtools/third_party/libc++/trunk/include/__verbose_abort", - "//buildtools/third_party/libc++/trunk/include/algorithm", - "//buildtools/third_party/libc++/trunk/include/any", - "//buildtools/third_party/libc++/trunk/include/array", - "//buildtools/third_party/libc++/trunk/include/atomic", - "//buildtools/third_party/libc++/trunk/include/barrier", - "//buildtools/third_party/libc++/trunk/include/bit", - "//buildtools/third_party/libc++/trunk/include/bitset", - "//buildtools/third_party/libc++/trunk/include/cassert", - "//buildtools/third_party/libc++/trunk/include/ccomplex", - "//buildtools/third_party/libc++/trunk/include/cctype", - "//buildtools/third_party/libc++/trunk/include/cerrno", - "//buildtools/third_party/libc++/trunk/include/cfenv", - "//buildtools/third_party/libc++/trunk/include/cfloat", - "//buildtools/third_party/libc++/trunk/include/charconv", - "//buildtools/third_party/libc++/trunk/include/chrono", - "//buildtools/third_party/libc++/trunk/include/cinttypes", - "//buildtools/third_party/libc++/trunk/include/ciso646", - "//buildtools/third_party/libc++/trunk/include/climits", - "//buildtools/third_party/libc++/trunk/include/clocale", - "//buildtools/third_party/libc++/trunk/include/cmath", - "//buildtools/third_party/libc++/trunk/include/codecvt", - "//buildtools/third_party/libc++/trunk/include/compare", - "//buildtools/third_party/libc++/trunk/include/complex", - "//buildtools/third_party/libc++/trunk/include/complex.h", - "//buildtools/third_party/libc++/trunk/include/concepts", - "//buildtools/third_party/libc++/trunk/include/condition_variable", - "//buildtools/third_party/libc++/trunk/include/coroutine", - "//buildtools/third_party/libc++/trunk/include/csetjmp", - "//buildtools/third_party/libc++/trunk/include/csignal", - "//buildtools/third_party/libc++/trunk/include/cstdarg", - "//buildtools/third_party/libc++/trunk/include/cstdbool", - "//buildtools/third_party/libc++/trunk/include/cstddef", - "//buildtools/third_party/libc++/trunk/include/cstdint", - "//buildtools/third_party/libc++/trunk/include/cstdio", - "//buildtools/third_party/libc++/trunk/include/cstdlib", - "//buildtools/third_party/libc++/trunk/include/cstring", - "//buildtools/third_party/libc++/trunk/include/ctgmath", - "//buildtools/third_party/libc++/trunk/include/ctime", - "//buildtools/third_party/libc++/trunk/include/ctype.h", - "//buildtools/third_party/libc++/trunk/include/cuchar", - "//buildtools/third_party/libc++/trunk/include/cwchar", - "//buildtools/third_party/libc++/trunk/include/cwctype", - "//buildtools/third_party/libc++/trunk/include/deque", - "//buildtools/third_party/libc++/trunk/include/errno.h", - "//buildtools/third_party/libc++/trunk/include/exception", - "//buildtools/third_party/libc++/trunk/include/execution", - "//buildtools/third_party/libc++/trunk/include/expected", - "//buildtools/third_party/libc++/trunk/include/experimental/__config", - "//buildtools/third_party/libc++/trunk/include/experimental/__memory", - "//buildtools/third_party/libc++/trunk/include/experimental/deque", - "//buildtools/third_party/libc++/trunk/include/experimental/forward_list", - "//buildtools/third_party/libc++/trunk/include/experimental/iterator", - "//buildtools/third_party/libc++/trunk/include/experimental/list", - "//buildtools/third_party/libc++/trunk/include/experimental/map", - "//buildtools/third_party/libc++/trunk/include/experimental/memory_resource", - "//buildtools/third_party/libc++/trunk/include/experimental/propagate_const", - "//buildtools/third_party/libc++/trunk/include/experimental/regex", - "//buildtools/third_party/libc++/trunk/include/experimental/set", - "//buildtools/third_party/libc++/trunk/include/experimental/simd", - "//buildtools/third_party/libc++/trunk/include/experimental/string", - "//buildtools/third_party/libc++/trunk/include/experimental/type_traits", - "//buildtools/third_party/libc++/trunk/include/experimental/unordered_map", - "//buildtools/third_party/libc++/trunk/include/experimental/unordered_set", - "//buildtools/third_party/libc++/trunk/include/experimental/utility", - "//buildtools/third_party/libc++/trunk/include/experimental/vector", - "//buildtools/third_party/libc++/trunk/include/ext/__hash", - "//buildtools/third_party/libc++/trunk/include/ext/hash_map", - "//buildtools/third_party/libc++/trunk/include/ext/hash_set", - "//buildtools/third_party/libc++/trunk/include/fenv.h", - "//buildtools/third_party/libc++/trunk/include/filesystem", - "//buildtools/third_party/libc++/trunk/include/float.h", - "//buildtools/third_party/libc++/trunk/include/format", - "//buildtools/third_party/libc++/trunk/include/forward_list", - "//buildtools/third_party/libc++/trunk/include/fstream", - "//buildtools/third_party/libc++/trunk/include/functional", - "//buildtools/third_party/libc++/trunk/include/future", - "//buildtools/third_party/libc++/trunk/include/initializer_list", - "//buildtools/third_party/libc++/trunk/include/inttypes.h", - "//buildtools/third_party/libc++/trunk/include/iomanip", - "//buildtools/third_party/libc++/trunk/include/ios", - "//buildtools/third_party/libc++/trunk/include/iosfwd", - "//buildtools/third_party/libc++/trunk/include/iostream", - "//buildtools/third_party/libc++/trunk/include/istream", - "//buildtools/third_party/libc++/trunk/include/iterator", - "//buildtools/third_party/libc++/trunk/include/latch", - "//buildtools/third_party/libc++/trunk/include/libcxx.imp", - "//buildtools/third_party/libc++/trunk/include/limits", - "//buildtools/third_party/libc++/trunk/include/limits.h", - "//buildtools/third_party/libc++/trunk/include/list", - "//buildtools/third_party/libc++/trunk/include/locale", - "//buildtools/third_party/libc++/trunk/include/locale.h", - "//buildtools/third_party/libc++/trunk/include/map", - "//buildtools/third_party/libc++/trunk/include/math.h", - "//buildtools/third_party/libc++/trunk/include/mdspan", - "//buildtools/third_party/libc++/trunk/include/memory", - "//buildtools/third_party/libc++/trunk/include/memory_resource", - "//buildtools/third_party/libc++/trunk/include/module.modulemap.in", - "//buildtools/third_party/libc++/trunk/include/mutex", - "//buildtools/third_party/libc++/trunk/include/new", - "//buildtools/third_party/libc++/trunk/include/numbers", - "//buildtools/third_party/libc++/trunk/include/numeric", - "//buildtools/third_party/libc++/trunk/include/optional", - "//buildtools/third_party/libc++/trunk/include/ostream", - "//buildtools/third_party/libc++/trunk/include/queue", - "//buildtools/third_party/libc++/trunk/include/random", - "//buildtools/third_party/libc++/trunk/include/ranges", - "//buildtools/third_party/libc++/trunk/include/ratio", - "//buildtools/third_party/libc++/trunk/include/regex", - "//buildtools/third_party/libc++/trunk/include/scoped_allocator", - "//buildtools/third_party/libc++/trunk/include/semaphore", - "//buildtools/third_party/libc++/trunk/include/set", - "//buildtools/third_party/libc++/trunk/include/setjmp.h", - "//buildtools/third_party/libc++/trunk/include/shared_mutex", - "//buildtools/third_party/libc++/trunk/include/source_location", - "//buildtools/third_party/libc++/trunk/include/span", - "//buildtools/third_party/libc++/trunk/include/sstream", - "//buildtools/third_party/libc++/trunk/include/stack", - "//buildtools/third_party/libc++/trunk/include/stdatomic.h", - "//buildtools/third_party/libc++/trunk/include/stdbool.h", - "//buildtools/third_party/libc++/trunk/include/stddef.h", - "//buildtools/third_party/libc++/trunk/include/stdexcept", - "//buildtools/third_party/libc++/trunk/include/stdint.h", - "//buildtools/third_party/libc++/trunk/include/stdio.h", - "//buildtools/third_party/libc++/trunk/include/stdlib.h", - "//buildtools/third_party/libc++/trunk/include/stop_token", - "//buildtools/third_party/libc++/trunk/include/streambuf", - "//buildtools/third_party/libc++/trunk/include/string", - "//buildtools/third_party/libc++/trunk/include/string.h", - "//buildtools/third_party/libc++/trunk/include/string_view", - "//buildtools/third_party/libc++/trunk/include/strstream", - "//buildtools/third_party/libc++/trunk/include/system_error", - "//buildtools/third_party/libc++/trunk/include/tgmath.h", - "//buildtools/third_party/libc++/trunk/include/thread", - "//buildtools/third_party/libc++/trunk/include/tuple", - "//buildtools/third_party/libc++/trunk/include/type_traits", - "//buildtools/third_party/libc++/trunk/include/typeindex", - "//buildtools/third_party/libc++/trunk/include/typeinfo", - "//buildtools/third_party/libc++/trunk/include/uchar.h", - "//buildtools/third_party/libc++/trunk/include/unordered_map", - "//buildtools/third_party/libc++/trunk/include/unordered_set", - "//buildtools/third_party/libc++/trunk/include/utility", - "//buildtools/third_party/libc++/trunk/include/valarray", - "//buildtools/third_party/libc++/trunk/include/variant", - "//buildtools/third_party/libc++/trunk/include/vector", - "//buildtools/third_party/libc++/trunk/include/version", - "//buildtools/third_party/libc++/trunk/include/wchar.h", - "//buildtools/third_party/libc++/trunk/include/wctype.h", + "//third_party/libc++/src/include/CMakeLists.txt", + "//third_party/libc++/src/include/__algorithm/adjacent_find.h", + "//third_party/libc++/src/include/__algorithm/all_of.h", + "//third_party/libc++/src/include/__algorithm/any_of.h", + "//third_party/libc++/src/include/__algorithm/binary_search.h", + "//third_party/libc++/src/include/__algorithm/clamp.h", + "//third_party/libc++/src/include/__algorithm/comp.h", + "//third_party/libc++/src/include/__algorithm/comp_ref_type.h", + "//third_party/libc++/src/include/__algorithm/copy.h", + "//third_party/libc++/src/include/__algorithm/copy_backward.h", + "//third_party/libc++/src/include/__algorithm/copy_if.h", + "//third_party/libc++/src/include/__algorithm/copy_move_common.h", + "//third_party/libc++/src/include/__algorithm/copy_n.h", + "//third_party/libc++/src/include/__algorithm/count.h", + "//third_party/libc++/src/include/__algorithm/count_if.h", + "//third_party/libc++/src/include/__algorithm/equal.h", + "//third_party/libc++/src/include/__algorithm/equal_range.h", + "//third_party/libc++/src/include/__algorithm/fill.h", + "//third_party/libc++/src/include/__algorithm/fill_n.h", + "//third_party/libc++/src/include/__algorithm/find.h", + "//third_party/libc++/src/include/__algorithm/find_end.h", + "//third_party/libc++/src/include/__algorithm/find_first_of.h", + "//third_party/libc++/src/include/__algorithm/find_if.h", + "//third_party/libc++/src/include/__algorithm/find_if_not.h", + "//third_party/libc++/src/include/__algorithm/for_each.h", + "//third_party/libc++/src/include/__algorithm/for_each_n.h", + "//third_party/libc++/src/include/__algorithm/for_each_segment.h", + "//third_party/libc++/src/include/__algorithm/generate.h", + "//third_party/libc++/src/include/__algorithm/generate_n.h", + "//third_party/libc++/src/include/__algorithm/half_positive.h", + "//third_party/libc++/src/include/__algorithm/in_found_result.h", + "//third_party/libc++/src/include/__algorithm/in_fun_result.h", + "//third_party/libc++/src/include/__algorithm/in_in_out_result.h", + "//third_party/libc++/src/include/__algorithm/in_in_result.h", + "//third_party/libc++/src/include/__algorithm/in_out_out_result.h", + "//third_party/libc++/src/include/__algorithm/in_out_result.h", + "//third_party/libc++/src/include/__algorithm/includes.h", + "//third_party/libc++/src/include/__algorithm/inplace_merge.h", + "//third_party/libc++/src/include/__algorithm/is_heap.h", + "//third_party/libc++/src/include/__algorithm/is_heap_until.h", + "//third_party/libc++/src/include/__algorithm/is_partitioned.h", + "//third_party/libc++/src/include/__algorithm/is_permutation.h", + "//third_party/libc++/src/include/__algorithm/is_sorted.h", + "//third_party/libc++/src/include/__algorithm/is_sorted_until.h", + "//third_party/libc++/src/include/__algorithm/iter_swap.h", + "//third_party/libc++/src/include/__algorithm/iterator_operations.h", + "//third_party/libc++/src/include/__algorithm/lexicographical_compare.h", + "//third_party/libc++/src/include/__algorithm/lexicographical_compare_three_way.h", + "//third_party/libc++/src/include/__algorithm/lower_bound.h", + "//third_party/libc++/src/include/__algorithm/make_heap.h", + "//third_party/libc++/src/include/__algorithm/make_projected.h", + "//third_party/libc++/src/include/__algorithm/max.h", + "//third_party/libc++/src/include/__algorithm/max_element.h", + "//third_party/libc++/src/include/__algorithm/merge.h", + "//third_party/libc++/src/include/__algorithm/min.h", + "//third_party/libc++/src/include/__algorithm/min_element.h", + "//third_party/libc++/src/include/__algorithm/min_max_result.h", + "//third_party/libc++/src/include/__algorithm/minmax.h", + "//third_party/libc++/src/include/__algorithm/minmax_element.h", + "//third_party/libc++/src/include/__algorithm/mismatch.h", + "//third_party/libc++/src/include/__algorithm/move.h", + "//third_party/libc++/src/include/__algorithm/move_backward.h", + "//third_party/libc++/src/include/__algorithm/next_permutation.h", + "//third_party/libc++/src/include/__algorithm/none_of.h", + "//third_party/libc++/src/include/__algorithm/nth_element.h", + "//third_party/libc++/src/include/__algorithm/partial_sort.h", + "//third_party/libc++/src/include/__algorithm/partial_sort_copy.h", + "//third_party/libc++/src/include/__algorithm/partition.h", + "//third_party/libc++/src/include/__algorithm/partition_copy.h", + "//third_party/libc++/src/include/__algorithm/partition_point.h", + "//third_party/libc++/src/include/__algorithm/pop_heap.h", + "//third_party/libc++/src/include/__algorithm/prev_permutation.h", + "//third_party/libc++/src/include/__algorithm/pstl_any_all_none_of.h", + "//third_party/libc++/src/include/__algorithm/pstl_backend.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backend.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/any_of.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/backend.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/fill.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/find_if.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/for_each.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/merge.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/serial.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/stable_sort.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/thread.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/transform.h", + "//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h", + "//third_party/libc++/src/include/__algorithm/pstl_copy.h", + "//third_party/libc++/src/include/__algorithm/pstl_count.h", + "//third_party/libc++/src/include/__algorithm/pstl_fill.h", + "//third_party/libc++/src/include/__algorithm/pstl_find.h", + "//third_party/libc++/src/include/__algorithm/pstl_for_each.h", + "//third_party/libc++/src/include/__algorithm/pstl_frontend_dispatch.h", + "//third_party/libc++/src/include/__algorithm/pstl_generate.h", + "//third_party/libc++/src/include/__algorithm/pstl_is_partitioned.h", + "//third_party/libc++/src/include/__algorithm/pstl_merge.h", + "//third_party/libc++/src/include/__algorithm/pstl_replace.h", + "//third_party/libc++/src/include/__algorithm/pstl_stable_sort.h", + "//third_party/libc++/src/include/__algorithm/pstl_transform.h", + "//third_party/libc++/src/include/__algorithm/push_heap.h", + "//third_party/libc++/src/include/__algorithm/ranges_adjacent_find.h", + "//third_party/libc++/src/include/__algorithm/ranges_all_of.h", + "//third_party/libc++/src/include/__algorithm/ranges_any_of.h", + "//third_party/libc++/src/include/__algorithm/ranges_binary_search.h", + "//third_party/libc++/src/include/__algorithm/ranges_clamp.h", + "//third_party/libc++/src/include/__algorithm/ranges_copy.h", + "//third_party/libc++/src/include/__algorithm/ranges_copy_backward.h", + "//third_party/libc++/src/include/__algorithm/ranges_copy_if.h", + "//third_party/libc++/src/include/__algorithm/ranges_copy_n.h", + "//third_party/libc++/src/include/__algorithm/ranges_count.h", + "//third_party/libc++/src/include/__algorithm/ranges_count_if.h", + "//third_party/libc++/src/include/__algorithm/ranges_equal.h", + "//third_party/libc++/src/include/__algorithm/ranges_equal_range.h", + "//third_party/libc++/src/include/__algorithm/ranges_fill.h", + "//third_party/libc++/src/include/__algorithm/ranges_fill_n.h", + "//third_party/libc++/src/include/__algorithm/ranges_find.h", + "//third_party/libc++/src/include/__algorithm/ranges_find_end.h", + "//third_party/libc++/src/include/__algorithm/ranges_find_first_of.h", + "//third_party/libc++/src/include/__algorithm/ranges_find_if.h", + "//third_party/libc++/src/include/__algorithm/ranges_find_if_not.h", + "//third_party/libc++/src/include/__algorithm/ranges_for_each.h", + "//third_party/libc++/src/include/__algorithm/ranges_for_each_n.h", + "//third_party/libc++/src/include/__algorithm/ranges_generate.h", + "//third_party/libc++/src/include/__algorithm/ranges_generate_n.h", + "//third_party/libc++/src/include/__algorithm/ranges_includes.h", + "//third_party/libc++/src/include/__algorithm/ranges_inplace_merge.h", + "//third_party/libc++/src/include/__algorithm/ranges_is_heap.h", + "//third_party/libc++/src/include/__algorithm/ranges_is_heap_until.h", + "//third_party/libc++/src/include/__algorithm/ranges_is_partitioned.h", + "//third_party/libc++/src/include/__algorithm/ranges_is_permutation.h", + "//third_party/libc++/src/include/__algorithm/ranges_is_sorted.h", + "//third_party/libc++/src/include/__algorithm/ranges_is_sorted_until.h", + "//third_party/libc++/src/include/__algorithm/ranges_iterator_concept.h", + "//third_party/libc++/src/include/__algorithm/ranges_lexicographical_compare.h", + "//third_party/libc++/src/include/__algorithm/ranges_lower_bound.h", + "//third_party/libc++/src/include/__algorithm/ranges_make_heap.h", + "//third_party/libc++/src/include/__algorithm/ranges_max.h", + "//third_party/libc++/src/include/__algorithm/ranges_max_element.h", + "//third_party/libc++/src/include/__algorithm/ranges_merge.h", + "//third_party/libc++/src/include/__algorithm/ranges_min.h", + "//third_party/libc++/src/include/__algorithm/ranges_min_element.h", + "//third_party/libc++/src/include/__algorithm/ranges_minmax.h", + "//third_party/libc++/src/include/__algorithm/ranges_minmax_element.h", + "//third_party/libc++/src/include/__algorithm/ranges_mismatch.h", + "//third_party/libc++/src/include/__algorithm/ranges_move.h", + "//third_party/libc++/src/include/__algorithm/ranges_move_backward.h", + "//third_party/libc++/src/include/__algorithm/ranges_next_permutation.h", + "//third_party/libc++/src/include/__algorithm/ranges_none_of.h", + "//third_party/libc++/src/include/__algorithm/ranges_nth_element.h", + "//third_party/libc++/src/include/__algorithm/ranges_partial_sort.h", + "//third_party/libc++/src/include/__algorithm/ranges_partial_sort_copy.h", + "//third_party/libc++/src/include/__algorithm/ranges_partition.h", + "//third_party/libc++/src/include/__algorithm/ranges_partition_copy.h", + "//third_party/libc++/src/include/__algorithm/ranges_partition_point.h", + "//third_party/libc++/src/include/__algorithm/ranges_pop_heap.h", + "//third_party/libc++/src/include/__algorithm/ranges_prev_permutation.h", + "//third_party/libc++/src/include/__algorithm/ranges_push_heap.h", + "//third_party/libc++/src/include/__algorithm/ranges_remove.h", + "//third_party/libc++/src/include/__algorithm/ranges_remove_copy.h", + "//third_party/libc++/src/include/__algorithm/ranges_remove_copy_if.h", + "//third_party/libc++/src/include/__algorithm/ranges_remove_if.h", + "//third_party/libc++/src/include/__algorithm/ranges_replace.h", + "//third_party/libc++/src/include/__algorithm/ranges_replace_copy.h", + "//third_party/libc++/src/include/__algorithm/ranges_replace_copy_if.h", + "//third_party/libc++/src/include/__algorithm/ranges_replace_if.h", + "//third_party/libc++/src/include/__algorithm/ranges_reverse.h", + "//third_party/libc++/src/include/__algorithm/ranges_reverse_copy.h", + "//third_party/libc++/src/include/__algorithm/ranges_rotate.h", + "//third_party/libc++/src/include/__algorithm/ranges_rotate_copy.h", + "//third_party/libc++/src/include/__algorithm/ranges_sample.h", + "//third_party/libc++/src/include/__algorithm/ranges_search.h", + "//third_party/libc++/src/include/__algorithm/ranges_search_n.h", + "//third_party/libc++/src/include/__algorithm/ranges_set_difference.h", + "//third_party/libc++/src/include/__algorithm/ranges_set_intersection.h", + "//third_party/libc++/src/include/__algorithm/ranges_set_symmetric_difference.h", + "//third_party/libc++/src/include/__algorithm/ranges_set_union.h", + "//third_party/libc++/src/include/__algorithm/ranges_shuffle.h", + "//third_party/libc++/src/include/__algorithm/ranges_sort.h", + "//third_party/libc++/src/include/__algorithm/ranges_sort_heap.h", + "//third_party/libc++/src/include/__algorithm/ranges_stable_partition.h", + "//third_party/libc++/src/include/__algorithm/ranges_stable_sort.h", + "//third_party/libc++/src/include/__algorithm/ranges_starts_with.h", + "//third_party/libc++/src/include/__algorithm/ranges_swap_ranges.h", + "//third_party/libc++/src/include/__algorithm/ranges_transform.h", + "//third_party/libc++/src/include/__algorithm/ranges_unique.h", + "//third_party/libc++/src/include/__algorithm/ranges_unique_copy.h", + "//third_party/libc++/src/include/__algorithm/ranges_upper_bound.h", + "//third_party/libc++/src/include/__algorithm/remove.h", + "//third_party/libc++/src/include/__algorithm/remove_copy.h", + "//third_party/libc++/src/include/__algorithm/remove_copy_if.h", + "//third_party/libc++/src/include/__algorithm/remove_if.h", + "//third_party/libc++/src/include/__algorithm/replace.h", + "//third_party/libc++/src/include/__algorithm/replace_copy.h", + "//third_party/libc++/src/include/__algorithm/replace_copy_if.h", + "//third_party/libc++/src/include/__algorithm/replace_if.h", + "//third_party/libc++/src/include/__algorithm/reverse.h", + "//third_party/libc++/src/include/__algorithm/reverse_copy.h", + "//third_party/libc++/src/include/__algorithm/rotate.h", + "//third_party/libc++/src/include/__algorithm/rotate_copy.h", + "//third_party/libc++/src/include/__algorithm/sample.h", + "//third_party/libc++/src/include/__algorithm/search.h", + "//third_party/libc++/src/include/__algorithm/search_n.h", + "//third_party/libc++/src/include/__algorithm/set_difference.h", + "//third_party/libc++/src/include/__algorithm/set_intersection.h", + "//third_party/libc++/src/include/__algorithm/set_symmetric_difference.h", + "//third_party/libc++/src/include/__algorithm/set_union.h", + "//third_party/libc++/src/include/__algorithm/shift_left.h", + "//third_party/libc++/src/include/__algorithm/shift_right.h", + "//third_party/libc++/src/include/__algorithm/shuffle.h", + "//third_party/libc++/src/include/__algorithm/sift_down.h", + "//third_party/libc++/src/include/__algorithm/sort.h", + "//third_party/libc++/src/include/__algorithm/sort_heap.h", + "//third_party/libc++/src/include/__algorithm/stable_partition.h", + "//third_party/libc++/src/include/__algorithm/stable_sort.h", + "//third_party/libc++/src/include/__algorithm/swap_ranges.h", + "//third_party/libc++/src/include/__algorithm/three_way_comp_ref_type.h", + "//third_party/libc++/src/include/__algorithm/transform.h", + "//third_party/libc++/src/include/__algorithm/uniform_random_bit_generator_adaptor.h", + "//third_party/libc++/src/include/__algorithm/unique.h", + "//third_party/libc++/src/include/__algorithm/unique_copy.h", + "//third_party/libc++/src/include/__algorithm/unwrap_iter.h", + "//third_party/libc++/src/include/__algorithm/unwrap_range.h", + "//third_party/libc++/src/include/__algorithm/upper_bound.h", + "//third_party/libc++/src/include/__assert", + "//third_party/libc++/src/include/__atomic/aliases.h", + "//third_party/libc++/src/include/__atomic/atomic.h", + "//third_party/libc++/src/include/__atomic/atomic_base.h", + "//third_party/libc++/src/include/__atomic/atomic_flag.h", + "//third_party/libc++/src/include/__atomic/atomic_init.h", + "//third_party/libc++/src/include/__atomic/atomic_lock_free.h", + "//third_party/libc++/src/include/__atomic/atomic_sync.h", + "//third_party/libc++/src/include/__atomic/check_memory_order.h", + "//third_party/libc++/src/include/__atomic/contention_t.h", + "//third_party/libc++/src/include/__atomic/cxx_atomic_impl.h", + "//third_party/libc++/src/include/__atomic/fence.h", + "//third_party/libc++/src/include/__atomic/is_always_lock_free.h", + "//third_party/libc++/src/include/__atomic/kill_dependency.h", + "//third_party/libc++/src/include/__atomic/memory_order.h", + "//third_party/libc++/src/include/__availability", + "//third_party/libc++/src/include/__bit/bit_cast.h", + "//third_party/libc++/src/include/__bit/bit_ceil.h", + "//third_party/libc++/src/include/__bit/bit_floor.h", + "//third_party/libc++/src/include/__bit/bit_log2.h", + "//third_party/libc++/src/include/__bit/bit_width.h", + "//third_party/libc++/src/include/__bit/blsr.h", + "//third_party/libc++/src/include/__bit/byteswap.h", + "//third_party/libc++/src/include/__bit/countl.h", + "//third_party/libc++/src/include/__bit/countr.h", + "//third_party/libc++/src/include/__bit/endian.h", + "//third_party/libc++/src/include/__bit/has_single_bit.h", + "//third_party/libc++/src/include/__bit/popcount.h", + "//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_integral.h", + "//third_party/libc++/src/include/__charconv/from_chars_result.h", + "//third_party/libc++/src/include/__charconv/tables.h", + "//third_party/libc++/src/include/__charconv/to_chars.h", + "//third_party/libc++/src/include/__charconv/to_chars_base_10.h", + "//third_party/libc++/src/include/__charconv/to_chars_floating_point.h", + "//third_party/libc++/src/include/__charconv/to_chars_integral.h", + "//third_party/libc++/src/include/__charconv/to_chars_result.h", + "//third_party/libc++/src/include/__charconv/traits.h", + "//third_party/libc++/src/include/__chrono/calendar.h", + "//third_party/libc++/src/include/__chrono/concepts.h", + "//third_party/libc++/src/include/__chrono/convert_to_timespec.h", + "//third_party/libc++/src/include/__chrono/convert_to_tm.h", + "//third_party/libc++/src/include/__chrono/day.h", + "//third_party/libc++/src/include/__chrono/duration.h", + "//third_party/libc++/src/include/__chrono/file_clock.h", + "//third_party/libc++/src/include/__chrono/formatter.h", + "//third_party/libc++/src/include/__chrono/hh_mm_ss.h", + "//third_party/libc++/src/include/__chrono/high_resolution_clock.h", + "//third_party/libc++/src/include/__chrono/literals.h", + "//third_party/libc++/src/include/__chrono/month.h", + "//third_party/libc++/src/include/__chrono/month_weekday.h", + "//third_party/libc++/src/include/__chrono/monthday.h", + "//third_party/libc++/src/include/__chrono/ostream.h", + "//third_party/libc++/src/include/__chrono/parser_std_format_spec.h", + "//third_party/libc++/src/include/__chrono/statically_widen.h", + "//third_party/libc++/src/include/__chrono/steady_clock.h", + "//third_party/libc++/src/include/__chrono/system_clock.h", + "//third_party/libc++/src/include/__chrono/time_point.h", + "//third_party/libc++/src/include/__chrono/weekday.h", + "//third_party/libc++/src/include/__chrono/year.h", + "//third_party/libc++/src/include/__chrono/year_month.h", + "//third_party/libc++/src/include/__chrono/year_month_day.h", + "//third_party/libc++/src/include/__chrono/year_month_weekday.h", + "//third_party/libc++/src/include/__compare/common_comparison_category.h", + "//third_party/libc++/src/include/__compare/compare_partial_order_fallback.h", + "//third_party/libc++/src/include/__compare/compare_strong_order_fallback.h", + "//third_party/libc++/src/include/__compare/compare_three_way.h", + "//third_party/libc++/src/include/__compare/compare_three_way_result.h", + "//third_party/libc++/src/include/__compare/compare_weak_order_fallback.h", + "//third_party/libc++/src/include/__compare/is_eq.h", + "//third_party/libc++/src/include/__compare/ordering.h", + "//third_party/libc++/src/include/__compare/partial_order.h", + "//third_party/libc++/src/include/__compare/strong_order.h", + "//third_party/libc++/src/include/__compare/synth_three_way.h", + "//third_party/libc++/src/include/__compare/three_way_comparable.h", + "//third_party/libc++/src/include/__compare/weak_order.h", + "//third_party/libc++/src/include/__concepts/arithmetic.h", + "//third_party/libc++/src/include/__concepts/assignable.h", + "//third_party/libc++/src/include/__concepts/boolean_testable.h", + "//third_party/libc++/src/include/__concepts/class_or_enum.h", + "//third_party/libc++/src/include/__concepts/common_reference_with.h", + "//third_party/libc++/src/include/__concepts/common_with.h", + "//third_party/libc++/src/include/__concepts/constructible.h", + "//third_party/libc++/src/include/__concepts/convertible_to.h", + "//third_party/libc++/src/include/__concepts/copyable.h", + "//third_party/libc++/src/include/__concepts/derived_from.h", + "//third_party/libc++/src/include/__concepts/destructible.h", + "//third_party/libc++/src/include/__concepts/different_from.h", + "//third_party/libc++/src/include/__concepts/equality_comparable.h", + "//third_party/libc++/src/include/__concepts/invocable.h", + "//third_party/libc++/src/include/__concepts/movable.h", + "//third_party/libc++/src/include/__concepts/predicate.h", + "//third_party/libc++/src/include/__concepts/regular.h", + "//third_party/libc++/src/include/__concepts/relation.h", + "//third_party/libc++/src/include/__concepts/same_as.h", + "//third_party/libc++/src/include/__concepts/semiregular.h", + "//third_party/libc++/src/include/__concepts/swappable.h", + "//third_party/libc++/src/include/__concepts/totally_ordered.h", + "//third_party/libc++/src/include/__condition_variable/condition_variable.h", + "//third_party/libc++/src/include/__config", + "//third_party/libc++/src/include/__config_site.in", + "//third_party/libc++/src/include/__coroutine/coroutine_handle.h", + "//third_party/libc++/src/include/__coroutine/coroutine_traits.h", + "//third_party/libc++/src/include/__coroutine/noop_coroutine_handle.h", + "//third_party/libc++/src/include/__coroutine/trivial_awaitables.h", + "//third_party/libc++/src/include/__debug", + "//third_party/libc++/src/include/__debug_utils/randomize_range.h", + "//third_party/libc++/src/include/__debug_utils/strict_weak_ordering_check.h", + "//third_party/libc++/src/include/__exception/exception.h", + "//third_party/libc++/src/include/__exception/exception_ptr.h", + "//third_party/libc++/src/include/__exception/nested_exception.h", + "//third_party/libc++/src/include/__exception/operations.h", + "//third_party/libc++/src/include/__exception/terminate.h", + "//third_party/libc++/src/include/__expected/bad_expected_access.h", + "//third_party/libc++/src/include/__expected/expected.h", + "//third_party/libc++/src/include/__expected/unexpect.h", + "//third_party/libc++/src/include/__expected/unexpected.h", + "//third_party/libc++/src/include/__filesystem/copy_options.h", + "//third_party/libc++/src/include/__filesystem/directory_entry.h", + "//third_party/libc++/src/include/__filesystem/directory_iterator.h", + "//third_party/libc++/src/include/__filesystem/directory_options.h", + "//third_party/libc++/src/include/__filesystem/file_status.h", + "//third_party/libc++/src/include/__filesystem/file_time_type.h", + "//third_party/libc++/src/include/__filesystem/file_type.h", + "//third_party/libc++/src/include/__filesystem/filesystem_error.h", + "//third_party/libc++/src/include/__filesystem/operations.h", + "//third_party/libc++/src/include/__filesystem/path.h", + "//third_party/libc++/src/include/__filesystem/path_iterator.h", + "//third_party/libc++/src/include/__filesystem/perm_options.h", + "//third_party/libc++/src/include/__filesystem/perms.h", + "//third_party/libc++/src/include/__filesystem/recursive_directory_iterator.h", + "//third_party/libc++/src/include/__filesystem/space_info.h", + "//third_party/libc++/src/include/__filesystem/u8path.h", + "//third_party/libc++/src/include/__format/buffer.h", + "//third_party/libc++/src/include/__format/concepts.h", + "//third_party/libc++/src/include/__format/container_adaptor.h", + "//third_party/libc++/src/include/__format/enable_insertable.h", + "//third_party/libc++/src/include/__format/escaped_output_table.h", + "//third_party/libc++/src/include/__format/extended_grapheme_cluster_table.h", + "//third_party/libc++/src/include/__format/format_arg.h", + "//third_party/libc++/src/include/__format/format_arg_store.h", + "//third_party/libc++/src/include/__format/format_args.h", + "//third_party/libc++/src/include/__format/format_context.h", + "//third_party/libc++/src/include/__format/format_error.h", + "//third_party/libc++/src/include/__format/format_functions.h", + "//third_party/libc++/src/include/__format/format_fwd.h", + "//third_party/libc++/src/include/__format/format_parse_context.h", + "//third_party/libc++/src/include/__format/format_string.h", + "//third_party/libc++/src/include/__format/format_to_n_result.h", + "//third_party/libc++/src/include/__format/formatter.h", + "//third_party/libc++/src/include/__format/formatter_bool.h", + "//third_party/libc++/src/include/__format/formatter_char.h", + "//third_party/libc++/src/include/__format/formatter_floating_point.h", + "//third_party/libc++/src/include/__format/formatter_integer.h", + "//third_party/libc++/src/include/__format/formatter_integral.h", + "//third_party/libc++/src/include/__format/formatter_output.h", + "//third_party/libc++/src/include/__format/formatter_pointer.h", + "//third_party/libc++/src/include/__format/formatter_string.h", + "//third_party/libc++/src/include/__format/formatter_tuple.h", + "//third_party/libc++/src/include/__format/parser_std_format_spec.h", + "//third_party/libc++/src/include/__format/range_default_formatter.h", + "//third_party/libc++/src/include/__format/range_formatter.h", + "//third_party/libc++/src/include/__format/unicode.h", + "//third_party/libc++/src/include/__format/width_estimation_table.h", + "//third_party/libc++/src/include/__functional/binary_function.h", + "//third_party/libc++/src/include/__functional/binary_negate.h", + "//third_party/libc++/src/include/__functional/bind.h", + "//third_party/libc++/src/include/__functional/bind_back.h", + "//third_party/libc++/src/include/__functional/bind_front.h", + "//third_party/libc++/src/include/__functional/binder1st.h", + "//third_party/libc++/src/include/__functional/binder2nd.h", + "//third_party/libc++/src/include/__functional/boyer_moore_searcher.h", + "//third_party/libc++/src/include/__functional/compose.h", + "//third_party/libc++/src/include/__functional/default_searcher.h", + "//third_party/libc++/src/include/__functional/function.h", + "//third_party/libc++/src/include/__functional/hash.h", + "//third_party/libc++/src/include/__functional/identity.h", + "//third_party/libc++/src/include/__functional/invoke.h", + "//third_party/libc++/src/include/__functional/is_transparent.h", + "//third_party/libc++/src/include/__functional/mem_fn.h", + "//third_party/libc++/src/include/__functional/mem_fun_ref.h", + "//third_party/libc++/src/include/__functional/not_fn.h", + "//third_party/libc++/src/include/__functional/operations.h", + "//third_party/libc++/src/include/__functional/perfect_forward.h", + "//third_party/libc++/src/include/__functional/pointer_to_binary_function.h", + "//third_party/libc++/src/include/__functional/pointer_to_unary_function.h", + "//third_party/libc++/src/include/__functional/ranges_operations.h", + "//third_party/libc++/src/include/__functional/reference_wrapper.h", + "//third_party/libc++/src/include/__functional/unary_function.h", + "//third_party/libc++/src/include/__functional/unary_negate.h", + "//third_party/libc++/src/include/__functional/weak_result_type.h", + "//third_party/libc++/src/include/__fwd/array.h", + "//third_party/libc++/src/include/__fwd/fstream.h", + "//third_party/libc++/src/include/__fwd/get.h", + "//third_party/libc++/src/include/__fwd/hash.h", + "//third_party/libc++/src/include/__fwd/ios.h", + "//third_party/libc++/src/include/__fwd/istream.h", + "//third_party/libc++/src/include/__fwd/memory_resource.h", + "//third_party/libc++/src/include/__fwd/ostream.h", + "//third_party/libc++/src/include/__fwd/pair.h", + "//third_party/libc++/src/include/__fwd/span.h", + "//third_party/libc++/src/include/__fwd/sstream.h", + "//third_party/libc++/src/include/__fwd/streambuf.h", + "//third_party/libc++/src/include/__fwd/string.h", + "//third_party/libc++/src/include/__fwd/string_view.h", + "//third_party/libc++/src/include/__fwd/subrange.h", + "//third_party/libc++/src/include/__fwd/tuple.h", + "//third_party/libc++/src/include/__hash_table", + "//third_party/libc++/src/include/__ios/fpos.h", + "//third_party/libc++/src/include/__iterator/access.h", + "//third_party/libc++/src/include/__iterator/advance.h", + "//third_party/libc++/src/include/__iterator/back_insert_iterator.h", + "//third_party/libc++/src/include/__iterator/bounded_iter.h", + "//third_party/libc++/src/include/__iterator/common_iterator.h", + "//third_party/libc++/src/include/__iterator/concepts.h", + "//third_party/libc++/src/include/__iterator/counted_iterator.h", + "//third_party/libc++/src/include/__iterator/cpp17_iterator_concepts.h", + "//third_party/libc++/src/include/__iterator/data.h", + "//third_party/libc++/src/include/__iterator/default_sentinel.h", + "//third_party/libc++/src/include/__iterator/distance.h", + "//third_party/libc++/src/include/__iterator/empty.h", + "//third_party/libc++/src/include/__iterator/erase_if_container.h", + "//third_party/libc++/src/include/__iterator/front_insert_iterator.h", + "//third_party/libc++/src/include/__iterator/incrementable_traits.h", + "//third_party/libc++/src/include/__iterator/indirectly_comparable.h", + "//third_party/libc++/src/include/__iterator/insert_iterator.h", + "//third_party/libc++/src/include/__iterator/istream_iterator.h", + "//third_party/libc++/src/include/__iterator/istreambuf_iterator.h", + "//third_party/libc++/src/include/__iterator/iter_move.h", + "//third_party/libc++/src/include/__iterator/iter_swap.h", + "//third_party/libc++/src/include/__iterator/iterator.h", + "//third_party/libc++/src/include/__iterator/iterator_traits.h", + "//third_party/libc++/src/include/__iterator/iterator_with_data.h", + "//third_party/libc++/src/include/__iterator/mergeable.h", + "//third_party/libc++/src/include/__iterator/move_iterator.h", + "//third_party/libc++/src/include/__iterator/move_sentinel.h", + "//third_party/libc++/src/include/__iterator/next.h", + "//third_party/libc++/src/include/__iterator/ostream_iterator.h", + "//third_party/libc++/src/include/__iterator/ostreambuf_iterator.h", + "//third_party/libc++/src/include/__iterator/permutable.h", + "//third_party/libc++/src/include/__iterator/prev.h", + "//third_party/libc++/src/include/__iterator/projected.h", + "//third_party/libc++/src/include/__iterator/readable_traits.h", + "//third_party/libc++/src/include/__iterator/reverse_access.h", + "//third_party/libc++/src/include/__iterator/reverse_iterator.h", + "//third_party/libc++/src/include/__iterator/segmented_iterator.h", + "//third_party/libc++/src/include/__iterator/size.h", + "//third_party/libc++/src/include/__iterator/sortable.h", + "//third_party/libc++/src/include/__iterator/unreachable_sentinel.h", + "//third_party/libc++/src/include/__iterator/wrap_iter.h", + "//third_party/libc++/src/include/__locale", + "//third_party/libc++/src/include/__locale_dir/locale_base_api/bsd_locale_defaults.h", + "//third_party/libc++/src/include/__locale_dir/locale_base_api/bsd_locale_fallbacks.h", + "//third_party/libc++/src/include/__locale_dir/locale_base_api/locale_guard.h", + "//third_party/libc++/src/include/__mbstate_t.h", + "//third_party/libc++/src/include/__mdspan/extents.h", + "//third_party/libc++/src/include/__memory/addressof.h", + "//third_party/libc++/src/include/__memory/align.h", + "//third_party/libc++/src/include/__memory/aligned_alloc.h", + "//third_party/libc++/src/include/__memory/allocate_at_least.h", + "//third_party/libc++/src/include/__memory/allocation_guard.h", + "//third_party/libc++/src/include/__memory/allocator.h", + "//third_party/libc++/src/include/__memory/allocator_arg_t.h", + "//third_party/libc++/src/include/__memory/allocator_destructor.h", + "//third_party/libc++/src/include/__memory/allocator_traits.h", + "//third_party/libc++/src/include/__memory/assume_aligned.h", + "//third_party/libc++/src/include/__memory/auto_ptr.h", + "//third_party/libc++/src/include/__memory/builtin_new_allocator.h", + "//third_party/libc++/src/include/__memory/compressed_pair.h", + "//third_party/libc++/src/include/__memory/concepts.h", + "//third_party/libc++/src/include/__memory/construct_at.h", + "//third_party/libc++/src/include/__memory/destruct_n.h", + "//third_party/libc++/src/include/__memory/pointer_traits.h", + "//third_party/libc++/src/include/__memory/ranges_construct_at.h", + "//third_party/libc++/src/include/__memory/ranges_uninitialized_algorithms.h", + "//third_party/libc++/src/include/__memory/raw_storage_iterator.h", + "//third_party/libc++/src/include/__memory/shared_ptr.h", + "//third_party/libc++/src/include/__memory/swap_allocator.h", + "//third_party/libc++/src/include/__memory/temp_value.h", + "//third_party/libc++/src/include/__memory/temporary_buffer.h", + "//third_party/libc++/src/include/__memory/uninitialized_algorithms.h", + "//third_party/libc++/src/include/__memory/uninitialized_buffer.h", + "//third_party/libc++/src/include/__memory/unique_ptr.h", + "//third_party/libc++/src/include/__memory/uses_allocator.h", + "//third_party/libc++/src/include/__memory/uses_allocator_construction.h", + "//third_party/libc++/src/include/__memory/voidify.h", + "//third_party/libc++/src/include/__memory_resource/memory_resource.h", + "//third_party/libc++/src/include/__memory_resource/monotonic_buffer_resource.h", + "//third_party/libc++/src/include/__memory_resource/polymorphic_allocator.h", + "//third_party/libc++/src/include/__memory_resource/pool_options.h", + "//third_party/libc++/src/include/__memory_resource/synchronized_pool_resource.h", + "//third_party/libc++/src/include/__memory_resource/unsynchronized_pool_resource.h", + "//third_party/libc++/src/include/__mutex/lock_guard.h", + "//third_party/libc++/src/include/__mutex/mutex.h", + "//third_party/libc++/src/include/__mutex/tag_types.h", + "//third_party/libc++/src/include/__mutex/unique_lock.h", + "//third_party/libc++/src/include/__node_handle", + "//third_party/libc++/src/include/__numeric/accumulate.h", + "//third_party/libc++/src/include/__numeric/adjacent_difference.h", + "//third_party/libc++/src/include/__numeric/exclusive_scan.h", + "//third_party/libc++/src/include/__numeric/gcd_lcm.h", + "//third_party/libc++/src/include/__numeric/inclusive_scan.h", + "//third_party/libc++/src/include/__numeric/inner_product.h", + "//third_party/libc++/src/include/__numeric/iota.h", + "//third_party/libc++/src/include/__numeric/midpoint.h", + "//third_party/libc++/src/include/__numeric/partial_sum.h", + "//third_party/libc++/src/include/__numeric/pstl_reduce.h", + "//third_party/libc++/src/include/__numeric/pstl_transform_reduce.h", + "//third_party/libc++/src/include/__numeric/reduce.h", + "//third_party/libc++/src/include/__numeric/transform_exclusive_scan.h", + "//third_party/libc++/src/include/__numeric/transform_inclusive_scan.h", + "//third_party/libc++/src/include/__numeric/transform_reduce.h", + "//third_party/libc++/src/include/__pstl/internal/algorithm_fwd.h", + "//third_party/libc++/src/include/__pstl/internal/algorithm_impl.h", + "//third_party/libc++/src/include/__pstl/internal/execution_defs.h", + "//third_party/libc++/src/include/__pstl/internal/execution_impl.h", + "//third_party/libc++/src/include/__pstl/internal/glue_algorithm_defs.h", + "//third_party/libc++/src/include/__pstl/internal/glue_algorithm_impl.h", + "//third_party/libc++/src/include/__pstl/internal/glue_memory_defs.h", + "//third_party/libc++/src/include/__pstl/internal/glue_memory_impl.h", + "//third_party/libc++/src/include/__pstl/internal/glue_numeric_defs.h", + "//third_party/libc++/src/include/__pstl/internal/glue_numeric_impl.h", + "//third_party/libc++/src/include/__pstl/internal/memory_impl.h", + "//third_party/libc++/src/include/__pstl/internal/numeric_fwd.h", + "//third_party/libc++/src/include/__pstl/internal/numeric_impl.h", + "//third_party/libc++/src/include/__pstl/internal/omp/parallel_for.h", + "//third_party/libc++/src/include/__pstl/internal/omp/parallel_for_each.h", + "//third_party/libc++/src/include/__pstl/internal/omp/parallel_invoke.h", + "//third_party/libc++/src/include/__pstl/internal/omp/parallel_merge.h", + "//third_party/libc++/src/include/__pstl/internal/omp/parallel_reduce.h", + "//third_party/libc++/src/include/__pstl/internal/omp/parallel_scan.h", + "//third_party/libc++/src/include/__pstl/internal/omp/parallel_stable_partial_sort.h", + "//third_party/libc++/src/include/__pstl/internal/omp/parallel_stable_sort.h", + "//third_party/libc++/src/include/__pstl/internal/omp/parallel_transform_reduce.h", + "//third_party/libc++/src/include/__pstl/internal/omp/parallel_transform_scan.h", + "//third_party/libc++/src/include/__pstl/internal/omp/util.h", + "//third_party/libc++/src/include/__pstl/internal/parallel_backend.h", + "//third_party/libc++/src/include/__pstl/internal/parallel_backend_omp.h", + "//third_party/libc++/src/include/__pstl/internal/parallel_backend_serial.h", + "//third_party/libc++/src/include/__pstl/internal/parallel_backend_tbb.h", + "//third_party/libc++/src/include/__pstl/internal/parallel_backend_utils.h", + "//third_party/libc++/src/include/__pstl/internal/unseq_backend_simd.h", + "//third_party/libc++/src/include/__pstl/internal/utils.h", + "//third_party/libc++/src/include/__pstl_algorithm", + "//third_party/libc++/src/include/__pstl_config_site.in", + "//third_party/libc++/src/include/__pstl_memory", + "//third_party/libc++/src/include/__pstl_numeric", + "//third_party/libc++/src/include/__random/bernoulli_distribution.h", + "//third_party/libc++/src/include/__random/binomial_distribution.h", + "//third_party/libc++/src/include/__random/cauchy_distribution.h", + "//third_party/libc++/src/include/__random/chi_squared_distribution.h", + "//third_party/libc++/src/include/__random/clamp_to_integral.h", + "//third_party/libc++/src/include/__random/default_random_engine.h", + "//third_party/libc++/src/include/__random/discard_block_engine.h", + "//third_party/libc++/src/include/__random/discrete_distribution.h", + "//third_party/libc++/src/include/__random/exponential_distribution.h", + "//third_party/libc++/src/include/__random/extreme_value_distribution.h", + "//third_party/libc++/src/include/__random/fisher_f_distribution.h", + "//third_party/libc++/src/include/__random/gamma_distribution.h", + "//third_party/libc++/src/include/__random/generate_canonical.h", + "//third_party/libc++/src/include/__random/geometric_distribution.h", + "//third_party/libc++/src/include/__random/independent_bits_engine.h", + "//third_party/libc++/src/include/__random/is_seed_sequence.h", + "//third_party/libc++/src/include/__random/is_valid.h", + "//third_party/libc++/src/include/__random/knuth_b.h", + "//third_party/libc++/src/include/__random/linear_congruential_engine.h", + "//third_party/libc++/src/include/__random/log2.h", + "//third_party/libc++/src/include/__random/lognormal_distribution.h", + "//third_party/libc++/src/include/__random/mersenne_twister_engine.h", + "//third_party/libc++/src/include/__random/negative_binomial_distribution.h", + "//third_party/libc++/src/include/__random/normal_distribution.h", + "//third_party/libc++/src/include/__random/piecewise_constant_distribution.h", + "//third_party/libc++/src/include/__random/piecewise_linear_distribution.h", + "//third_party/libc++/src/include/__random/poisson_distribution.h", + "//third_party/libc++/src/include/__random/random_device.h", + "//third_party/libc++/src/include/__random/ranlux.h", + "//third_party/libc++/src/include/__random/seed_seq.h", + "//third_party/libc++/src/include/__random/shuffle_order_engine.h", + "//third_party/libc++/src/include/__random/student_t_distribution.h", + "//third_party/libc++/src/include/__random/subtract_with_carry_engine.h", + "//third_party/libc++/src/include/__random/uniform_int_distribution.h", + "//third_party/libc++/src/include/__random/uniform_random_bit_generator.h", + "//third_party/libc++/src/include/__random/uniform_real_distribution.h", + "//third_party/libc++/src/include/__random/weibull_distribution.h", + "//third_party/libc++/src/include/__ranges/access.h", + "//third_party/libc++/src/include/__ranges/all.h", + "//third_party/libc++/src/include/__ranges/as_rvalue_view.h", + "//third_party/libc++/src/include/__ranges/common_view.h", + "//third_party/libc++/src/include/__ranges/concepts.h", + "//third_party/libc++/src/include/__ranges/container_compatible_range.h", + "//third_party/libc++/src/include/__ranges/counted.h", + "//third_party/libc++/src/include/__ranges/dangling.h", + "//third_party/libc++/src/include/__ranges/data.h", + "//third_party/libc++/src/include/__ranges/drop_view.h", + "//third_party/libc++/src/include/__ranges/drop_while_view.h", + "//third_party/libc++/src/include/__ranges/elements_view.h", + "//third_party/libc++/src/include/__ranges/empty.h", + "//third_party/libc++/src/include/__ranges/empty_view.h", + "//third_party/libc++/src/include/__ranges/enable_borrowed_range.h", + "//third_party/libc++/src/include/__ranges/enable_view.h", + "//third_party/libc++/src/include/__ranges/filter_view.h", + "//third_party/libc++/src/include/__ranges/from_range.h", + "//third_party/libc++/src/include/__ranges/iota_view.h", + "//third_party/libc++/src/include/__ranges/istream_view.h", + "//third_party/libc++/src/include/__ranges/join_view.h", + "//third_party/libc++/src/include/__ranges/lazy_split_view.h", + "//third_party/libc++/src/include/__ranges/movable_box.h", + "//third_party/libc++/src/include/__ranges/non_propagating_cache.h", + "//third_party/libc++/src/include/__ranges/owning_view.h", + "//third_party/libc++/src/include/__ranges/range_adaptor.h", + "//third_party/libc++/src/include/__ranges/rbegin.h", + "//third_party/libc++/src/include/__ranges/ref_view.h", + "//third_party/libc++/src/include/__ranges/rend.h", + "//third_party/libc++/src/include/__ranges/reverse_view.h", + "//third_party/libc++/src/include/__ranges/single_view.h", + "//third_party/libc++/src/include/__ranges/size.h", + "//third_party/libc++/src/include/__ranges/split_view.h", + "//third_party/libc++/src/include/__ranges/subrange.h", + "//third_party/libc++/src/include/__ranges/take_view.h", + "//third_party/libc++/src/include/__ranges/take_while_view.h", + "//third_party/libc++/src/include/__ranges/transform_view.h", + "//third_party/libc++/src/include/__ranges/view_interface.h", + "//third_party/libc++/src/include/__ranges/views.h", + "//third_party/libc++/src/include/__ranges/zip_view.h", + "//third_party/libc++/src/include/__split_buffer", + "//third_party/libc++/src/include/__std_mbstate_t.h", + "//third_party/libc++/src/include/__stop_token/atomic_unique_lock.h", + "//third_party/libc++/src/include/__stop_token/intrusive_list_view.h", + "//third_party/libc++/src/include/__stop_token/intrusive_shared_ptr.h", + "//third_party/libc++/src/include/__stop_token/stop_callback.h", + "//third_party/libc++/src/include/__stop_token/stop_source.h", + "//third_party/libc++/src/include/__stop_token/stop_state.h", + "//third_party/libc++/src/include/__stop_token/stop_token.h", + "//third_party/libc++/src/include/__string/char_traits.h", + "//third_party/libc++/src/include/__string/constexpr_c_functions.h", + "//third_party/libc++/src/include/__string/extern_template_lists.h", + "//third_party/libc++/src/include/__support/android/locale_bionic.h", + "//third_party/libc++/src/include/__support/fuchsia/xlocale.h", + "//third_party/libc++/src/include/__support/ibm/gettod_zos.h", + "//third_party/libc++/src/include/__support/ibm/locale_mgmt_zos.h", + "//third_party/libc++/src/include/__support/ibm/nanosleep.h", + "//third_party/libc++/src/include/__support/ibm/xlocale.h", + "//third_party/libc++/src/include/__support/musl/xlocale.h", + "//third_party/libc++/src/include/__support/newlib/xlocale.h", + "//third_party/libc++/src/include/__support/openbsd/xlocale.h", + "//third_party/libc++/src/include/__support/win32/locale_win32.h", + "//third_party/libc++/src/include/__support/xlocale/__nop_locale_mgmt.h", + "//third_party/libc++/src/include/__support/xlocale/__posix_l_fallback.h", + "//third_party/libc++/src/include/__support/xlocale/__strtonum_fallback.h", + "//third_party/libc++/src/include/__system_error/errc.h", + "//third_party/libc++/src/include/__system_error/error_category.h", + "//third_party/libc++/src/include/__system_error/error_code.h", + "//third_party/libc++/src/include/__system_error/error_condition.h", + "//third_party/libc++/src/include/__system_error/system_error.h", + "//third_party/libc++/src/include/__thread/formatter.h", + "//third_party/libc++/src/include/__thread/poll_with_backoff.h", + "//third_party/libc++/src/include/__thread/this_thread.h", + "//third_party/libc++/src/include/__thread/thread.h", + "//third_party/libc++/src/include/__thread/timed_backoff_policy.h", + "//third_party/libc++/src/include/__threading_support", + "//third_party/libc++/src/include/__tree", + "//third_party/libc++/src/include/__tuple/make_tuple_types.h", + "//third_party/libc++/src/include/__tuple/pair_like.h", + "//third_party/libc++/src/include/__tuple/sfinae_helpers.h", + "//third_party/libc++/src/include/__tuple/tuple_element.h", + "//third_party/libc++/src/include/__tuple/tuple_indices.h", + "//third_party/libc++/src/include/__tuple/tuple_like.h", + "//third_party/libc++/src/include/__tuple/tuple_like_ext.h", + "//third_party/libc++/src/include/__tuple/tuple_size.h", + "//third_party/libc++/src/include/__tuple/tuple_types.h", + "//third_party/libc++/src/include/__type_traits/add_const.h", + "//third_party/libc++/src/include/__type_traits/add_cv.h", + "//third_party/libc++/src/include/__type_traits/add_lvalue_reference.h", + "//third_party/libc++/src/include/__type_traits/add_pointer.h", + "//third_party/libc++/src/include/__type_traits/add_rvalue_reference.h", + "//third_party/libc++/src/include/__type_traits/add_volatile.h", + "//third_party/libc++/src/include/__type_traits/aligned_storage.h", + "//third_party/libc++/src/include/__type_traits/aligned_union.h", + "//third_party/libc++/src/include/__type_traits/alignment_of.h", + "//third_party/libc++/src/include/__type_traits/apply_cv.h", + "//third_party/libc++/src/include/__type_traits/can_extract_key.h", + "//third_party/libc++/src/include/__type_traits/common_reference.h", + "//third_party/libc++/src/include/__type_traits/common_type.h", + "//third_party/libc++/src/include/__type_traits/conditional.h", + "//third_party/libc++/src/include/__type_traits/conjunction.h", + "//third_party/libc++/src/include/__type_traits/copy_cv.h", + "//third_party/libc++/src/include/__type_traits/copy_cvref.h", + "//third_party/libc++/src/include/__type_traits/decay.h", + "//third_party/libc++/src/include/__type_traits/dependent_type.h", + "//third_party/libc++/src/include/__type_traits/disjunction.h", + "//third_party/libc++/src/include/__type_traits/enable_if.h", + "//third_party/libc++/src/include/__type_traits/extent.h", + "//third_party/libc++/src/include/__type_traits/has_unique_object_representation.h", + "//third_party/libc++/src/include/__type_traits/has_virtual_destructor.h", + "//third_party/libc++/src/include/__type_traits/integral_constant.h", + "//third_party/libc++/src/include/__type_traits/invoke.h", + "//third_party/libc++/src/include/__type_traits/is_abstract.h", + "//third_party/libc++/src/include/__type_traits/is_aggregate.h", + "//third_party/libc++/src/include/__type_traits/is_allocator.h", + "//third_party/libc++/src/include/__type_traits/is_always_bitcastable.h", + "//third_party/libc++/src/include/__type_traits/is_arithmetic.h", + "//third_party/libc++/src/include/__type_traits/is_array.h", + "//third_party/libc++/src/include/__type_traits/is_assignable.h", + "//third_party/libc++/src/include/__type_traits/is_base_of.h", + "//third_party/libc++/src/include/__type_traits/is_bounded_array.h", + "//third_party/libc++/src/include/__type_traits/is_callable.h", + "//third_party/libc++/src/include/__type_traits/is_char_like_type.h", + "//third_party/libc++/src/include/__type_traits/is_class.h", + "//third_party/libc++/src/include/__type_traits/is_compound.h", + "//third_party/libc++/src/include/__type_traits/is_const.h", + "//third_party/libc++/src/include/__type_traits/is_constant_evaluated.h", + "//third_party/libc++/src/include/__type_traits/is_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_convertible.h", + "//third_party/libc++/src/include/__type_traits/is_copy_assignable.h", + "//third_party/libc++/src/include/__type_traits/is_copy_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_core_convertible.h", + "//third_party/libc++/src/include/__type_traits/is_default_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_destructible.h", + "//third_party/libc++/src/include/__type_traits/is_empty.h", + "//third_party/libc++/src/include/__type_traits/is_enum.h", + "//third_party/libc++/src/include/__type_traits/is_equality_comparable.h", + "//third_party/libc++/src/include/__type_traits/is_execution_policy.h", + "//third_party/libc++/src/include/__type_traits/is_final.h", + "//third_party/libc++/src/include/__type_traits/is_floating_point.h", + "//third_party/libc++/src/include/__type_traits/is_function.h", + "//third_party/libc++/src/include/__type_traits/is_fundamental.h", + "//third_party/libc++/src/include/__type_traits/is_implicitly_default_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_integral.h", + "//third_party/libc++/src/include/__type_traits/is_literal_type.h", + "//third_party/libc++/src/include/__type_traits/is_member_function_pointer.h", + "//third_party/libc++/src/include/__type_traits/is_member_object_pointer.h", + "//third_party/libc++/src/include/__type_traits/is_member_pointer.h", + "//third_party/libc++/src/include/__type_traits/is_move_assignable.h", + "//third_party/libc++/src/include/__type_traits/is_move_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_nothrow_assignable.h", + "//third_party/libc++/src/include/__type_traits/is_nothrow_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_nothrow_convertible.h", + "//third_party/libc++/src/include/__type_traits/is_nothrow_copy_assignable.h", + "//third_party/libc++/src/include/__type_traits/is_nothrow_copy_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_nothrow_default_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_nothrow_destructible.h", + "//third_party/libc++/src/include/__type_traits/is_nothrow_move_assignable.h", + "//third_party/libc++/src/include/__type_traits/is_nothrow_move_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_null_pointer.h", + "//third_party/libc++/src/include/__type_traits/is_object.h", + "//third_party/libc++/src/include/__type_traits/is_pod.h", + "//third_party/libc++/src/include/__type_traits/is_pointer.h", + "//third_party/libc++/src/include/__type_traits/is_polymorphic.h", + "//third_party/libc++/src/include/__type_traits/is_primary_template.h", + "//third_party/libc++/src/include/__type_traits/is_reference.h", + "//third_party/libc++/src/include/__type_traits/is_reference_wrapper.h", + "//third_party/libc++/src/include/__type_traits/is_referenceable.h", + "//third_party/libc++/src/include/__type_traits/is_same.h", + "//third_party/libc++/src/include/__type_traits/is_scalar.h", + "//third_party/libc++/src/include/__type_traits/is_scoped_enum.h", + "//third_party/libc++/src/include/__type_traits/is_signed.h", + "//third_party/libc++/src/include/__type_traits/is_signed_integer.h", + "//third_party/libc++/src/include/__type_traits/is_specialization.h", + "//third_party/libc++/src/include/__type_traits/is_standard_layout.h", + "//third_party/libc++/src/include/__type_traits/is_swappable.h", + "//third_party/libc++/src/include/__type_traits/is_trivial.h", + "//third_party/libc++/src/include/__type_traits/is_trivially_assignable.h", + "//third_party/libc++/src/include/__type_traits/is_trivially_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_trivially_copy_assignable.h", + "//third_party/libc++/src/include/__type_traits/is_trivially_copy_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_trivially_copyable.h", + "//third_party/libc++/src/include/__type_traits/is_trivially_default_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_trivially_destructible.h", + "//third_party/libc++/src/include/__type_traits/is_trivially_lexicographically_comparable.h", + "//third_party/libc++/src/include/__type_traits/is_trivially_move_assignable.h", + "//third_party/libc++/src/include/__type_traits/is_trivially_move_constructible.h", + "//third_party/libc++/src/include/__type_traits/is_unbounded_array.h", + "//third_party/libc++/src/include/__type_traits/is_union.h", + "//third_party/libc++/src/include/__type_traits/is_unsigned.h", + "//third_party/libc++/src/include/__type_traits/is_unsigned_integer.h", + "//third_party/libc++/src/include/__type_traits/is_valid_expansion.h", + "//third_party/libc++/src/include/__type_traits/is_void.h", + "//third_party/libc++/src/include/__type_traits/is_volatile.h", + "//third_party/libc++/src/include/__type_traits/lazy.h", + "//third_party/libc++/src/include/__type_traits/make_32_64_or_128_bit.h", + "//third_party/libc++/src/include/__type_traits/make_const_lvalue_ref.h", + "//third_party/libc++/src/include/__type_traits/make_signed.h", + "//third_party/libc++/src/include/__type_traits/make_unsigned.h", + "//third_party/libc++/src/include/__type_traits/maybe_const.h", + "//third_party/libc++/src/include/__type_traits/nat.h", + "//third_party/libc++/src/include/__type_traits/negation.h", + "//third_party/libc++/src/include/__type_traits/noexcept_move_assign_container.h", + "//third_party/libc++/src/include/__type_traits/operation_traits.h", + "//third_party/libc++/src/include/__type_traits/predicate_traits.h", + "//third_party/libc++/src/include/__type_traits/promote.h", + "//third_party/libc++/src/include/__type_traits/rank.h", + "//third_party/libc++/src/include/__type_traits/remove_all_extents.h", + "//third_party/libc++/src/include/__type_traits/remove_const.h", + "//third_party/libc++/src/include/__type_traits/remove_const_ref.h", + "//third_party/libc++/src/include/__type_traits/remove_cv.h", + "//third_party/libc++/src/include/__type_traits/remove_cvref.h", + "//third_party/libc++/src/include/__type_traits/remove_extent.h", + "//third_party/libc++/src/include/__type_traits/remove_pointer.h", + "//third_party/libc++/src/include/__type_traits/remove_reference.h", + "//third_party/libc++/src/include/__type_traits/remove_volatile.h", + "//third_party/libc++/src/include/__type_traits/result_of.h", + "//third_party/libc++/src/include/__type_traits/strip_signature.h", + "//third_party/libc++/src/include/__type_traits/type_identity.h", + "//third_party/libc++/src/include/__type_traits/type_list.h", + "//third_party/libc++/src/include/__type_traits/underlying_type.h", + "//third_party/libc++/src/include/__type_traits/unwrap_ref.h", + "//third_party/libc++/src/include/__type_traits/void_t.h", + "//third_party/libc++/src/include/__undef_macros", + "//third_party/libc++/src/include/__utility/as_const.h", + "//third_party/libc++/src/include/__utility/auto_cast.h", + "//third_party/libc++/src/include/__utility/cmp.h", + "//third_party/libc++/src/include/__utility/convert_to_integral.h", + "//third_party/libc++/src/include/__utility/declval.h", + "//third_party/libc++/src/include/__utility/exception_guard.h", + "//third_party/libc++/src/include/__utility/exchange.h", + "//third_party/libc++/src/include/__utility/forward.h", + "//third_party/libc++/src/include/__utility/forward_like.h", + "//third_party/libc++/src/include/__utility/in_place.h", + "//third_party/libc++/src/include/__utility/integer_sequence.h", + "//third_party/libc++/src/include/__utility/is_pointer_in_range.h", + "//third_party/libc++/src/include/__utility/move.h", + "//third_party/libc++/src/include/__utility/pair.h", + "//third_party/libc++/src/include/__utility/piecewise_construct.h", + "//third_party/libc++/src/include/__utility/priority_tag.h", + "//third_party/libc++/src/include/__utility/rel_ops.h", + "//third_party/libc++/src/include/__utility/swap.h", + "//third_party/libc++/src/include/__utility/terminate_on_exception.h", + "//third_party/libc++/src/include/__utility/to_underlying.h", + "//third_party/libc++/src/include/__utility/unreachable.h", + "//third_party/libc++/src/include/__variant/monostate.h", + "//third_party/libc++/src/include/__verbose_abort", + "//third_party/libc++/src/include/algorithm", + "//third_party/libc++/src/include/any", + "//third_party/libc++/src/include/array", + "//third_party/libc++/src/include/atomic", + "//third_party/libc++/src/include/barrier", + "//third_party/libc++/src/include/bit", + "//third_party/libc++/src/include/bitset", + "//third_party/libc++/src/include/cassert", + "//third_party/libc++/src/include/ccomplex", + "//third_party/libc++/src/include/cctype", + "//third_party/libc++/src/include/cerrno", + "//third_party/libc++/src/include/cfenv", + "//third_party/libc++/src/include/cfloat", + "//third_party/libc++/src/include/charconv", + "//third_party/libc++/src/include/chrono", + "//third_party/libc++/src/include/cinttypes", + "//third_party/libc++/src/include/ciso646", + "//third_party/libc++/src/include/climits", + "//third_party/libc++/src/include/clocale", + "//third_party/libc++/src/include/cmath", + "//third_party/libc++/src/include/codecvt", + "//third_party/libc++/src/include/compare", + "//third_party/libc++/src/include/complex", + "//third_party/libc++/src/include/complex.h", + "//third_party/libc++/src/include/concepts", + "//third_party/libc++/src/include/condition_variable", + "//third_party/libc++/src/include/coroutine", + "//third_party/libc++/src/include/csetjmp", + "//third_party/libc++/src/include/csignal", + "//third_party/libc++/src/include/cstdarg", + "//third_party/libc++/src/include/cstdbool", + "//third_party/libc++/src/include/cstddef", + "//third_party/libc++/src/include/cstdint", + "//third_party/libc++/src/include/cstdio", + "//third_party/libc++/src/include/cstdlib", + "//third_party/libc++/src/include/cstring", + "//third_party/libc++/src/include/ctgmath", + "//third_party/libc++/src/include/ctime", + "//third_party/libc++/src/include/ctype.h", + "//third_party/libc++/src/include/cuchar", + "//third_party/libc++/src/include/cwchar", + "//third_party/libc++/src/include/cwctype", + "//third_party/libc++/src/include/deque", + "//third_party/libc++/src/include/errno.h", + "//third_party/libc++/src/include/exception", + "//third_party/libc++/src/include/execution", + "//third_party/libc++/src/include/expected", + "//third_party/libc++/src/include/experimental/__config", + "//third_party/libc++/src/include/experimental/__memory", + "//third_party/libc++/src/include/experimental/deque", + "//third_party/libc++/src/include/experimental/forward_list", + "//third_party/libc++/src/include/experimental/iterator", + "//third_party/libc++/src/include/experimental/list", + "//third_party/libc++/src/include/experimental/map", + "//third_party/libc++/src/include/experimental/memory_resource", + "//third_party/libc++/src/include/experimental/propagate_const", + "//third_party/libc++/src/include/experimental/regex", + "//third_party/libc++/src/include/experimental/set", + "//third_party/libc++/src/include/experimental/simd", + "//third_party/libc++/src/include/experimental/string", + "//third_party/libc++/src/include/experimental/type_traits", + "//third_party/libc++/src/include/experimental/unordered_map", + "//third_party/libc++/src/include/experimental/unordered_set", + "//third_party/libc++/src/include/experimental/utility", + "//third_party/libc++/src/include/experimental/vector", + "//third_party/libc++/src/include/ext/__hash", + "//third_party/libc++/src/include/ext/hash_map", + "//third_party/libc++/src/include/ext/hash_set", + "//third_party/libc++/src/include/fenv.h", + "//third_party/libc++/src/include/filesystem", + "//third_party/libc++/src/include/float.h", + "//third_party/libc++/src/include/format", + "//third_party/libc++/src/include/forward_list", + "//third_party/libc++/src/include/fstream", + "//third_party/libc++/src/include/functional", + "//third_party/libc++/src/include/future", + "//third_party/libc++/src/include/initializer_list", + "//third_party/libc++/src/include/inttypes.h", + "//third_party/libc++/src/include/iomanip", + "//third_party/libc++/src/include/ios", + "//third_party/libc++/src/include/iosfwd", + "//third_party/libc++/src/include/iostream", + "//third_party/libc++/src/include/istream", + "//third_party/libc++/src/include/iterator", + "//third_party/libc++/src/include/latch", + "//third_party/libc++/src/include/libcxx.imp", + "//third_party/libc++/src/include/limits", + "//third_party/libc++/src/include/limits.h", + "//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", + "//third_party/libc++/src/include/memory", + "//third_party/libc++/src/include/memory_resource", + "//third_party/libc++/src/include/module.modulemap.in", + "//third_party/libc++/src/include/mutex", + "//third_party/libc++/src/include/new", + "//third_party/libc++/src/include/numbers", + "//third_party/libc++/src/include/numeric", + "//third_party/libc++/src/include/optional", + "//third_party/libc++/src/include/ostream", + "//third_party/libc++/src/include/queue", + "//third_party/libc++/src/include/random", + "//third_party/libc++/src/include/ranges", + "//third_party/libc++/src/include/ratio", + "//third_party/libc++/src/include/regex", + "//third_party/libc++/src/include/scoped_allocator", + "//third_party/libc++/src/include/semaphore", + "//third_party/libc++/src/include/set", + "//third_party/libc++/src/include/setjmp.h", + "//third_party/libc++/src/include/shared_mutex", + "//third_party/libc++/src/include/source_location", + "//third_party/libc++/src/include/span", + "//third_party/libc++/src/include/sstream", + "//third_party/libc++/src/include/stack", + "//third_party/libc++/src/include/stdatomic.h", + "//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", + "//third_party/libc++/src/include/streambuf", + "//third_party/libc++/src/include/string", + "//third_party/libc++/src/include/string.h", + "//third_party/libc++/src/include/string_view", + "//third_party/libc++/src/include/strstream", + "//third_party/libc++/src/include/system_error", + "//third_party/libc++/src/include/tgmath.h", + "//third_party/libc++/src/include/thread", + "//third_party/libc++/src/include/tuple", + "//third_party/libc++/src/include/type_traits", + "//third_party/libc++/src/include/typeindex", + "//third_party/libc++/src/include/typeinfo", + "//third_party/libc++/src/include/uchar.h", + "//third_party/libc++/src/include/unordered_map", + "//third_party/libc++/src/include/unordered_set", + "//third_party/libc++/src/include/utility", + "//third_party/libc++/src/include/valarray", + "//third_party/libc++/src/include/variant", + "//third_party/libc++/src/include/vector", + "//third_party/libc++/src/include/version", + "//third_party/libc++/src/include/wchar.h", + "//third_party/libc++/src/include/wctype.h", ] -libcxx_licenses = [ "//buildtools/third_party/libc++/trunk/LICENSE.TXT" ] +libcxx_licenses = [ "//third_party/libc++/src/LICENSE.TXT" ] diff --git a/filenames.libcxxabi.gni b/filenames.libcxxabi.gni index 69bb490ccd89a..f5472d68172c0 100644 --- a/filenames.libcxxabi.gni +++ b/filenames.libcxxabi.gni @@ -1,7 +1,7 @@ libcxxabi_headers = [ - "//buildtools/third_party/libc++abi/trunk/include/CMakeLists.txt", - "//buildtools/third_party/libc++abi/trunk/include/__cxxabi_config.h", - "//buildtools/third_party/libc++abi/trunk/include/cxxabi.h", + "//third_party/libc++abi/src/include/CMakeLists.txt", + "//third_party/libc++abi/src/include/__cxxabi_config.h", + "//third_party/libc++abi/src/include/cxxabi.h", ] -libcxxabi_licenses = [ "//buildtools/third_party/libc++abi/trunk/LICENSE.TXT" ] +libcxxabi_licenses = [ "//third_party/libc++abi/src/LICENSE.TXT" ] diff --git a/patches/chromium/.patches b/patches/chromium/.patches index c3f6701b5dfd0..74222f67cf1e3 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -14,7 +14,6 @@ enable_reset_aspect_ratio.patch boringssl_build_gn.patch pepper_plugin_support.patch gtk_visibility.patch -sysroot.patch resource_file_conflict.patch scroll_bounce_flag.patch mas_blink_no_private_api.patch @@ -89,7 +88,6 @@ feat_add_data_parameter_to_processsingleton.patch load_v8_snapshot_in_browser_process.patch fix_adapt_exclusive_access_for_electron_needs.patch fix_aspect_ratio_with_max_size.patch -fix_dont_delete_SerialPortManager_on_main_thread.patch fix_crash_when_saving_edited_pdf_files.patch port_autofill_colors_to_the_color_pipeline.patch build_disable_partition_alloc_on_mac.patch @@ -125,7 +123,6 @@ chore_defer_usb_service_getdevices_request_until_usb_service_is.patch fix_remove_profiles_from_spellcheck_service.patch chore_patch_out_profile_methods_in_chrome_browser_pdf.patch chore_patch_out_profile_methods_in_titlebar_config.patch -fix_crash_on_nativetheme_change_during_context_menu_close.patch fix_select_the_first_menu_item_when_opened_via_keyboard.patch fix_return_v8_value_from_localframe_requestexecutescript.patch fix_harden_blink_scriptstate_maybefrom.patch diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index 8268d162c7577..1f47ce1745779 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -23,10 +23,10 @@ index 103a9d9fb17e954ecaf0acecaa3eeafc23e39c94..de299316216dba204decba3b0eb57f5c int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index abaf6b2c59058b670d1989be3693d7d69557e850..8866b3d54dc8c044a4bb08c6e233701207597cbb 100644 +index ddc816dab4419088069ebc3b64d60f199505e427..b75866eb9ce086f9c52055a6fc65af2a027e442d 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4476,6 +4476,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, +@@ -4474,6 +4474,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, observer.DidCreateScriptContext(context, world_id); } @@ -92,10 +92,10 @@ index 62e611ec3ac95eac88d4665d2640429e9d833594..7bf646d6cd8eaf29267b6136de0952e2 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 dbf7fd73a855f7d45eeeeff17582696aac66ff0d..9b489f661f524f380523e38518345e9b22eb8dec 100644 +index 89bb2bc3ed31070ebe70d7a9a0798923d17ebbe2..e0a76203690c61f00aaf2e01f27c0e0dd642e573 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 -@@ -283,6 +283,13 @@ void LocalFrameClientImpl::DidCreateScriptContext( +@@ -282,6 +282,13 @@ void LocalFrameClientImpl::DidCreateScriptContext( web_frame_->Client()->DidCreateScriptContext(context, world_id); } 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 68fe06de84b71..3fbad7bca34cf 100644 --- a/patches/chromium/add_electron_deps_to_license_credits_file.patch +++ b/patches/chromium/add_electron_deps_to_license_credits_file.patch @@ -7,7 +7,7 @@ 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 81dd367a1a3f0b59832406e97e3eb0b869741a34..2fbe3091c32dd1b3771711b84c86eaab67fd7a0e 100755 +index 15b461326e2ce4bd255cbe779b449261a7f63f09..ae6c83557dc3f299b33a5e42afb3d587c5c72100 100755 --- a/tools/licenses/licenses.py +++ b/tools/licenses/licenses.py @@ -424,6 +424,31 @@ SPECIAL_CASES = { @@ -41,4 +41,4 @@ index 81dd367a1a3f0b59832406e97e3eb0b869741a34..2fbe3091c32dd1b3771711b84c86eaab + }, } - # The delimiter used to separate license files specified in the 'License File' + # These buildtools/third_party directories only contain diff --git a/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch b/patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch index c0f3c6419f4ff..3765f2b63580c 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 a463500570c03b0461d625f4a41dfbf76e41d493..a50895d9ef0e3049130b952993d2d572012d542c 100644 +index 45958eda0794f21a55bf80806d9e17002d246a24..4980bf9d0e25f4fcd718216ca195b7e8d51d721b 100644 --- a/ui/gtk/gtk_ui.cc +++ b/ui/gtk/gtk_ui.cc -@@ -492,12 +492,13 @@ std::unique_ptr GtkUi::CreateNavButtonProvider() { +@@ -509,12 +509,13 @@ std::unique_ptr GtkUi::CreateNavButtonProvider() { return std::make_unique(); } 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 cdbc5e0cb9015..7314233933b05 100644 --- a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch +++ b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch @@ -6,7 +6,7 @@ Subject: allow disabling blink scheduler throttling per RenderView This allows us to disable throttling for hidden windows. diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc -index 421a0b8ba291a944db62507d1004210555a1200c..09dd63d9f9a59d32dc9dd569aaa176a94dbfdfaa 100644 +index 830307d5113f28027c8e99befb8eb47a19b37b7f..063d6a1af7d4cc516d9a5ece9fd178b5c5bd3df6 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc @@ -710,6 +710,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { @@ -22,10 +22,10 @@ index 421a0b8ba291a944db62507d1004210555a1200c..09dd63d9f9a59d32dc9dd569aaa176a9 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 180abdc9f983887c83fd9d4a596472222e9ab472..00842717a7570561ee9e3eca11190ab5e1c76fb8 100644 +index d44652650891eff7cd6111bc6d6454a009942cb6..16522609163ba6bc422fc30a8d145a25877c407e 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h -@@ -136,6 +136,7 @@ class CONTENT_EXPORT RenderViewHostImpl +@@ -140,6 +140,7 @@ class CONTENT_EXPORT RenderViewHostImpl void EnablePreferredSizeMode() override; void WriteIntoTrace(perfetto::TracedProto context) const override; @@ -34,7 +34,7 @@ index 180abdc9f983887c83fd9d4a596472222e9ab472..00842717a7570561ee9e3eca11190ab5 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 ae96b235b8b85abc7a8d5fc9213d90181a82faee..4974d23751093bb918ef3764289937b9da109b24 100644 +index 8fa040071ba1e70890f7dcf8193e83e147679ed7..3cc38ccd2793b801f5debd3d2815c367ce036e6b 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -565,8 +565,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) { @@ -99,7 +99,7 @@ index 8a18ecf567cd3a6a2fb1627083a5544a93198bf4..6bb4074e033e045de164bc776f75f152 // 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 70813fe806ce29cfeeb9ae93c06d714070404521..0913b97dd24270ff2e6e02964ea0c7536de8de22 100644 +index f4bd3d4fa8d85220557b3a2608f8ee5b808468d8..c724ee69385ae9817161a72f82a14c4ac9b5f835 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -2406,6 +2406,10 @@ void WebViewImpl::SetPageLifecycleStateInternal( 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 c8ffc5f094c60..4e0d812d1db1e 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,10 +8,10 @@ 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.cc b/third_party/blink/common/web_preferences/web_preferences.cc -index f214ce91e96ee752f4904bf7f9f67cebcedd6187..4c6f82829bee2e6baf916797f116b810ab286f2a 100644 +index 4f332fd867bed29f084891e5f2b281f5c99c011b..f63fda73d2b3337de60d23caacd9a0f0ae77364e 100644 --- a/third_party/blink/common/web_preferences/web_preferences.cc +++ b/third_party/blink/common/web_preferences/web_preferences.cc -@@ -145,6 +145,19 @@ WebPreferences::WebPreferences() +@@ -146,6 +146,19 @@ WebPreferences::WebPreferences() v8_cache_options(blink::mojom::V8CacheOptions::kDefault), record_whole_document(false), stylus_handwriting_enabled(false), @@ -32,10 +32,10 @@ index f214ce91e96ee752f4904bf7f9f67cebcedd6187..4c6f82829bee2e6baf916797f116b810 accelerated_video_decode_enabled(false), animation_policy( 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 1110a93dd7fad87a96fd8805eb1018cf7bbb5452..caf0cac5e1bf2a1607aa026d7c750f2880050cba 100644 +index 62b6af4669061757f3f707859f0296fd6c49bade..cbeece7a75f8c7a7169ea6b768bf0a056c849ee6 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 -@@ -149,6 +149,19 @@ bool StructTraitsv8_cache_options = data.v8_cache_options(); out->record_whole_document = data.record_whole_document(); out->stylus_handwriting_enabled = data.stylus_handwriting_enabled(); @@ -56,7 +56,7 @@ index 1110a93dd7fad87a96fd8805eb1018cf7bbb5452..caf0cac5e1bf2a1607aa026d7c750f28 out->accelerated_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 46244b8c50a1f00338d3751605105ca8c0601c81..1743d026e372889b725d7cd83b0264da10b50dda 100644 +index 8821fe095126feef49e50b87b84c29d1fa956a9b..61565991cc66a31e428cdf3fb0f457db08aaa901 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 @@ @@ -67,7 +67,7 @@ index 46244b8c50a1f00338d3751605105ca8c0601c81..1743d026e372889b725d7cd83b0264da #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" -@@ -160,6 +161,19 @@ struct BLINK_COMMON_EXPORT WebPreferences { +@@ -161,6 +162,19 @@ struct BLINK_COMMON_EXPORT WebPreferences { // If true, stylus handwriting recognition to text input will be available in // editable input fields which are non-password type. bool stylus_handwriting_enabled; @@ -88,7 +88,7 @@ index 46244b8c50a1f00338d3751605105ca8c0601c81..1743d026e372889b725d7cd83b0264da // This flags corresponds to a Page's Settings' setCookieEnabled state. It // only controls whether or not the "document.cookie" field is properly 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 e70bc5ea8ec5b518b44493f6ae88cdaa76627c74..bd9fa77df46523fef6a71773334fdf6bded64b1e 100644 +index 4e95e23afe936cb87b4390a977c69b1b8263335c..bec35f10856c982febf45dcc3a2ee651f5bf4fed 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 @@ @@ -99,7 +99,7 @@ index e70bc5ea8ec5b518b44493f6ae88cdaa76627c74..bd9fa77df46523fef6a71773334fdf6b #include "mojo/public/cpp/bindings/struct_traits.h" #include "net/nqe/effective_connection_type.h" #include "third_party/blink/public/common/common_export.h" -@@ -444,6 +445,52 @@ struct BLINK_COMMON_EXPORT StructTraitsDetached(type); diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc -index 84372d274225a4ef5787def680fecf6e50ef7c96..280fbb5608ffcd5bec33483c99a1a112a16a0c24 100644 +index 83f126adc28e8109df8e234b5b3fe6c844d2f26c..d50985b2e3fa32c54c2dc8612878cc30dcb2c76a 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc @@ -665,10 +665,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) { diff --git a/patches/chromium/build_disable_print_content_analysis.patch b/patches/chromium/build_disable_print_content_analysis.patch index 90786e5345d47..73536497cd579 100644 --- a/patches/chromium/build_disable_print_content_analysis.patch +++ b/patches/chromium/build_disable_print_content_analysis.patch @@ -13,7 +13,7 @@ This patch can be removed when enable_print_content_analysis can be more easily enabled or disabled by default with buildflags. diff --git a/printing/buildflags/buildflags.gni b/printing/buildflags/buildflags.gni -index 8d1aa0153c7b33066fbeb2679fcf1a32549389c3..a96831301d9e60e73092a095d42fecc0a8019144 100644 +index 5ceb96d63f948f94a44393337366bb68a2e0f31d..086f5e568cc6ae43c75477cfd3fac4c68f2a25b0 100644 --- a/printing/buildflags/buildflags.gni +++ b/printing/buildflags/buildflags.gni @@ -48,7 +48,7 @@ declare_args() { 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 b1d5ed3b371b3..0bd9512136784 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 @@ -33,10 +33,10 @@ index 7e99d7493ac1f9281668eb3283f7475769245021..3b11f490c77fb667e40c30e7d61e484d "//base", "//build:branding_buildflags", diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 20c93fe2fff92b9cb3989ce6d0639f018f121c33..85df12f08f7b5a131d00b871ae533c0bc88f1634 100644 +index d2207552c449f0219c6b2da984491144d14817b5..5b4bca66693337249d82545b58e6e0f1024a013d 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -4651,7 +4651,7 @@ static_library("browser") { +@@ -4678,7 +4678,7 @@ static_library("browser") { # On Windows, the hashes are embedded in //chrome:chrome_initial rather # than here in :chrome_dll. @@ -46,10 +46,10 @@ index 20c93fe2fff92b9cb3989ce6d0639f018f121c33..85df12f08f7b5a131d00b871ae533c0b sources += [ "certificate_viewer_stub.cc" ] } diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index c72ffb36b34ae3c7b2939a316e9d960a079a70fe..3056493bad516a97d4b4678ca7ff68918a27c150 100644 +index 840813730d52d1cf930cfbb3e322dc8f328836dc..9eee8efe4a43cacc70851f3427f471f0b59024ff 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -6715,7 +6715,6 @@ test("unit_tests") { +@@ -6755,7 +6755,6 @@ test("unit_tests") { deps += [ "//chrome:other_version", @@ -57,7 +57,7 @@ index c72ffb36b34ae3c7b2939a316e9d960a079a70fe..3056493bad516a97d4b4678ca7ff6891 "//chrome//services/util_win:unit_tests", "//chrome/app:chrome_dll_resources", "//chrome/app:win_unit_tests", -@@ -6741,6 +6740,10 @@ test("unit_tests") { +@@ -6781,6 +6780,10 @@ test("unit_tests") { "//ui/resources", ] @@ -68,7 +68,7 @@ index c72ffb36b34ae3c7b2939a316e9d960a079a70fe..3056493bad516a97d4b4678ca7ff6891 ldflags = [ "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll", "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll", -@@ -7696,7 +7699,6 @@ test("unit_tests") { +@@ -7740,7 +7743,6 @@ test("unit_tests") { } deps += [ @@ -76,7 +76,7 @@ index c72ffb36b34ae3c7b2939a316e9d960a079a70fe..3056493bad516a97d4b4678ca7ff6891 "//chrome/browser/apps:icon_standardizer", "//chrome/browser/apps/app_service", "//chrome/browser/apps/app_service:test_support", -@@ -7782,6 +7784,10 @@ test("unit_tests") { +@@ -7826,6 +7828,10 @@ test("unit_tests") { "//ui/webui/resources/js/browser_command:mojo_bindings", ] diff --git a/patches/chromium/build_gn.patch b/patches/chromium/build_gn.patch index 6645361e63804..529f86ca654c5 100644 --- a/patches/chromium/build_gn.patch +++ b/patches/chromium/build_gn.patch @@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will rebuild the entire tree. diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index b7c498f5b29a7fe8f674257dc9c912514a25253a..968276e781288e92ed87eaba43dba67b4475115c 100644 +index 105e194dd1d4d4003736ce5cf963bc1290de669f..7f80b6fab53e62296351695429e3a6b9bb717300 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 782c6acee4e7c..fb6140d062674 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 069fdba14a56808c8db3cf76c8245dff527b0add..4a20bed0985b0f4200a7e88f9f85ad93cb7dd6c3 100644 +index 448459ee94773786c9742eb16272b7c7c2078d7d..822a7e4e8cc7fd0d59c8c813c2108b369db6adac 100644 --- a/buildtools/third_party/libc++/BUILD.gn +++ b/buildtools/third_party/libc++/BUILD.gn @@ -44,7 +44,11 @@ config("winver") { @@ -32,7 +32,7 @@ index 069fdba14a56808c8db3cf76c8245dff527b0add..4a20bed0985b0f4200a7e88f9f85ad93 ] if (is_linux) { diff --git a/buildtools/third_party/libc++abi/BUILD.gn b/buildtools/third_party/libc++abi/BUILD.gn -index b1895ae3b8ddf5820d3dd0c294bd8b36d4b43dc7..38d32a0b11d7cf5c33ef9a481caa6dc58d2ccfde 100644 +index b5c15a0ead70604150a14820d8a829a5aa55f981..f1f984285e39192f5e1a8c5418c13915f5aa110a 100644 --- a/buildtools/third_party/libc++abi/BUILD.gn +++ b/buildtools/third_party/libc++abi/BUILD.gn @@ -6,7 +6,7 @@ import("//build/config/android/config.gni") diff --git a/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch b/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch index da7b179f2f351..eb06ac79054e2 100644 --- a/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch +++ b/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch @@ -6,10 +6,10 @@ Subject: build: only use the mas build config in the required components Before landing this patch should be split into the relevant MAS patches, or at least the patch this one partially reverts diff --git a/base/BUILD.gn b/base/BUILD.gn -index ac26cc76c6e78a241b8fb29aa98250b2b99c76cd..8671ecc36caff3a253b2f097f5912298b6ebdf8d 100644 +index 6e6f24e479cce61b5f189faed40601e8f3e82ef9..bfad3b64106388a9d5f917bcbd1af646bc47833f 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -1034,6 +1034,7 @@ component("base") { +@@ -1039,6 +1039,7 @@ component("base") { "//build/config/compiler:prevent_unsafe_narrowing", "//build/config/compiler:wexit_time_destructors", "//build/config/compiler:wglobal_constructors", @@ -18,7 +18,7 @@ index ac26cc76c6e78a241b8fb29aa98250b2b99c76cd..8671ecc36caff3a253b2f097f5912298 deps = [ diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn -index 968276e781288e92ed87eaba43dba67b4475115c..05f2f3084cac5bf3e806a03401475667848afd04 100644 +index 7f80b6fab53e62296351695429e3a6b9bb717300..420a13c16741037cf81de817c1808603e3fe6490 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -355,7 +355,6 @@ default_compiler_configs = [ @@ -30,7 +30,7 @@ index 968276e781288e92ed87eaba43dba67b4475115c..05f2f3084cac5bf3e806a03401475667 if (is_win) { diff --git a/components/os_crypt/sync/BUILD.gn b/components/os_crypt/sync/BUILD.gn -index f3e2ea6d0430df493fcebab6d6271299a2307b69..d01a9f2cbd5aa8de768c9c1e765c464bd31a115a 100644 +index c4bca6fca7c990222b0bf65087d14b21b01c1b5f..b95e2f3824ac4a029fb98a8d7e24f47e610120bd 100644 --- a/components/os_crypt/sync/BUILD.gn +++ b/components/os_crypt/sync/BUILD.gn @@ -47,6 +47,7 @@ component("os_crypt") { @@ -74,7 +74,7 @@ index 440fa0b3ff9b08016ff19ab54c70a453dc8c5f86..2e2f358829bf0492fd3e44173eeb7d0b if (is_win) { diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 88eca71122353752154a29e4f54693c3ac13f930..4540aff3ac4a06f76d332322fe87618f8a5cb6d0 100644 +index 224a6884ef5070efe1a51fdf1c24662388288432..95ea998ec0d00558ef12ebc172671e02e2efdcfc 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -56,6 +56,7 @@ source_set("browser") { @@ -110,7 +110,7 @@ index 62117d9c83972003d0483ed9fc6efad6a4490a75..246d7289fd5727886054e182e17520c5 public_deps = [ diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn -index 23b9f9008046f957c19bc169cc87defa49af46b3..72a11a958c3aecec43737d41d3a2219ac7416f8a 100644 +index 87cb6cc7da672c93271dab01f29b5611a736a6b9..30dd8742a8fbbb60d18988c1ff68cfc51f42a6ca 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn @@ -477,6 +477,7 @@ static_library("test_support") { @@ -135,7 +135,7 @@ index 5fcb135fdcdee5022e5caed46dece4e304495bfe..83cc95b1086b0619be019d7b797f3395 sources += [ "browser/web_test_browser_main_platform_support_mac.mm", diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn -index 1a8164c2ef7d6b24c4feb19ce3f3b5e970885541..e9122ac24b7b5f9359a89953fa24364a0115bdf6 100644 +index 4885f927ae2b871cf2911fb5bc5a2aac128b2aae..5f820bd6ef9f91f69e75065f08bd61a72970c2e6 100644 --- a/device/bluetooth/BUILD.gn +++ b/device/bluetooth/BUILD.gn @@ -241,6 +241,7 @@ component("bluetooth") { @@ -249,10 +249,10 @@ index 4e23c38763184840a393589b3f55dcabb0db8121..e4ad30d0d7acecdca3a22fe05935a340 if (use_atk) { diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index 614ae2d72c934f0f6650a501b7d132f5745f767e..ff4302c344ede0021c7379efeb17e2a1111cdce0 100644 +index 9233e89712a12e27d85232fb51f113f41375a08a..a73f9cb635a09b44ba35b0d5b1196dfdf921d277 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn -@@ -355,6 +355,7 @@ component("base") { +@@ -356,6 +356,7 @@ component("base") { "interaction/element_tracker_mac.mm", "resource/resource_bundle_mac.mm", ] @@ -288,10 +288,10 @@ index 0829ee9a58400dea171c99e0784607305092aa92..eaa938d159ed43539ca29c863318cd35 if (is_win) { sources += [ diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn -index 06cc420c752d1690ef2864b203721ba4c38e7f89..0fe2cb7ea7f15edd31db9e047fcb0cd9ddb5d1ed 100644 +index 4ea8e4f4636d555497759d8cf5f6181c4e7a649e..9556c2b11e1c0967fc04e61dba3321bd5020584b 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn -@@ -685,6 +685,7 @@ component("views") { +@@ -683,6 +683,7 @@ component("views") { "IOSurface.framework", "QuartzCore.framework", ] @@ -299,7 +299,7 @@ index 06cc420c752d1690ef2864b203721ba4c38e7f89..0fe2cb7ea7f15edd31db9e047fcb0cd9 } if (is_win) { -@@ -1104,6 +1105,8 @@ source_set("test_support") { +@@ -1102,6 +1103,8 @@ source_set("test_support") { "//testing/gtest", ] @@ -309,15 +309,14 @@ index 06cc420c752d1690ef2864b203721ba4c38e7f89..0fe2cb7ea7f15edd31db9e047fcb0cd9 sources += [ "test/desktop_window_tree_host_win_test_api.cc", diff --git a/ui/views/controls/webview/BUILD.gn b/ui/views/controls/webview/BUILD.gn -index e3dd4fab3a1cac0138f8dac60247e0ea3343e87e..998178845e241c8b45a3ef8ad542d10a4e687831 100644 +index e3dd4fab3a1cac0138f8dac60247e0ea3343e87e..f31130eaa3719eda0da5b3f0e8c294775faf6bd4 100644 --- a/ui/views/controls/webview/BUILD.gn +++ b/ui/views/controls/webview/BUILD.gn -@@ -19,6 +19,10 @@ component("webview") { +@@ -19,6 +19,9 @@ component("webview") { if (is_mac) { sources += [ "unhandled_keyboard_event_handler_mac.mm" ] + configs += [ -+ "//build/config/compiler:enable_arc", + "//electron/build/config:mas_build", + ] } diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index b749a81b00a84..fe7e3f17cb2ea 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 00b57b62ce1d6de6fd12accb082282c1325ad801..81b495cce7891a30c3ea1acc9160566d66acaef0 100644 +index fa8adac96c069c93a0b98ef79c6941a1907503bd..4da6272864fd6709dcb56b9561ec86f4b0e037be 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -8042,6 +8042,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -8065,6 +8065,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 00b57b62ce1d6de6fd12accb082282c1325ad801..81b495cce7891a30c3ea1acc9160566d &no_javascript_access); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 9a2acf6b3a661705c740de6bd84cc0abcba7973f..f362dc586802e47f45558b0cc068e2bf44cb796e 100644 +index 1caf3d1f032c407d2309c83d862104a24fcf5749..94d7caadca3d07fe2886715bc9b5eac6a7dfbd46 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4301,6 +4301,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4310,6 +4310,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( auto* new_contents_impl = new_contents.get(); @@ -37,7 +37,7 @@ index 9a2acf6b3a661705c740de6bd84cc0abcba7973f..f362dc586802e47f45558b0cc068e2bf // 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 -@@ -4342,12 +4348,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4351,12 +4357,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( AddWebContentsDestructionObserver(new_contents_impl); } @@ -66,10 +66,10 @@ index a1757960b139dea126e34776e9ec7768d9e3d89d..a3226c9a8080537daa2454b8014a6919 // 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 bd9d3b40e9aea64885014cc64f182997fe90dbdd..87bcb651c9361ec51ced9da4c7a2e259c4782ac6 100644 +index af623d96cb4a0d9397cfcc798e3b8d20ed331b1e..40a7acacf1218368245d20e50ecaaa267adabc5c 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -674,6 +674,8 @@ bool ContentBrowserClient::CanCreateWindow( +@@ -677,6 +677,8 @@ bool ContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -79,10 +79,10 @@ index bd9d3b40e9aea64885014cc64f182997fe90dbdd..87bcb651c9361ec51ced9da4c7a2e259 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 738cf91eca91de2732d1b3d2cfef7a482a768db3..e942f9cf1fb664591264e75e80d5d93ad70be070 100644 +index 5fec5acd6fac364e815014ac0166c6f241acae37..8e464a60370317ebd8682a0bb2aa983eb54f0c69 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -170,6 +170,7 @@ class NetworkService; +@@ -173,6 +173,7 @@ class NetworkService; class TrustedURLLoaderHeaderClient; } // namespace mojom struct ResourceRequest; @@ -90,7 +90,7 @@ index 738cf91eca91de2732d1b3d2cfef7a482a768db3..e942f9cf1fb664591264e75e80d5d93a } // namespace network namespace sandbox { -@@ -1090,6 +1091,8 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -1093,6 +1094,8 @@ class CONTENT_EXPORT ContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -122,7 +122,7 @@ index 688fac1fd874438ad9bc6494691b0eadca7e5bb2..db12930a449b38966e63c2274275b115 const OpenURLParams& params) { return nullptr; diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h -index 5a764b2f531e79bf31ab4c3c24b0f8adca241985..413419ac25d62f5058003480bc79d7a75c32a410 100644 +index 791cd97dd0c45055b7b447c733dd25f81cd2ed09..8b5a2052cb2b53b58253d42a36168da2a47ca532 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -16,6 +16,7 @@ @@ -148,10 +148,10 @@ index 5a764b2f531e79bf31ab4c3c24b0f8adca241985..413419ac25d62f5058003480bc79d7a7 // 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 9acd28becf42c2d25f6863df365003b0367e09ae..abaf6b2c59058b670d1989be3693d7d69557e850 100644 +index 146e7d09a1a04512add2715c76d2b4d54d95753e..ddc816dab4419088069ebc3b64d60f199505e427 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -6373,6 +6373,10 @@ WebView* RenderFrameImpl::CreateNewWindow( +@@ -6371,6 +6371,10 @@ WebView* RenderFrameImpl::CreateNewWindow( request.HasUserGesture(), GetWebFrame()->IsAdFrame(), GetWebFrame()->IsAdScriptInStack()); @@ -210,10 +210,10 @@ index bef5a989bac50c177f15f52fe87ac3790d553e85..65dcd2e3b51929400c8bfb6a98a4fb59 } // 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 efeac59aa515706fd4b3c0e5654d60f3185b62fd..c99c355f52a84256286ca0cd130085b4e54d356a 100644 +index 7529a505b448d8773a4a5191ae19f8d0bf89bec5..714874042813178000321d27cdbfaaafba9a1c00 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc -@@ -2192,6 +2192,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, +@@ -2164,6 +2164,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, WebWindowFeatures window_features = GetWindowFeaturesFromString(features, entered_window); diff --git a/patches/chromium/chore_add_buildflag_guard_around_new_include.patch b/patches/chromium/chore_add_buildflag_guard_around_new_include.patch index b9d3333760d88..b1074081d1614 100644 --- a/patches/chromium/chore_add_buildflag_guard_around_new_include.patch +++ b/patches/chromium/chore_add_buildflag_guard_around_new_include.patch @@ -9,7 +9,7 @@ This is an experimental commit; but if it's successful, This patch should be upstreamed and then removed from electron's code. diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h -index 502c0a7ffc25f1b9c1077734a77b16dd23f7942a..c4ecee6f375a1dc5adbd87023ff4130f29636553 100644 +index 58f128d2217a07be876b0878d64ebf593ce6eb37..dedb231d21ead676fd0f568d3cebd3fb8ad2ed6d 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -43,7 +43,6 @@ diff --git a/patches/chromium/chore_add_electron_deps_to_gitignores.patch b/patches/chromium/chore_add_electron_deps_to_gitignores.patch index 9750a1df77bb4..a52812b2d79e3 100644 --- a/patches/chromium/chore_add_electron_deps_to_gitignores.patch +++ b/patches/chromium/chore_add_electron_deps_to_gitignores.patch @@ -18,10 +18,10 @@ index 6241dd501bd423350accd2a2f0b69b5d8b7e45bd..08befddc25e17bfde46bb11e94b646e8 /google_apis/internal /googleurl diff --git a/third_party/.gitignore b/third_party/.gitignore -index 5464e9e25c767ceefef15553c546687d2ab5fdd3..1b82a4e3e9763b59cba4efc4044abcaa7e6c956f 100644 +index feddae902ca6385741cdae48ab5d73b9563e717a..fd74ef103033ea17beb9d7d576fe19c7463a8233 100644 --- a/third_party/.gitignore +++ b/third_party/.gitignore -@@ -95,6 +95,7 @@ +@@ -96,6 +96,7 @@ /directxsdk /dom_distiller_js/dist /eigen3/src @@ -29,7 +29,7 @@ index 5464e9e25c767ceefef15553c546687d2ab5fdd3..1b82a4e3e9763b59cba4efc4044abcaa /elfutils/src /emoji-metadata/src /emoji-segmenter/src -@@ -205,6 +206,7 @@ +@@ -209,6 +210,7 @@ /mocha /mockito/src /nacl_sdk_binaries/ @@ -37,7 +37,7 @@ index 5464e9e25c767ceefef15553c546687d2ab5fdd3..1b82a4e3e9763b59cba4efc4044abcaa /nasm /nearby/src /neon_2_sse/src -@@ -272,6 +274,7 @@ +@@ -276,6 +278,7 @@ /speex /sqlite/src /sqlite4java/lib/ 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 bf6cf8cdc9364..029c6978da26d 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 2e4bacce52a45b5d9d7829c1f88f82aa0bb1b4bb..f3537e89191bd2c6d9b06c9b741a1680 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 27ae44f218befbfb5a8246dbabc05fe77a2b3baf..0d39d88d3084bd3f38231e476b215f29623ac1e7 100644 +index 7a913d4714ae571505111d5fdf8303793bde629b..ec7a05ac5c261c0292684b47db275f7b1ef5daa4 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -3246,15 +3246,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3253,15 +3253,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_patch_out_profile_methods_in_chrome_browser_pdf.patch b/patches/chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch index b192e56dc4319..99a8c02d1f274 100644 --- a/patches/chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch +++ b/patches/chromium/chore_patch_out_profile_methods_in_chrome_browser_pdf.patch @@ -9,10 +9,10 @@ Electron does not support Profiles, so this Profile::FromBrowserContext() call is not needed and will not link. This change patches it out. diff --git a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc -index 33efdcfbc8ae731440f53ea270db4718f54b167a..139ef2300a521ed9552c3849e8836a4ee83a53eb 100644 +index 05468c024245186f422d360f97bc95ed06ec28c2..72c2a88aa11d91575484d541b0ab01b78af6e3c4 100644 --- a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc +++ b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc -@@ -41,6 +41,7 @@ namespace { +@@ -43,6 +43,7 @@ namespace { // hierarchy is: enterprise policy > user choice > finch experiment. bool ShouldEnableSkiaRenderer(content::WebContents* contents) { CHECK(contents); @@ -20,7 +20,7 @@ index 33efdcfbc8ae731440f53ea270db4718f54b167a..139ef2300a521ed9552c3849e8836a4e const PrefService* prefs = Profile::FromBrowserContext(contents->GetBrowserContext())->GetPrefs(); -@@ -48,6 +49,7 @@ bool ShouldEnableSkiaRenderer(content::WebContents* contents) { +@@ -50,6 +51,7 @@ bool ShouldEnableSkiaRenderer(content::WebContents* contents) { if (prefs->IsManagedPreference(prefs::kPdfUseSkiaRendererEnabled)) { return prefs->GetBoolean(prefs::kPdfUseSkiaRendererEnabled); } diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index d47e825e67b10..cbcac2cbab7c5 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 aaaa61d5c3a1d5ade2fd355e38a3985ef5cc4e7d..b45746ba0f38a381a2ee5ca17f3a1685 } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc -index 0555f16960c7c754734a9535339cbf05d5f9b0d6..7acd32a48865357dc5c08d352c009098fcfb3203 100644 +index 501783a57a06e7c2473046eefa9f798004af0416..9104dd5825d1705f0e90dd8f5b75ef07789f4a67 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc -@@ -1861,12 +1861,11 @@ bool Browser::IsWebContentsCreationOverridden( +@@ -1860,12 +1860,11 @@ bool Browser::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -99,10 +99,10 @@ index 0555f16960c7c754734a9535339cbf05d5f9b0d6..7acd32a48865357dc5c08d352c009098 WebContents* Browser::CreateCustomWebContents( diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h -index ac5c9a7b58adfb078d5a461af6be1daa4fbb7f5b..673ec4513e40b5d26823e12cfe0e2743f5de22d0 100644 +index 9fceed57deff55386fbabb1ce46c4ad725144a11..1dc104cc4cb80124050f892c586aab670a89e5a2 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h -@@ -886,8 +886,7 @@ class Browser : public TabStripModelObserver, +@@ -883,8 +883,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 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7 void AddNewContents(content::WebContents* source, std::unique_ptr new_contents, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index d95743b1ab3461f69326ca904448636de88ea070..a32f963654763cc0c706f752eca96e8cf5d0be54 100644 +index b01b8386fd519c239a3525cae9cbda58ea99a176..c7c515bf753a4a9851b1d68c206b9c7487f02578 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4208,8 +4208,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4217,8 +4217,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( if (delegate_ && delegate_->IsWebContentsCreationOverridden( source_site_instance, params.window_container_type, @@ -246,7 +246,7 @@ index db12930a449b38966e63c2274275b1157f38bea7..2d770e9c0c88e5ad1fac15fd13b70e6b } diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h -index 413419ac25d62f5058003480bc79d7a75c32a410..009a3d55f59a1ac80402327b43de45b13d5d8cfe 100644 +index 8b5a2052cb2b53b58253d42a36168da2a47ca532..976ffa66d145b4dc45606b7f45292bf2dd817c77 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -322,8 +322,7 @@ class CONTENT_EXPORT WebContentsDelegate { diff --git a/patches/chromium/command-ismediakey.patch b/patches/chromium/command-ismediakey.patch index 34c21eea04aeb..13367567823cc 100644 --- a/patches/chromium/command-ismediakey.patch +++ b/patches/chromium/command-ismediakey.patch @@ -117,10 +117,10 @@ index db596585cbb44b3710636e3fc013f288966f604f..6d5557ee1a2c35ee15e695e024834184 } // namespace ui diff --git a/ui/base/accelerators/media_keys_listener_mac.mm b/ui/base/accelerators/media_keys_listener_mac.mm -index e6eb63380dfa7141e1e542635c582a131d2d515f..2b56fbeac62b79420bb1d82101a3c57fd798d260 100644 +index 7eb89675a7bb3f22aefc1fb843d7e68554a165fd..bd783a0bfd92c3f9b5553a6480d258c2528ee740 100644 --- a/ui/base/accelerators/media_keys_listener_mac.mm +++ b/ui/base/accelerators/media_keys_listener_mac.mm -@@ -36,6 +36,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) { +@@ -32,6 +32,12 @@ KeyboardCode MediaKeyCodeToKeyboardCode(int key_code) { case NX_KEYTYPE_NEXT: case NX_KEYTYPE_FAST: return VKEY_MEDIA_NEXT_TRACK; @@ -133,7 +133,7 @@ index e6eb63380dfa7141e1e542635c582a131d2d515f..2b56fbeac62b79420bb1d82101a3c57f } return VKEY_UNKNOWN; } -@@ -194,7 +200,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy, +@@ -190,7 +196,10 @@ static CGEventRef EventTapCallback(CGEventTapProxy proxy, int key_code = (data1 & 0xFFFF0000) >> 16; if (key_code != NX_KEYTYPE_PLAY && key_code != NX_KEYTYPE_NEXT && key_code != NX_KEYTYPE_PREVIOUS && key_code != NX_KEYTYPE_FAST && diff --git a/patches/chromium/crash_allow_setting_more_options.patch b/patches/chromium/crash_allow_setting_more_options.patch index 6ea6d521b5af7..153c7d8026f1a 100644 --- a/patches/chromium/crash_allow_setting_more_options.patch +++ b/patches/chromium/crash_allow_setting_more_options.patch @@ -89,10 +89,10 @@ index 99efa6b245b9944710b76a342ec9a37947078a48..e55df93f17560a566e1dd2a63c560054 annotations, arguments, false, false)); } else { diff --git a/components/crash/core/app/crashpad_mac.mm b/components/crash/core/app/crashpad_mac.mm -index d7351f4a912b36bb541c59a408bae85dda537fc4..49e3e819f51621ce9b5f52eeed561983533783c8 100644 +index e6c1805bfd52f0b855f6b7db4ceda9a5a78dea44..eb388b3af595d4db07c8d3e050b892a4093263c6 100644 --- a/components/crash/core/app/crashpad_mac.mm +++ b/components/crash/core/app/crashpad_mac.mm -@@ -91,6 +91,8 @@ +@@ -87,6 +87,8 @@ } // @autoreleasepool return process_annotations; }(); @@ -101,7 +101,7 @@ index d7351f4a912b36bb541c59a408bae85dda537fc4..49e3e819f51621ce9b5f52eeed561983 return annotations; } -@@ -161,6 +163,13 @@ bool PlatformCrashpadInitialization( +@@ -157,6 +159,13 @@ bool PlatformCrashpadInitialization( std::vector arguments; 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 392fd5f2cffa0..5cca59d793df2 100644 --- a/patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch +++ b/patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch @@ -102,10 +102,10 @@ index d4bb0e9a017a833b403916e1d6e64fb058f40f86..35ba35a95e39700824d6e0b480b99bc3 friend class ContentClientCreator; friend class ContentClientInitializer; diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc -index 3914c2b9bfa945b0baf1a40970b592cec1a91dc7..ae0c94535c027850a44afffa7593205987d29a2c 100644 +index b5f427fcb7239ad864c43d5df6730d564aadb414..a2c0b0f69e8b9f5d32e67e0d2bdc55ce459fb515 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc -@@ -533,8 +533,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out, +@@ -536,8 +536,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out, #if defined(V8_USE_EXTERNAL_STARTUP_DATA) @@ -115,7 +115,7 @@ index 3914c2b9bfa945b0baf1a40970b592cec1a91dc7..ae0c94535c027850a44afffa75932059 if (g_mapped_snapshot) { // TODO(crbug.com/802962): Confirm not loading different type of snapshot // files in a process. -@@ -543,10 +542,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) { +@@ -546,10 +545,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) { base::MemoryMappedFile::Region file_region; base::File file = diff --git a/patches/chromium/disable_color_correct_rendering.patch b/patches/chromium/disable_color_correct_rendering.patch index 65e60b1a1dd21..435f511ed1f98 100644 --- a/patches/chromium/disable_color_correct_rendering.patch +++ b/patches/chromium/disable_color_correct_rendering.patch @@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at https://crbug.com/634542 and https://crbug.com/711107. diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc -index bff2acf54d5ee55075723db70af22dccab5d6097..c6fa4ef0a5fdaae81c91f4cc95711ce22966d7f6 100644 +index b390a74131118d19dfe51c311abbab68370aef1e..62df2a48bf8b588f1ed08b05a83ca91dd3449b2b 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc -@@ -1867,6 +1867,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( +@@ -1873,6 +1873,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( TargetColorParams LayerTreeHostImpl::GetTargetColorParams( gfx::ContentColorUsage content_color_usage) const { TargetColorParams params; @@ -93,7 +93,7 @@ index 9d7e9780c3ae58b45b2f443e48175254dd3f480b..6a276759550e6f80740875df654a136c sandbox::policy::switches::kGpuSandboxAllowSysVShm, sandbox::policy::switches::kGpuSandboxFailuresFatal, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index f628a6f0d914c6d2bec3160c9e3ef714792aa3bc..8839bdb32489edef851e8aa19e42343289b7964a 100644 +index 36142abc8d5322e2408b186560ff34b1b268b7b9..6a91a06b31ca43300e08cbf51b87078ec564e40c 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -3537,6 +3537,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( diff --git a/patches/chromium/disable_compositor_recycling.patch b/patches/chromium/disable_compositor_recycling.patch index 06cb3b9190b95..cbba1acd88d14 100644 --- a/patches/chromium/disable_compositor_recycling.patch +++ b/patches/chromium/disable_compositor_recycling.patch @@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron. diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index a9b4caaa4da3bee1a22db976a8ec71dc7d5400ed..4dda552f4dc50e6e3a184e95e771b7141e19e736 100644 +index 7f2b627031f65ad45a8ad182d3b7421005893ff4..43e5a96a5a191da992bdfa85dfeb080081358c88 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -540,7 +540,11 @@ +@@ -536,7 +536,11 @@ return; host()->WasHidden(); diff --git a/patches/chromium/disable_hidden.patch b/patches/chromium/disable_hidden.patch index 420f3c53a4f11..a6de3d482d519 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 5e261c6e3555b2891b25d8acad49cf86f51a418e..7a84a4e6c65eb5b9373b0667166188d93948ad68 100644 +index 55364bf0f6313eb57a96b46ad0a28051ab33fd62..3e0ed454b09a3d23570479a390e3dff92cbf83bc 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -800,6 +800,9 @@ void RenderWidgetHostImpl::WasHidden() { @@ -20,10 +20,10 @@ index 5e261c6e3555b2891b25d8acad49cf86f51a418e..7a84a4e6c65eb5b9373b0667166188d9 blink::mojom::PointerLockResult::kWrongDocument); diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h -index b60b9a5d403bd8be11a6132f630954b53e9de571..beb2af696d0f6585648b65f70ef5b68b804931c0 100644 +index 401123216fccc830a240b0b473e0426a65e630e6..2c205dd684340ddbed4fd301d5928ce6dad559fe 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h -@@ -901,6 +901,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl +@@ -902,6 +902,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl void UpdateBrowserControlsState(cc::BrowserControlsState constraints, cc::BrowserControlsState current, bool animate); @@ -33,7 +33,7 @@ index b60b9a5d403bd8be11a6132f630954b53e9de571..beb2af696d0f6585648b65f70ef5b68b protected: // |routing_id| must not be MSG_ROUTING_NONE. 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 e3a86d56dee37c990c71403515013558f9fdfafb..ae96b235b8b85abc7a8d5fc9213d90181a82faee 100644 +index 628724f3cc5c970402479a5c4a0c23af0d1f906d..8fa040071ba1e70890f7dcf8193e83e147679ed7 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -617,7 +617,7 @@ void RenderWidgetHostViewAura::HideImpl() { diff --git a/patches/chromium/enable_reset_aspect_ratio.patch b/patches/chromium/enable_reset_aspect_ratio.patch index 4d402b9f38921..d581528e4b5eb 100644 --- a/patches/chromium/enable_reset_aspect_ratio.patch +++ b/patches/chromium/enable_reset_aspect_ratio.patch @@ -19,7 +19,7 @@ index 53c1d25e3f56daa9d7929089620c9df7971ceda6..d90c652d7c572686bf54c4d282960ea4 excluded_margin); } diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index a32b8e9f61e85cca548e2b3b2cf7cd65b1c6ba52..812663feb8ba48dd170406bc463c8c286eec6882 100644 +index a386fb0594530afb6d842551c487fda7ae565085..825ee88f8375d726466d9967393b77065723fabd 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -1154,8 +1154,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen, diff --git a/patches/chromium/expose_setuseragent_on_networkcontext.patch b/patches/chromium/expose_setuseragent_on_networkcontext.patch index d7896254fdb4f..5501d0ae5350a 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 a07eed86e0845bb63bb9b4f8f952c02a3cbaba1c..fb93eab3c9ee2c67b48b01017318d3cdec21483f 100644 +index 46b6efb81e456d1f4543e21acbda669e89204e67..53accafded7b04df1d4593a36c4a2f817f1453de 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -1505,6 +1505,13 @@ void NetworkContext::SetNetworkConditions( +@@ -1516,6 +1516,13 @@ void NetworkContext::SetNetworkConditions( std::move(network_conditions)); } @@ -51,10 +51,10 @@ index a07eed86e0845bb63bb9b4f8f952c02a3cbaba1c..fb93eab3c9ee2c67b48b01017318d3cd // 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 1f18813a6a27c24c915f7b0d40c1d4f5d88d062b..0a117e03c9c040b2c9736d3d9643bc20a2509e36 100644 +index 8b232e22bdeb5fdcd1033889d041b42c2bc68f5a..24342e3d4637d386b888e01220457e8004f4288a 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h -@@ -317,6 +317,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -316,6 +316,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext void CloseIdleConnections(CloseIdleConnectionsCallback callback) override; void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id, mojom::NetworkConditionsPtr conditions) override; @@ -63,10 +63,10 @@ index 1f18813a6a27c24c915f7b0d40c1d4f5d88d062b..0a117e03c9c040b2c9736d3d9643bc20 void SetEnableReferrers(bool enable_referrers) override; #if BUILDFLAG(IS_CHROMEOS) diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 055f212db4a53cd1283e4d5bed8377cb34aff81a..a489d82156ccbf6e358a795d5cf9e7b3c2eaec47 100644 +index e082a44bbeb6a99a6d1f0cbcc1be52646fc2c3b6..6d8df0eef71a2d6443c987bde148937cec552609 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -1216,6 +1216,9 @@ interface NetworkContext { +@@ -1213,6 +1213,9 @@ interface NetworkContext { SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id, NetworkConditions? conditions); diff --git a/patches/chromium/extend_apply_webpreferences.patch b/patches/chromium/extend_apply_webpreferences.patch index e8a5f23653811..725fdbc504a1f 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 0913b97dd24270ff2e6e02964ea0c7536de8de22..2829b0855b5cf1499c6146a05b1bed0bb61d9936 100644 +index c724ee69385ae9817161a72f82a14c4ac9b5f835..625a40b764a1cc7eb6f89a7e30a6172861c41cc4 100644 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc @@ -165,6 +165,7 @@ 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 72d9c69cca6ae..4ba7fa7626ede 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 3be246ab216659ef4b923f09a9ff40afdb12b5d3..a6b9bab14875e84551e732e34f7e132ece28236e 100644 +index cb532ff5d2e653fb1b67ffb8c8d5c75916f912f2..1d387e531a80a3abbfd06d6e4ec16ba30332f0f9 100644 --- a/ui/native_theme/native_theme.cc +++ b/ui/native_theme/native_theme.cc -@@ -152,6 +152,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors, +@@ -153,6 +153,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors, NativeTheme::~NativeTheme() = default; bool NativeTheme::ShouldUseDarkColors() const { @@ -26,7 +26,7 @@ index 3be246ab216659ef4b923f09a9ff40afdb12b5d3..a6b9bab14875e84551e732e34f7e132e } diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h -index 8c761ec5303bf5057a3d48f16b7e476a75f69b76..481480a6404459bbd87e2a079f0291432f902f78 100644 +index 472988beb8048ac30b1a25cbbc5081627a06a7b6..640414b40d589d66a77e6efad7d71e676ca85ead 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h @@ -417,6 +417,23 @@ class NATIVE_THEME_EXPORT NativeTheme { @@ -53,8 +53,8 @@ index 8c761ec5303bf5057a3d48f16b7e476a75f69b76..481480a6404459bbd87e2a079f029143 // 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 -@@ -619,6 +636,7 @@ class NATIVE_THEME_EXPORT NativeTheme { - bool prefers_reduced_transparency_ = false; +@@ -627,6 +644,7 @@ class NATIVE_THEME_EXPORT NativeTheme { + bool inverted_colors_ = false; PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight; PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference; + ThemeSource theme_source_ = ThemeSource::kSystem; 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 099f1efbf4e3f..c33bb204b4917 100644 --- a/patches/chromium/feat_configure_launch_options_for_service_process.patch +++ b/patches/chromium/feat_configure_launch_options_for_service_process.patch @@ -18,7 +18,7 @@ to STDOUT_FILENO/STD_OUTPUT_HANDLE and STDERR_FILENO/STD_ERROR_HANDLE allowing t parent process to read from the pipe. diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h -index 2688eace4c00176ac9d1636641b44b8258c29b08..f8498a45db1158f2cfb7a9f548f290a879e8ab34 100644 +index e515503a0f636d935fdcd779a5ac01bd8f351e74..0669361cb063c9dd15a19486fce1a609171d4cda 100644 --- a/content/browser/child_process_launcher.h +++ b/content/browser/child_process_launcher.h @@ -32,6 +32,7 @@ @@ -58,7 +58,7 @@ index 2688eace4c00176ac9d1636641b44b8258c29b08..f8498a45db1158f2cfb7a9f548f290a8 // Launches a process asynchronously and notifies the client of the process diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc -index 6d8aa39ab75edcba3e34134566c9fcbe56a7ec57..30912cc39806b13c47b85ba1bfc848a23c83c30d 100644 +index b8147fce70f90191f9d4a794f69f32b23eac0e08..89c9d1982b575312ba730ab952b22326c8d83a6a 100644 --- a/content/browser/child_process_launcher_helper_linux.cc +++ b/content/browser/child_process_launcher_helper_linux.cc @@ -62,6 +62,11 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( @@ -84,7 +84,7 @@ index 6d8aa39ab75edcba3e34134566c9fcbe56a7ec57..30912cc39806b13c47b85ba1bfc848a2 DCHECK(GetZygoteForLaunch()); // Environment variables could be supported in the future, but are not diff --git a/content/browser/child_process_launcher_helper_mac.cc b/content/browser/child_process_launcher_helper_mac.cc -index 37eb06424d5ab1fc1919dc1cde603d9287014cab..08cd71c5669de94c8aebfc37849cadfcf838cf75 100644 +index 9e5365dc37489dcd9f94d23cf03713492ab20e5f..03206ccc3181eae7776b4f2c076285b8729379b8 100644 --- a/content/browser/child_process_launcher_helper_mac.cc +++ b/content/browser/child_process_launcher_helper_mac.cc @@ -123,7 +123,8 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( @@ -110,7 +110,7 @@ index 37eb06424d5ab1fc1919dc1cde603d9287014cab..08cd71c5669de94c8aebfc37849cadfc } diff --git a/content/browser/child_process_launcher_helper_win.cc b/content/browser/child_process_launcher_helper_win.cc -index fee8640ccee0a24e1f1e282e9bad3a26bd721df8..4b6a3e7aaf686ea23500b7e051156e59f252a108 100644 +index fe4006de7c8f5fc26b6981a0ba4db70cd188b8bb..6fe38b4649610179bd840dbee0ad1f0de2636886 100644 --- a/content/browser/child_process_launcher_helper_win.cc +++ b/content/browser/child_process_launcher_helper_win.cc @@ -19,6 +19,8 @@ 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 2e138bc40b3a9..1c0578eed9ea8 100644 --- a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch +++ b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch @@ -589,7 +589,7 @@ index 29936bca703b86fee89e2b7f35c64a47cd60770b..7fb5a0082bae7d8e06ca8588129d34e8 // Sends the created child window to the browser process so that it can be diff --git a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom -index 3457931b597b96587294a06c6976fb4d64a7bd31..5c058dc459c3b9aaf1f959f920b7e9ad3a807da5 100644 +index e6447c185ebcfe387991f27d3fb25dc3c2f32e5b..d291f0db6e9b6a60ee9ca38febaf1ad0397ee113 100644 --- a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom +++ b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom @@ -32,6 +32,7 @@ struct RootCompositorFrameSinkParams { diff --git a/patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch b/patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch index ac3f14682c767..6a89d6c939764 100644 --- a/patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch +++ b/patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch @@ -12,10 +12,10 @@ We attempt to migrate the safe storage key from the old account, if that migrati Existing apps that aren't built for the app store should be unimpacted, there is one edge case where a user uses BOTH an AppStore and a darwin build of the same app only one will keep it's access to the safestorage key as during the migration we delete the old account. This is an acceptable edge case as no one should be actively using two versions of the same app. diff --git a/components/os_crypt/sync/keychain_password_mac.mm b/components/os_crypt/sync/keychain_password_mac.mm -index e62a56a505e364dff7e1a9eb3043c01c2e3bc39f..2fa4598c4c38cf8dc0b03dad8ecd4faa69f0bb89 100644 +index f6269925af68ce3ef9fb684bf4a1662874becae9..8c5e7cbb37b03e8c296590cd3b41aa6524f654ff 100644 --- a/components/os_crypt/sync/keychain_password_mac.mm +++ b/components/os_crypt/sync/keychain_password_mac.mm -@@ -26,6 +26,12 @@ +@@ -22,6 +22,12 @@ using KeychainNameContainerType = const base::NoDestructor; #endif @@ -28,7 +28,7 @@ index e62a56a505e364dff7e1a9eb3043c01c2e3bc39f..2fa4598c4c38cf8dc0b03dad8ecd4faa namespace { // These two strings ARE indeed user facing. But they are used to access -@@ -86,11 +92,18 @@ +@@ -82,11 +88,18 @@ std::string KeychainPassword::GetPassword() const { UInt32 password_length = 0; void* password_data = nullptr; @@ -49,7 +49,7 @@ index e62a56a505e364dff7e1a9eb3043c01c2e3bc39f..2fa4598c4c38cf8dc0b03dad8ecd4faa if (error == noErr) { std::string password = std::string(static_cast(password_data), password_length); -@@ -98,9 +111,52 @@ +@@ -94,9 +107,52 @@ return password; } 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 5599666ca4593..00e49e23bc9a3 100644 --- a/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch +++ b/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch @@ -112,10 +112,10 @@ index d0df2913c2e5102cfd1e1ff140e6c95d168900bd..830f90a83774e32116757f8a3b959849 string mime_type; diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc -index 20aa446062cb39a22bbb78f3e11ec3c724a34882..b454c3b692296718bf1e35d8a1bd69b4989705d0 100644 +index 7cc60e316295ce475cd538c5524a2cfe6d7efbf7..df25568fa6445b10e46601b37392ec9b0ef58130 100644 --- a/services/network/url_loader.cc +++ b/services/network/url_loader.cc -@@ -660,6 +660,7 @@ URLLoader::URLLoader( +@@ -623,6 +623,7 @@ URLLoader::URLLoader( has_user_activation_ = request.trusted_params->has_user_activation; allow_cookies_from_browser_ = request.trusted_params->allow_cookies_from_browser; @@ -123,7 +123,7 @@ index 20aa446062cb39a22bbb78f3e11ec3c724a34882..b454c3b692296718bf1e35d8a1bd69b4 } // Store any cookies passed from the browser process to later attach them to -@@ -737,7 +738,7 @@ URLLoader::URLLoader( +@@ -661,7 +662,7 @@ URLLoader::URLLoader( &URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this))); } @@ -132,7 +132,7 @@ index 20aa446062cb39a22bbb78f3e11ec3c724a34882..b454c3b692296718bf1e35d8a1bd69b4 url_request_->SetResponseHeadersCallback(base::BindRepeating( &URLLoader::SetRawResponseHeaders, base::Unretained(this))); } -@@ -1673,6 +1674,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) { +@@ -1597,6 +1598,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) { } response_ = BuildResponseHead(); @@ -153,10 +153,10 @@ index 20aa446062cb39a22bbb78f3e11ec3c724a34882..b454c3b692296718bf1e35d8a1bd69b4 // Parse and remove the Trust Tokens response headers, if any are expected, diff --git a/services/network/url_loader.h b/services/network/url_loader.h -index 79b64718c8e4fcae4f23ce53b3084fe5eede2c12..56227fc0fb28f93df97fe4600b46e52cb1828297 100644 +index c79154651df14a6bebeb69907577e3d66754ddd8..b3e980b51000fc9068d80feec523cab167364859 100644 --- a/services/network/url_loader.h +++ b/services/network/url_loader.h -@@ -651,6 +651,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader +@@ -632,6 +632,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader std::unique_ptr resource_scheduler_request_handle_; diff --git a/patches/chromium/feat_filter_out_non-shareable_windows_in_the_current_application_in.patch b/patches/chromium/feat_filter_out_non-shareable_windows_in_the_current_application_in.patch index 0de72f62a93a4..23b7b9ed00217 100644 --- a/patches/chromium/feat_filter_out_non-shareable_windows_in_the_current_application_in.patch +++ b/patches/chromium/feat_filter_out_non-shareable_windows_in_the_current_application_in.patch @@ -7,10 +7,10 @@ Subject: feat: filter out non-shareable windows in the current application in This patch ensures that windows protected via win.setContentProtection(true) do not appear in full display captures via desktopCapturer. This patch could be upstreamed but as the check is limited to in-process windows it doesn't make a lot of sense for Chromium itself. This patch currently has a limitation that it only function for windows created / protected BEFORE the stream is started. There is theoretical future work we can do via polling / observers to automatically update the SCContentFilter when new windows are made but for now this will solve 99+% of the problem and folks can re-order their logic a bit to get it working for their use cases. diff --git a/content/browser/media/capture/screen_capture_kit_device_mac.mm b/content/browser/media/capture/screen_capture_kit_device_mac.mm -index dabbd20a3b92d874c80e0b4016ce2361d5b93564..e15d904bc2823c3b441e4491bff7fe43c17fad82 100644 +index 2c2c43cd4bdd49fbd674cb530b311cee2f1bb248..9ecfa7b46d8ec59ac566bb247847394b4579515c 100644 --- a/content/browser/media/capture/screen_capture_kit_device_mac.mm +++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm -@@ -174,7 +174,15 @@ void OnShareableContentCreated(SCShareableContent* content) { +@@ -170,7 +170,15 @@ void OnShareableContentCreated(SCShareableContent* content) { case DesktopMediaID::TYPE_SCREEN: for (SCDisplay* display in content.displays) { if (source_.id == display.displayID) { diff --git a/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch b/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch index 0ac5be9fe9646..d5f00ca38104b 100644 --- a/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch +++ b/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch @@ -6,10 +6,10 @@ Subject: fix: allow guest webcontents to enter fullscreen This can be upstreamed, a guest webcontents can't technically become the focused webContents. This DCHECK should allow all guest webContents to request fullscreen entrance. diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 998357b01a55def3d9c1e37d09f52d61b5ecd6f2..3872ee9b4e3182b8a39c51f13d577776eeccd2b1 100644 +index 3fef597d18025bd35b4f7af105c6907602958223..a515cff65ec418ccd44bccd61b0cf8094cb864db 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3705,7 +3705,7 @@ void WebContentsImpl::EnterFullscreenMode( +@@ -3714,7 +3714,7 @@ void WebContentsImpl::EnterFullscreenMode( OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode"); DCHECK(CanEnterFullscreenMode(requesting_frame, options)); DCHECK(requesting_frame->IsActive()); diff --git a/patches/chromium/fix_aspect_ratio_with_max_size.patch b/patches/chromium/fix_aspect_ratio_with_max_size.patch index 1937d2cce931b..dd14e3ea75a71 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 812663feb8ba48dd170406bc463c8c286eec6882..27ae44f218befbfb5a8246dbabc05fe77a2b3baf 100644 +index 825ee88f8375d726466d9967393b77065723fabd..7a913d4714ae571505111d5fdf8303793bde629b 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -3798,14 +3798,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param, +@@ -3805,14 +3805,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 33a5f520723b0..79df2ee66b0d9 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 @@ -17,10 +17,10 @@ policy->CanCommitOriginAndUrl. 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 a051e2465abbd3efcad566e8dbb57f4e97555817..20a6765d68405b365217eba5b6fa8cd7f331470f 100644 +index da87a4f823d6fa36589b6efc7e3b381fdd07b11c..c242e3ac8d62faf29f39a8d7bc46d08192e850f4 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -7450,10 +7450,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { +@@ -7454,10 +7454,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { if (IsForMhtmlSubframe()) return origin_with_debug_info; @@ -37,10 +37,10 @@ index a051e2465abbd3efcad566e8dbb57f4e97555817..20a6765d68405b365217eba5b6fa8cd7 } diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h -index cf2e1594a41c95d7ac1bffc06df6331cb6dd31e0..aaebfc7fe6f06114b3bc6accceefdba0d3f97408 100644 +index 1e6cfb0e983bd432a6b21c08bb9b2855c0c3889c..57107b584b442d5b3c2d4c1e4c4653e3fddf862f 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h -@@ -2959,6 +2959,17 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -2953,6 +2953,17 @@ class CONTENT_EXPORT RenderFrameHostImpl // last committed document. CookieChangeListener::CookieChangeInfo GetCookieChangeInfo(); @@ -58,7 +58,7 @@ index cf2e1594a41c95d7ac1bffc06df6331cb6dd31e0..aaebfc7fe6f06114b3bc6accceefdba0 // Sets a ResourceCache in the renderer. `this` must be active and there must // be no pending navigation. `remote` must have the same and process // isolation policy. -@@ -3350,17 +3361,6 @@ class CONTENT_EXPORT RenderFrameHostImpl +@@ -3344,17 +3355,6 @@ class CONTENT_EXPORT RenderFrameHostImpl // relevant. void ResetWaitingState(); diff --git a/patches/chromium/fix_crash_on_nativetheme_change_during_context_menu_close.patch b/patches/chromium/fix_crash_on_nativetheme_change_during_context_menu_close.patch deleted file mode 100644 index 6717c624823a8..0000000000000 --- a/patches/chromium/fix_crash_on_nativetheme_change_during_context_menu_close.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Fri, 16 Jun 2023 11:15:57 +0200 -Subject: fix: crash on nativeTheme change during context menu close - -Refs https://chromium-review.googlesource.com/c/chromium/src/+/4363385 - -Fixes a crash seen when trying to change nativeTheme source during -a context menu close. This happens as a result of a change added in the -above CL, which doesn't check whether or not the menu controller could -possibly be null as can happen during a context menu close. This -only affects Windows 11, as Bubble Border is only enabled there. - -This should be upstreamed, as other uses of MenuController in this -file do check for menu controller being null. - -diff --git a/ui/views/controls/menu/menu_scroll_view_container.cc b/ui/views/controls/menu/menu_scroll_view_container.cc -index 715bdbc16aab70e7feccb45d920ad35852380be8..b9daba6e778f9756b2bec0fabecc03cd7be30041 100644 ---- a/ui/views/controls/menu/menu_scroll_view_container.cc -+++ b/ui/views/controls/menu/menu_scroll_view_container.cc -@@ -391,8 +391,7 @@ void MenuScrollViewContainer::CreateDefaultBorder() { - MenuController* menu_controller = - content_view_->GetMenuItem()->GetMenuController(); - const MenuConfig& menu_config = MenuConfig::instance(); -- corner_radius_ = menu_config.CornerRadiusForMenu( -- content_view_->GetMenuItem()->GetMenuController()); -+ corner_radius_ = menu_config.CornerRadiusForMenu(menu_controller); - int padding = menu_config.use_outer_border && corner_radius_ > 0 - ? kBorderPaddingDueToRoundedCorners - : 0; -@@ -407,8 +406,9 @@ void MenuScrollViewContainer::CreateDefaultBorder() { - int bottom_inset = GetFootnote() ? 0 : vertical_inset; - - if (menu_config.use_outer_border) { -- if (menu_config.use_bubble_border && (corner_radius_ > 0) && -- !menu_controller->IsCombobox()) { -+ // Menu controller could be null during context menu being closed. -+ bool is_combobox = menu_controller && menu_controller->IsCombobox(); -+ if (menu_config.use_bubble_border && (corner_radius_ > 0) && !is_combobox) { - CreateBubbleBorder(); - } else { - gfx::Insets insets = gfx::Insets::TLBR(vertical_inset, horizontal_inset, diff --git a/patches/chromium/fix_dont_delete_SerialPortManager_on_main_thread.patch b/patches/chromium/fix_dont_delete_SerialPortManager_on_main_thread.patch deleted file mode 100644 index cd6e7c54cd2d3..0000000000000 --- a/patches/chromium/fix_dont_delete_SerialPortManager_on_main_thread.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: John Kleinschmidt -Date: Wed, 5 Jan 2022 15:01:31 -0500 -Subject: fix: dont delete SerialPortManager on the main thread - -This patch is neccessary because of the changes made in -https://chromium-review.googlesource.com/c/chromium/src/+/3283743. - -Several DCHECKs was firing because AddObserver runs in the WorkerThread but -RemoveObserver runs in the UI thread. Ceasing to delete the -`SerialPortManagerImpl` class on the main thread prevents this problem. - -A bit more of explanation from @deepak1556 as to why: - -SerialPortManagerImpl which is responsible for holding the mojo connection -between the device service process and client has this following unique -lifetime, -// Threading notes: -// 1. Created on the UI thread. -// 2. Used on the UI thread runner (macOS only), otherwise on a blocking task -// runner. -// 3. Deleted on the same runner on which it is used *except* sometimes -// during shutdown when the runner threadpool is already shutdown. -// See crbug.com/1263149#c20 for details. -An instance of this class is created when the device service is instantiated -https://source.chromium.org/chromium/chromium/src/+/main:services/device/device_service.cc;l=122-135 -On windows and linux from the above code you can see that a blocking task -runner is created to perform operations via this manager. DeviceService itself -has a lifetime of being associated with the local storage of a sequence, in -most cases this will be the main thread sequence of the application. Now when -you establish a connection with the device service via -SerialChooserContext::EnsurePortManagerConnection -https://github.com/electron/electron/blob/dd4eae8a3b7f707bcd3d083d553988a29e332189/shell/browser/serial/serial_chooser_context.cc#L206-L207 -although the call is original made on the UI thread, it will be bound to the -blocking task runner sequence for windows and linux in the device service end -via https://source.chromium.org/chromium/chromium/src/+/main:services/device/device_service.cc;l=341-349 -when binding the receiver. Based on the stack trace of the crash, the -port_manager_ receiver that is bound on a sequence is not destroyed on the same -sequence during shutdown. But that would be weird given -https://source.chromium.org/chromium/chromium/src/+/main:services/device/device_service.cc;l=155-156 - which ensures that SerialPortManagerImpl gets destroyed on the bound sequence. -This is where https://chromium-review.googlesource.com/c/chromium/src/+/3283743 -gives clarity that the DeleteSoon task never completed because the threadpool -instance was already shutdown by the time device service was being destroyed -leading to a leak and now they instead just synchronously delete the instance -on the main thread sequence which leads to the above DCHECK failure. So tl:dr, -this is not a new bug it was always present due to the lifetime associated with -this service, it just came to light because of the above CL. I am pretty sure -upstream would also hit this DCHECK, so give it a try with content_shell or -chrome and that would help reporting upstream crbug. - -diff --git a/services/device/device_service.cc b/services/device/device_service.cc -index b776f44abe450c1320ce3f1b89529805422c905d..3861d64f84c482b83bef400b931ee73ddd052262 100644 ---- a/services/device/device_service.cc -+++ b/services/device/device_service.cc -@@ -158,7 +158,7 @@ DeviceService::~DeviceService() { - // naturally sequenced after the last task on - // |serial_port_manager_task_runner_| per ThreadPool shutdown semantics). - // See crbug.com/1263149#c20 for details. -- delete serial_port_manager; -+ // delete serial_port_manager; - } - #endif // defined(IS_SERIAL_ENABLED_PLATFORM) - } 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 96d450d95a05b..2f6053db8e5dc 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 @@ -15,10 +15,10 @@ node does not change in this case. chromium-bug: https://crbug.com/1369605 diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc -index f509de422c2eb340b706afa364370e64107a4c84..76fa4ef05837a44632e9a05afea90da7e79d86d2 100644 +index 844797a0f880354f590b84bf354d7f9375b2c31f..d251b241582208b21096d3e2ab650b9e1012c380 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc -@@ -996,6 +996,12 @@ RenderWidgetHostViewChildFrame::DidUpdateVisualProperties( +@@ -1000,6 +1000,12 @@ RenderWidgetHostViewChildFrame::DidUpdateVisualProperties( return viz::ScopedSurfaceIdAllocator(std::move(allocation_task)); } @@ -45,10 +45,10 @@ index ed0641b888c6421b1791c086466bd9c158e9109d..3760b3823d5af3325017bb53f5b1d38e // RenderFrameMetadataProvider::Observer implementation. void OnRenderFrameMetadataChangedBeforeActivation( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 3872ee9b4e3182b8a39c51f13d577776eeccd2b1..0a583dce74161eb5a4543a2678ccc80aefd3582b 100644 +index a515cff65ec418ccd44bccd61b0cf8094cb864db..4345ec56895124c50651462386f3fad45fb651bb 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -8268,7 +8268,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( +@@ -8277,7 +8277,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 9948d819e39dd..0f365d6e5bd98 100644 --- a/patches/chromium/fix_properly_honor_printing_page_ranges.patch +++ b/patches/chromium/fix_properly_honor_printing_page_ranges.patch @@ -10,10 +10,10 @@ them should they exist. This will be upstreamed. diff --git a/printing/printing_context_mac.h b/printing/printing_context_mac.h -index 3f6289a9cee6d94349ef30760aad4a2b0a015c25..63b833fb3473f526be21ebe4549e17ee1e996580 100644 +index c9a13aee1e64f359cd1d5c2e440b4df204420997..7790c311400fc84bfda6c99e1ebd8da728031a77 100644 --- a/printing/printing_context_mac.h +++ b/printing/printing_context_mac.h -@@ -88,6 +88,10 @@ class COMPONENT_EXPORT(PRINTING) PrintingContextMac : public PrintingContext { +@@ -84,6 +84,10 @@ class COMPONENT_EXPORT(PRINTING) PrintingContextMac : public PrintingContext { // Returns true if the orientation was set. bool SetOrientationIsLandscape(bool landscape); @@ -25,10 +25,10 @@ index 3f6289a9cee6d94349ef30760aad4a2b0a015c25..63b833fb3473f526be21ebe4549e17ee // Returns true if duplex mode is set. bool SetDuplexModeInPrintSettings(mojom::DuplexMode mode); diff --git a/printing/printing_context_mac.mm b/printing/printing_context_mac.mm -index ce528252965ad10325659a099e046b119c72cf12..67427b928705ad0049c5f0035de6bd0a171d65c7 100644 +index 010c7ed3025172e1e5a60fb7c89c3ea7a38c3ba5..ce13929c3b9205b71eeae32aad89c92f00d6c8c0 100644 --- a/printing/printing_context_mac.mm +++ b/printing/printing_context_mac.mm -@@ -213,7 +213,8 @@ bool IsIppColorModelColorful(mojom::ColorModel color_model) { +@@ -209,7 +209,8 @@ bool IsIppColorModelColorful(mojom::ColorModel color_model) { !SetCollateInPrintSettings(settings_->collate()) || !SetDuplexModeInPrintSettings(settings_->duplex_mode()) || !SetOutputColor(static_cast(settings_->color())) || @@ -38,7 +38,7 @@ index ce528252965ad10325659a099e046b119c72cf12..67427b928705ad0049c5f0035de6bd0a return OnError(); } } -@@ -366,6 +367,22 @@ bool IsIppColorModelColorful(mojom::ColorModel color_model) { +@@ -362,6 +363,22 @@ bool IsIppColorModelColorful(mojom::ColorModel color_model) { return PMSetCopies(print_settings, copies, false) == noErr; } diff --git a/patches/chromium/fix_remove_caption-removing_style_call.patch b/patches/chromium/fix_remove_caption-removing_style_call.patch index 9f8881ba90a34..ebf6939487109 100644 --- a/patches/chromium/fix_remove_caption-removing_style_call.patch +++ b/patches/chromium/fix_remove_caption-removing_style_call.patch @@ -18,7 +18,7 @@ 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 0d39d88d3084bd3f38231e476b215f29623ac1e7..bf967adcc74c1c97036e7f9d01e7afe3eb141a78 100644 +index ec7a05ac5c261c0292684b47db275f7b1ef5daa4..13268bd89c710690eed5296f4b2157e9476f195e 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc @@ -1873,7 +1873,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { 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 2f7f6d8b79dc9..d73e9074f8cd9 100644 --- a/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch +++ b/patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch @@ -20,7 +20,7 @@ index 34777e89362b14587979cef76d8cd71b634cca8c..3d5e44883bab30eebdfaba70f3933435 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 3a0077b7130ca36e5441b28a7574c39f7bf7df49..593abf09011d26e369dc2551fc939249e92f1029 100644 +index 665b3a5cc00ad2c706454449dc8150c4b78a908f..e0b7bc6bd4af79e27e7c7fbedb317b42974452d2 100644 --- a/third_party/blink/public/web/web_local_frame.h +++ b/third_party/blink/public/web/web_local_frame.h @@ -442,6 +442,7 @@ class BLINK_EXPORT WebLocalFrame : public WebFrame { @@ -64,10 +64,10 @@ index 4cd668a127a50e5462e3878c3f1dcb7384926768..dfbec49249404df8f8ebdbd26e6e865c #endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc -index 280fbb5608ffcd5bec33483c99a1a112a16a0c24..8232e87607f9af31e7608d3385c6853e87efa5e2 100644 +index d50985b2e3fa32c54c2dc8612878cc30dcb2c76a..7d16f6d3eaf53dbd61a7403bfc43ef6f367d0189 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc -@@ -2809,6 +2809,7 @@ void LocalFrame::RequestExecuteScript( +@@ -2792,6 +2792,7 @@ void LocalFrame::RequestExecuteScript( mojom::blink::EvaluationTiming evaluation_timing, mojom::blink::LoadEventBlockingOption blocking_option, WebScriptExecutionCallback callback, @@ -75,7 +75,7 @@ index 280fbb5608ffcd5bec33483c99a1a112a16a0c24..8232e87607f9af31e7608d3385c6853e BackForwardCacheAware back_forward_cache_aware, mojom::blink::WantResultOption want_result_option, mojom::blink::PromiseResultOption promise_behavior) { -@@ -2842,7 +2843,7 @@ void LocalFrame::RequestExecuteScript( +@@ -2825,7 +2826,7 @@ void LocalFrame::RequestExecuteScript( PausableScriptExecutor::CreateAndRun( script_state, std::move(script_sources), execute_script_policy, user_gesture, evaluation_timing, blocking_option, want_result_option, @@ -85,10 +85,10 @@ index 280fbb5608ffcd5bec33483c99a1a112a16a0c24..8232e87607f9af31e7608d3385c6853e 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 49c9b337166c5a677a0ebd7e494f539864771bce..8a34090a26df330bf46459b4dd3e9571d01633c7 100644 +index eb4ce179cb09e28b97ad167b5b6d0e1c25e53c5f..a9cde93321e1afd18e3f742777b31112c066a6a1 100644 --- a/third_party/blink/renderer/core/frame/local_frame.h +++ b/third_party/blink/renderer/core/frame/local_frame.h -@@ -803,6 +803,7 @@ class CORE_EXPORT LocalFrame final +@@ -796,6 +796,7 @@ class CORE_EXPORT LocalFrame final mojom::blink::EvaluationTiming, mojom::blink::LoadEventBlockingOption, WebScriptExecutionCallback, @@ -97,10 +97,10 @@ index 49c9b337166c5a677a0ebd7e494f539864771bce..8a34090a26df330bf46459b4dd3e9571 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 57e1e45f9c8aa0dbae982ab4e921d2a785841c22..e2cdf0c00cf165cbd8f7f2279ddffcd2b71c0fda 100644 +index 4729006029227265160abcc32722d0bac3883bc6..28e232423e3ab46eb205af87a461806003ce04c5 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 -@@ -935,6 +935,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld( +@@ -936,6 +936,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld( std::move(callback).Run(value ? std::move(*value) : base::Value()); }, std::move(callback)), @@ -204,10 +204,10 @@ index 1e4d9e098463d61dcab787afcc46fea63b27e012..3f1ebf493ddd7d1c209acee2fb1255a0 const mojom::blink::UserActivationOption user_activation_option_; const mojom::blink::LoadEventBlockingOption blocking_option_; 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 bc5c09998a9c47f5328d46711f265d6fb80d9256..ccf72a687f9e4da8a91a1b2ad5b597cd31a2531c 100644 +index 1a237daf5f5427089c2f7e1f5dbdd40b451f6b76..727a9a19ded880da22f5bea177b4c13c01f00c68 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 -@@ -1148,14 +1148,15 @@ void WebLocalFrameImpl::RequestExecuteScript( +@@ -1116,14 +1116,15 @@ void WebLocalFrameImpl::RequestExecuteScript( mojom::blink::EvaluationTiming evaluation_timing, mojom::blink::LoadEventBlockingOption blocking_option, WebScriptExecutionCallback callback, @@ -226,7 +226,7 @@ index bc5c09998a9c47f5328d46711f265d6fb80d9256..ccf72a687f9e4da8a91a1b2ad5b597cd v8::MaybeLocal WebLocalFrameImpl::CallFunctionEvenIfScriptDisabled( 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 a7469d4d292921620a66dab1ef76edb276bfb70d..d0ae9a6a66435bda1b21d39d2fd7b2f7a13b560d 100644 +index d90e588509d4828cf6e5e23d6c8c2abda1d78ac7..d534322270537fcd6356cf7691ad739bc237ac9b 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 c72a6f8386b23..821f6d9273099 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 7abc296e283f15eeec32de1e94b66c24d71ebe13..c0053ae1abb38be03611cf5246d482c6391bd3bc 100644 +index 3f81597c41a3e65454d2181548682e2e9441e9b6..9eac5dc78d68c7f49c594ddbf9935375c538162a 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc @@ -564,6 +564,7 @@ void MenuController::Run(Widget* parent, @@ -32,7 +32,7 @@ index 7abc296e283f15eeec32de1e94b66c24d71ebe13..c0053ae1abb38be03611cf5246d482c6 if (button_controller) { pressed_lock_ = button_controller->TakeLock( false, ui::LocatedEvent::FromIfValid(event)); -@@ -2266,19 +2275,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { +@@ -2256,19 +2265,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) { } item->GetSubmenu()->ShowAt(params); @@ -83,7 +83,7 @@ index adb22671b94fa16854773baad0e6bff1322c6646..fae32722f1209151fa1da59d0c7892ab bool MenuRunner::IsRunning() const { diff --git a/ui/views/controls/menu/menu_runner_impl.cc b/ui/views/controls/menu/menu_runner_impl.cc -index d4cf9df424f103680e07778f4fe3e3717bea860a..2b9cfa3d30c6341a941127c9f57983a5b6367b13 100644 +index e82249ad5e887180bb5785d06a4084857e0bfe98..3dd47b1c2d9f517939fd8ec92787fb60f58ed5f7 100644 --- a/ui/views/controls/menu/menu_runner_impl.cc +++ b/ui/views/controls/menu/menu_runner_impl.cc @@ -116,6 +116,7 @@ void MenuRunnerImpl::RunMenuAt(Widget* parent, @@ -145,10 +145,10 @@ index e6587d2208a13576af1831b94724a6286f0e0607..91223ef3f099e20aee5cf1d685c45d2c absl::optional corners = absl::nullopt) override; void Cancel() override; diff --git a/ui/views/controls/menu/menu_runner_impl_cocoa.h b/ui/views/controls/menu/menu_runner_impl_cocoa.h -index 68c01b93a973a1910c1cce1e581b5c5e38a8c787..fd82c908886f646327e59a2f4ee8dc3476fb7db1 100644 +index 2056016df30982e24d4d99271f59e0edb261a16a..2876d3ccedf0e9f041d3f3310cd596de1fb7b000 100644 --- a/ui/views/controls/menu/menu_runner_impl_cocoa.h +++ b/ui/views/controls/menu/menu_runner_impl_cocoa.h -@@ -45,6 +45,7 @@ class VIEWS_EXPORT MenuRunnerImplCocoa : public MenuRunnerImplInterface { +@@ -41,6 +41,7 @@ class VIEWS_EXPORT MenuRunnerImplCocoa : public MenuRunnerImplInterface { const gfx::Rect& bounds, MenuAnchorPosition anchor, int32_t run_types, @@ -157,10 +157,10 @@ index 68c01b93a973a1910c1cce1e581b5c5e38a8c787..fd82c908886f646327e59a2f4ee8dc34 absl::optional corners = absl::nullopt) override; void Cancel() override; diff --git a/ui/views/controls/menu/menu_runner_impl_cocoa.mm b/ui/views/controls/menu/menu_runner_impl_cocoa.mm -index 8bbf8104fdb46dc8fdb506d8504a1c9f9376175e..717488a814d122e6b0b285b1b1e49488f981eccb 100644 +index 9d148ed4bd5f13c4a7e266e9c2992a7d33dcc494..3d2c8dbe1a28e35640c6599810b82d2a5fb2fa25 100644 --- a/ui/views/controls/menu/menu_runner_impl_cocoa.mm +++ b/ui/views/controls/menu/menu_runner_impl_cocoa.mm -@@ -193,6 +193,7 @@ +@@ -189,6 +189,7 @@ const gfx::Rect& bounds, MenuAnchorPosition anchor, int32_t run_types, diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index 0fc95a12235e1..35f39ecf03162 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 cf0cc0d010cdd38272a5262e2cbb0719b4595039..190c46d245f32d2ba093390cab7477165785e1ed 100644 +index 2028ef8c1817b564713930b92c84c53a880b4b22..836c74442392d317fd400eb9f1fde148dbf90757 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc -@@ -4082,6 +4082,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -4123,6 +4123,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request->ResetStateForSiteInstanceChange(); } @@ -20,10 +20,10 @@ index cf0cc0d010cdd38272a5262e2cbb0719b4595039..190c46d245f32d2ba093390cab747716 } diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index e942f9cf1fb664591264e75e80d5d93ad70be070..45bfdcbda26db9d05d80465eccd17dd6cb4913c4 100644 +index 8e464a60370317ebd8682a0bb2aa983eb54f0c69..62b86c1a5065d9e5169a86ef5e37f41b1ebd8df6 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -308,6 +308,11 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -311,6 +311,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 ea28d60ecc1aa..15558921afd26 100644 --- a/patches/chromium/gin_enable_disable_v8_platform.patch +++ b/patches/chromium/gin_enable_disable_v8_platform.patch @@ -38,10 +38,10 @@ index c19eb72e8d37fe8145b813d07875addf793e12dc..a5db8841773618814ac90f740201d4d7 // 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 de46465bdaa8b4ed3dc4cf2a88553471fe3270b1..3914c2b9bfa945b0baf1a40970b592cec1a91dc7 100644 +index f280373f29263c2d3481e701a38f98ba6557e71a..b5f427fcb7239ad864c43d5df6730d564aadb414 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc -@@ -421,7 +421,8 @@ void SetFlags(IsolateHolder::ScriptMode mode, +@@ -424,7 +424,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 de46465bdaa8b4ed3dc4cf2a88553471fe3270b1..3914c2b9bfa945b0baf1a40970b592ce static bool v8_is_initialized = false; if (v8_is_initialized) return; -@@ -431,7 +432,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode, +@@ -434,7 +435,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode, // See https://crbug.com/v8/11043 SetFlags(mode, js_command_line_flags); 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 c2d79c26f64ba..5bbb063c70680 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,10 +11,10 @@ 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 134f0a172751c2e0aa769f10965a21895d8b1b8f..a86b25f708292bade341bbf25b94ab7e14bed995 100755 +index 033c425f5344b930735f91b3b4e0569d17eaf779..4a4c5f45b7e17815e170d88c98f24c1ac650c459 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py -@@ -307,6 +307,8 @@ def GetDefaultHostOs(): +@@ -306,6 +306,8 @@ def GetDefaultHostOs(): 'win32': 'win', } default_host_os = _PLATFORM_HOST_OS_MAP.get(sys.platform, sys.platform) diff --git a/patches/chromium/introduce_ozoneplatform_electron_can_call_x11_property.patch b/patches/chromium/introduce_ozoneplatform_electron_can_call_x11_property.patch index af52292a0e193..5e44a5ff1fe29 100644 --- a/patches/chromium/introduce_ozoneplatform_electron_can_call_x11_property.patch +++ b/patches/chromium/introduce_ozoneplatform_electron_can_call_x11_property.patch @@ -21,7 +21,7 @@ index fb665685e3539eb13cde9b213960156634f987b3..e95c5883df89ad119a7229198f628acd properties->supports_global_application_menus = true; properties->app_modal_dialogs_use_event_blocker = true; diff --git a/ui/ozone/public/ozone_platform.h b/ui/ozone/public/ozone_platform.h -index 85bbebb5507540d00cff2b888c4f0700e6896184..d804753419204f71c94c650527d7fceedc0c0ee3 100644 +index 2d58c44fb731cee1a4830ce3c27f25fe75d690be..5dbffdb3247aa6599720fef843f4567bbd2b7ad4 100644 --- a/ui/ozone/public/ozone_platform.h +++ b/ui/ozone/public/ozone_platform.h @@ -124,6 +124,10 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform { diff --git a/patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch b/patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch index 1f267454ce9be..c3ece70190e9d 100644 --- a/patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch +++ b/patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch @@ -9,7 +9,7 @@ be created for each child process, despite logs being redirected to a file. diff --git a/content/app/content_main.cc b/content/app/content_main.cc -index 3062f57603321d8d14887d96afe37586ea13aae0..7d1fad3e78f4bc1a8f843126d1d73b43173a88a5 100644 +index 6c672cdc421bd1c5e49dab87dcf364625c522c72..0649533d9815d097fb7844c211826f7699488c89 100644 --- a/content/app/content_main.cc +++ b/content/app/content_main.cc @@ -306,8 +306,12 @@ RunContentProcess(ContentMainParams params, diff --git a/patches/chromium/mas-cgdisplayusesforcetogray.patch b/patches/chromium/mas-cgdisplayusesforcetogray.patch index e9489b9d3544c..7d8bba9fc25dd 100644 --- a/patches/chromium/mas-cgdisplayusesforcetogray.patch +++ b/patches/chromium/mas-cgdisplayusesforcetogray.patch @@ -6,10 +6,10 @@ Subject: mas: avoid usage of CGDisplayUsesForceToGray Removes usage of the CGDisplayUsesForceToGray private API. diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm -index d2defe11d4d6fdb880679af8f33cec043c106be6..21d2ea643a3e5118cf527386c11c1d89a33f22b0 100644 +index 087284a1efd9e4f55dc93c88fe0118d653fa678c..5d6eac01000d42dc8c60ed5bcdb02a7bd0792e8d 100644 --- a/ui/display/mac/screen_mac.mm +++ b/ui/display/mac/screen_mac.mm -@@ -163,7 +163,17 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) { +@@ -159,7 +159,17 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) { display.set_color_depth(Display::kDefaultBitsPerPixel); display.set_depth_per_component(Display::kDefaultBitsPerComponent); } diff --git a/patches/chromium/mas_avoid_usage_of_private_macos_apis.patch b/patches/chromium/mas_avoid_usage_of_private_macos_apis.patch index 5b3e88a5fe58e..37e4c03297cae 100644 --- a/patches/chromium/mas_avoid_usage_of_private_macos_apis.patch +++ b/patches/chromium/mas_avoid_usage_of_private_macos_apis.patch @@ -14,10 +14,10 @@ Disable usage of the following private APIs in MAS builds: * AudioDeviceDuck diff --git a/base/enterprise_util_mac.mm b/base/enterprise_util_mac.mm -index 09e99c33ba9f0fe739a26757aa9018d4dcf180aa..6ac1f2ea2aeff8e640d0307dc7ad4c28a4764552 100644 +index fd14573e1617d397012e5bb54efb229415326cca..6d1f3ca0f81d8d79b0e6d436a3fdb741a2b8e7c3 100644 --- a/base/enterprise_util_mac.mm +++ b/base/enterprise_util_mac.mm -@@ -117,6 +117,13 @@ MacDeviceManagementState IsDeviceRegisteredWithManagement() { +@@ -113,6 +113,13 @@ MacDeviceManagementState IsDeviceRegisteredWithManagement() { DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain() { static DeviceUserDomainJoinState state = [] { DeviceUserDomainJoinState state{false, false}; @@ -31,7 +31,7 @@ index 09e99c33ba9f0fe739a26757aa9018d4dcf180aa..6ac1f2ea2aeff8e640d0307dc7ad4c28 @autoreleasepool { ODSession* session = [ODSession defaultSession]; -@@ -223,5 +230,6 @@ DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain() { +@@ -219,5 +226,6 @@ DeviceUserDomainJoinState AreDeviceAndUserJoinedToDomain() { return state; } diff --git a/patches/chromium/mas_blink_no_private_api.patch b/patches/chromium/mas_blink_no_private_api.patch index 06ebb560615dc..e276a4f292efd 100644 --- a/patches/chromium/mas_blink_no_private_api.patch +++ b/patches/chromium/mas_blink_no_private_api.patch @@ -7,10 +7,10 @@ Guard usages in chromium code of private Mac APIs by MAS_BUILD, so they can be excluded for people who want to submit their apps to the Mac App store. diff --git a/third_party/blink/renderer/core/editing/kill_ring_mac.mm b/third_party/blink/renderer/core/editing/kill_ring_mac.mm -index 700a4b58ea17597b41dddb8c552e2f2cfc9aa393..8e79ef2ae958dfbaf9cf928d4e3c76dd4d3ab99b 100644 +index 94afefcee81b87c05bf9b1199d90d3d4b5ea84a6..78e4e0fe20e0fdfeab18b28fe208d5aa38eb0bd1 100644 --- a/third_party/blink/renderer/core/editing/kill_ring_mac.mm +++ b/third_party/blink/renderer/core/editing/kill_ring_mac.mm -@@ -31,6 +31,7 @@ +@@ -27,6 +27,7 @@ namespace blink { @@ -18,7 +18,7 @@ index 700a4b58ea17597b41dddb8c552e2f2cfc9aa393..8e79ef2ae958dfbaf9cf928d4e3c76dd extern "C" { // Kill ring calls. Would be better to use NSKillRing.h, but that's not -@@ -43,38 +44,53 @@ +@@ -39,38 +40,53 @@ void _NSNewKillRingSequence(); void _NSSetKillRingToYankedState(); } diff --git a/patches/chromium/mas_disable_custom_window_frame.patch b/patches/chromium/mas_disable_custom_window_frame.patch index 6eea71c1293b3..8abec3fa4b8f9 100644 --- a/patches/chromium/mas_disable_custom_window_frame.patch +++ b/patches/chromium/mas_disable_custom_window_frame.patch @@ -7,18 +7,18 @@ Disable private window frame APIs (NSNextStepFrame and NSThemeFrame) for MAS build. 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 3234ed46122056d58f33d17f33c8083a0e8e9d0a..6a7c75cddeaf46275a1628e187fd3907aaf53e75 100644 +index b31c3be1895f7ca4a0f5c61f06a66eb1e1fbc5a6..ad4a1ecb02573bb5d34d134c61ec71f3fb092f42 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 -@@ -13,6 +13,7 @@ - #error "This file requires ARC support." - #endif +@@ -9,6 +9,7 @@ + #include "components/remote_cocoa/app_shim/native_widget_ns_window_bridge.h" + #include "components/remote_cocoa/common/native_widget_ns_window_host.mojom.h" +#if !IS_MAS_BUILD() @interface NSWindow (PrivateBrowserNativeWidgetAPI) + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle; @end -@@ -73,10 +74,13 @@ - (BOOL)_shouldCenterTrafficLights { +@@ -69,10 +70,13 @@ - (BOOL)_shouldCenterTrafficLights { @end @@ -32,7 +32,7 @@ index 3234ed46122056d58f33d17f33c8083a0e8e9d0a..6a7c75cddeaf46275a1628e187fd3907 + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle { // - NSThemeFrame and its subclasses will be nil if it's missing at runtime. if ([BrowserWindowFrame class]) -@@ -91,6 +95,8 @@ - (BOOL)_usesCustomDrawing { +@@ -87,6 +91,8 @@ - (BOOL)_usesCustomDrawing { return NO; } @@ -42,19 +42,19 @@ index 3234ed46122056d58f33d17f33c8083a0e8e9d0a..6a7c75cddeaf46275a1628e187fd3907 // Keyboard -> Shortcuts -> Keyboard. Usually Ctrl+F5. The argument (|unknown|) // tends to just be nil. diff --git a/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm -index 2d4be7e4df5a0f6de9046593434eb276e28232f9..c727984807d555b8e6ab8fe37d9a6daa8c091663 100644 +index 3a815ebf505bd95fa7f6b61ba433d98fbfe20225..dbbebbdc1735bc14224dfcde0b7fe3a6fd9f9e40 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm +++ b/components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.mm -@@ -8,6 +8,8 @@ - #error "This file requires ARC support." - #endif +@@ -4,6 +4,8 @@ + + #import "components/remote_cocoa/app_shim/native_widget_mac_frameless_nswindow.h" +#if !IS_MAS_BUILD() + @interface NSWindow (PrivateAPI) + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle; @end -@@ -22,8 +24,12 @@ - (CGFloat)_titlebarHeight { +@@ -18,8 +20,12 @@ - (CGFloat)_titlebarHeight { } @end @@ -67,7 +67,7 @@ index 2d4be7e4df5a0f6de9046593434eb276e28232f9..c727984807d555b8e6ab8fe37d9a6daa + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle { if ([NativeWidgetMacFramelessNSWindowFrame class]) { return [NativeWidgetMacFramelessNSWindowFrame class]; -@@ -31,4 +37,6 @@ + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle { +@@ -27,4 +33,6 @@ + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle { return [super frameViewClassForStyleMask:windowStyle]; } @@ -75,7 +75,7 @@ index 2d4be7e4df5a0f6de9046593434eb276e28232f9..c727984807d555b8e6ab8fe37d9a6daa + @end diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h -index 841358dd85201f4972e4c91a334e55b81867d2ec..0069d4f904c527fa3c280c723574fe2c62c282b8 100644 +index 9d0469a373c1e74d3007fa171459a0d9e831bd02..b0b5ebf56c790f1fb647994cefadf0bce3a11755 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h @@ -17,6 +17,7 @@ class NativeWidgetNSWindowBridge; @@ -95,10 +95,10 @@ index 841358dd85201f4972e4c91a334e55b81867d2ec..0069d4f904c527fa3c280c723574fe2c // The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that // can only be accomplished by overriding methods. diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -index 8a89e3e1759b9785f069546aa564520a9375f0c2..fd09550a2f1fe59ba0d38a258107573a052fd784 100644 +index 64ea3046693835ebb263d30f7e30380851bacd38..f834876be0465ea27495814c37489ba6bdbed9bd 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -@@ -106,7 +106,9 @@ void OrderChildWindow(NSWindow* child_window, +@@ -97,7 +97,9 @@ void OrderChildWindow(NSWindow* child_window, } // namespace @interface NSWindow (Private) @@ -108,7 +108,7 @@ index 8a89e3e1759b9785f069546aa564520a9375f0c2..fd09550a2f1fe59ba0d38a258107573a - (BOOL)hasKeyAppearance; - (long long)_resizeDirectionForMouseLocation:(CGPoint)location; - (BOOL)_isConsideredOpenForPersistentState; -@@ -150,6 +152,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event { +@@ -135,6 +137,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event { } @end @@ -117,7 +117,7 @@ index 8a89e3e1759b9785f069546aa564520a9375f0c2..fd09550a2f1fe59ba0d38a258107573a @implementation NativeWidgetMacNSWindowTitledFrame - (void)mouseDown:(NSEvent*)event { if (self.window.isMovable) -@@ -176,6 +180,8 @@ - (BOOL)usesCustomDrawing { +@@ -161,6 +165,8 @@ - (BOOL)usesCustomDrawing { } @end @@ -126,7 +126,7 @@ index 8a89e3e1759b9785f069546aa564520a9375f0c2..fd09550a2f1fe59ba0d38a258107573a @implementation NativeWidgetMacNSWindow { @private CommandDispatcher* __strong _commandDispatcher; -@@ -381,6 +387,8 @@ - (NSAccessibilityRole)accessibilityRole { +@@ -355,6 +361,8 @@ - (NSAccessibilityRole)accessibilityRole { // NSWindow overrides. @@ -135,7 +135,7 @@ index 8a89e3e1759b9785f069546aa564520a9375f0c2..fd09550a2f1fe59ba0d38a258107573a + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { if (windowStyle & NSWindowStyleMaskTitled) { if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class]) -@@ -392,6 +400,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { +@@ -366,6 +374,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { return [super frameViewClassForStyleMask:windowStyle]; } diff --git a/patches/chromium/mas_disable_remote_accessibility.patch b/patches/chromium/mas_disable_remote_accessibility.patch index d06d2a8776be6..be163ee32d060 100644 --- a/patches/chromium/mas_disable_remote_accessibility.patch +++ b/patches/chromium/mas_disable_remote_accessibility.patch @@ -11,10 +11,10 @@ needs to think it's coming from the PWA process). I think it can just be chopped out -- if there are any side-effects, we should be able to work around them. diff --git a/components/remote_cocoa/app_shim/application_bridge.mm b/components/remote_cocoa/app_shim/application_bridge.mm -index 1411678acc567b4d6368d0e2e6224f0974d61825..b9495cc1a391603b2c223ab1cf2d75b19b23d52e 100644 +index 5a096477c123a782341115f964c4975301ccaf9a..ecfbb3b405425af346a6ba6788fc1d8ff89760cd 100644 --- a/components/remote_cocoa/app_shim/application_bridge.mm +++ b/components/remote_cocoa/app_shim/application_bridge.mm -@@ -55,6 +55,7 @@ +@@ -51,6 +51,7 @@ // NativeWidgetNSWindowHostHelper: id GetNativeViewAccessible() override { @@ -22,7 +22,7 @@ index 1411678acc567b4d6368d0e2e6224f0974d61825..b9495cc1a391603b2c223ab1cf2d75b1 if (!remote_accessibility_element_) { int64_t browser_pid = 0; std::vector element_token; -@@ -65,6 +66,9 @@ id GetNativeViewAccessible() override { +@@ -61,6 +62,9 @@ id GetNativeViewAccessible() override { ui::RemoteAccessibility::GetRemoteElementFromToken(element_token); } return remote_accessibility_element_; @@ -32,7 +32,7 @@ index 1411678acc567b4d6368d0e2e6224f0974d61825..b9495cc1a391603b2c223ab1cf2d75b1 } void DispatchKeyEvent(ui::KeyEvent* event) override { bool event_handled = false; -@@ -103,7 +107,9 @@ void GetWordAt(const gfx::Point& location_in_content, +@@ -99,7 +103,9 @@ void GetWordAt(const gfx::Point& location_in_content, mojo::AssociatedRemote text_input_host_remote_; std::unique_ptr bridge_; @@ -43,10 +43,10 @@ index 1411678acc567b4d6368d0e2e6224f0974d61825..b9495cc1a391603b2c223ab1cf2d75b1 } // namespace diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm -index 1eb8f76dba28861d002d5e8d0271d8bb54c157c6..d7356834e1c714024dc6b6c6147043a8afa98c08 100644 +index c4285bf227abf1536213835ebdb8ca16d2638263..73c27518cab1efbbd2e4ec334b8685bd25d6d693 100644 --- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm +++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm -@@ -603,10 +603,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { +@@ -587,10 +587,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { // this should be treated as an error and caught early. CHECK(bridged_view_); @@ -60,10 +60,10 @@ index 1eb8f76dba28861d002d5e8d0271d8bb54c157c6..d7356834e1c714024dc6b6c6147043a8 // 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/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm -index ba279439ae7029f202a2282aca835462b335205b..7f3b2373dcb5cd31af972cbe8571a9d50a64ae4f 100644 +index 8fe41069ae9578a75469b40413b8e796792527cf..c5da46f4cc173eeb28c58bc464acd55ec9e4fc9e 100644 --- a/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm +++ b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm -@@ -90,8 +90,10 @@ id GetFocusedBrowserAccessibilityElement() override { +@@ -86,8 +86,10 @@ id GetFocusedBrowserAccessibilityElement() override { return nil; } void SetAccessibilityWindow(NSWindow* window) override { @@ -75,7 +75,7 @@ index ba279439ae7029f202a2282aca835462b335205b..7f3b2373dcb5cd31af972cbe8571a9d5 void ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& key_event, diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm -index b803e5f1e87b183d857195c007d7116ccc8e8ed7..71984ec1fe0b801041f3544c1b596a6f1a50489a 100644 +index 45aeb6838a859f57287bec51f79a4eb77d69b619..6f5c28de251d4f6db9b07b37d0b513c2cc2826b3 100644 --- a/content/browser/accessibility/browser_accessibility_manager_mac.mm +++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm @@ -21,7 +21,9 @@ @@ -86,9 +86,9 @@ index b803e5f1e87b183d857195c007d7116ccc8e8ed7..71984ec1fe0b801041f3544c1b596a6f #include "ui/base/cocoa/remote_accessibility_api.h" +#endif - #if !defined(__has_feature) || !__has_feature(objc_arc) - #error "This file requires ARC support." -@@ -228,6 +230,7 @@ void PostAnnouncementNotification(NSString* announcement, + namespace { + +@@ -224,6 +226,7 @@ void PostAnnouncementNotification(NSString* announcement, return; } @@ -96,7 +96,7 @@ index b803e5f1e87b183d857195c007d7116ccc8e8ed7..71984ec1fe0b801041f3544c1b596a6f BrowserAccessibilityManager* root_manager = GetManagerForRootFrame(); if (root_manager) { BrowserAccessibilityManagerMac* root_manager_mac = -@@ -250,6 +253,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -246,6 +249,7 @@ void PostAnnouncementNotification(NSString* announcement, return; } } @@ -104,7 +104,7 @@ index b803e5f1e87b183d857195c007d7116ccc8e8ed7..71984ec1fe0b801041f3544c1b596a6f // Use native VoiceOver support for live regions. BrowserAccessibilityCocoa* retained_node = native_node; -@@ -631,6 +635,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -627,6 +631,7 @@ void PostAnnouncementNotification(NSString* announcement, if ([NSApp isActive]) return window == [NSApp accessibilityFocusedWindow]; @@ -112,7 +112,7 @@ index b803e5f1e87b183d857195c007d7116ccc8e8ed7..71984ec1fe0b801041f3544c1b596a6f // TODO(accessibility): We need a solution to the problem described below. // If the window is NSAccessibilityRemoteUIElement, there are some challenges: // 1. NSApp is the browser which spawned the PWA, and what it considers the -@@ -658,6 +663,7 @@ void PostAnnouncementNotification(NSString* announcement, +@@ -654,6 +659,7 @@ void PostAnnouncementNotification(NSString* announcement, // from within the app shim content. if ([window isKindOfClass:[NSAccessibilityRemoteUIElement class]]) return true; @@ -121,10 +121,10 @@ index b803e5f1e87b183d857195c007d7116ccc8e8ed7..71984ec1fe0b801041f3544c1b596a6f return false; } diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h -index 43f288af24064365999da0904dcb63bd3157497d..ae67c1ab9a1d6ca8d3aa373b7ae73986ea4cf096 100644 +index fd35d3a94113f1337b097cfa4bf40d8330504e5a..04bd16db3b8a23b9e5d90ced459c440a34ffa375 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h -@@ -53,7 +53,9 @@ class ScopedPasswordInputEnabler; +@@ -49,7 +49,9 @@ class ScopedPasswordInputEnabler; @protocol RenderWidgetHostViewMacDelegate; @@ -134,7 +134,7 @@ index 43f288af24064365999da0904dcb63bd3157497d..ae67c1ab9a1d6ca8d3aa373b7ae73986 @class RenderWidgetHostViewCocoa; namespace content { -@@ -669,9 +671,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac +@@ -667,9 +669,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac // EnsureSurfaceSynchronizedForWebTest(). uint32_t latest_capture_sequence_number_ = 0u; @@ -147,10 +147,10 @@ index 43f288af24064365999da0904dcb63bd3157497d..ae67c1ab9a1d6ca8d3aa373b7ae73986 // Used to force the NSApplication's focused accessibility element to be the // content::BrowserAccessibilityCocoa accessibility tree when the NSView for diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index 87c6840293a63ad6c77a07952444965d6fe80d1e..a9b4caaa4da3bee1a22db976a8ec71dc7d5400ed 100644 +index b8d1f98c9c7c5831677d4c200aa085a4a168273c..7f2b627031f65ad45a8ad182d3b7421005893ff4 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -267,8 +267,10 @@ +@@ -263,8 +263,10 @@ void RenderWidgetHostViewMac::MigrateNSViewBridge( remote_cocoa::mojom::Application* remote_cocoa_application, uint64_t parent_ns_view_id) { @@ -161,7 +161,7 @@ index 87c6840293a63ad6c77a07952444965d6fe80d1e..a9b4caaa4da3bee1a22db976a8ec71dc // Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling // pointers. `ns_view_` gets reinitialized later in this method. -@@ -1616,8 +1618,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1614,8 +1616,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, gfx::NativeViewAccessible RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() { @@ -172,7 +172,7 @@ index 87c6840293a63ad6c77a07952444965d6fe80d1e..a9b4caaa4da3bee1a22db976a8ec71dc return [GetInProcessNSView() window]; } -@@ -1661,9 +1665,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1659,9 +1663,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, } void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) { @@ -184,7 +184,7 @@ index 87c6840293a63ad6c77a07952444965d6fe80d1e..a9b4caaa4da3bee1a22db976a8ec71dc } bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame( -@@ -2165,12 +2171,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -2163,12 +2169,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken( const std::vector& window_token) { @@ -200,10 +200,10 @@ index 87c6840293a63ad6c77a07952444965d6fe80d1e..a9b4caaa4da3bee1a22db976a8ec71dc /////////////////////////////////////////////////////////////////////////////// diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index b521b461456dac293972ded8cafd6b253c8b3f4d..614ae2d72c934f0f6650a501b7d132f5745f767e 100644 +index 121d8798571233799624a1e187b0f0edfdb9ca98..9233e89712a12e27d85232fb51f113f41375a08a 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn -@@ -372,6 +372,13 @@ component("base") { +@@ -373,6 +373,13 @@ component("base") { sources += [ "resource/resource_bundle_lacros.cc" ] } @@ -238,11 +238,11 @@ index 835cce73b7ab8b38c37d3e2650e12303d9d918e3..4460a00497dfaee0ba90cd5d14888055 + #endif // UI_BASE_COCOA_REMOTE_ACCESSIBILITY_API_H_ diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h -index 3dd3793920853cff31ce62c833aefff58826f88c..bc00d9099c9033a09d97e19df37ca38e94b54713 100644 +index 58f1b79111a0be5102976c3e257375c409c1c4be..be0306b98feb451fefeec70becbcf51612d22283 100644 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.h +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h -@@ -34,7 +34,9 @@ - #endif +@@ -30,7 +30,9 @@ + #include "ui/views/window/dialog_observer.h" @class NativeWidgetMacNSWindow; +#if !IS_MAS_BUILD() @@ -251,7 +251,7 @@ index 3dd3793920853cff31ce62c833aefff58826f88c..bc00d9099c9033a09d97e19df37ca38e @class NSView; namespace remote_cocoa { -@@ -454,10 +456,12 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost +@@ -450,10 +452,12 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost mojo::AssociatedRemote remote_ns_window_remote_; @@ -265,10 +265,10 @@ index 3dd3793920853cff31ce62c833aefff58826f88c..bc00d9099c9033a09d97e19df37ca38e // Used to force the NSApplication's focused accessibility element to be the // views::Views accessibility tree when the NSView for this is focused. diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm -index 5071b3625faecc8856d13227b2ec43eedca8e906..fdfaef4c1f2d4498134010d984cadb24999b4f87 100644 +index 42b7016e880b26e2cc8b9da14917907d4826440c..f6b588c059d6706155144f3b0a9a8861d8f1146d 100644 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm -@@ -343,7 +343,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -339,7 +339,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSView() const { if (in_process_ns_window_bridge_) return in_process_ns_window_bridge_->ns_view(); @@ -280,7 +280,7 @@ index 5071b3625faecc8856d13227b2ec43eedca8e906..fdfaef4c1f2d4498134010d984cadb24 } gfx::NativeViewAccessible -@@ -358,7 +362,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -354,7 +358,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator, return [in_process_ns_window_bridge_->ns_view() window]; } @@ -292,7 +292,7 @@ index 5071b3625faecc8856d13227b2ec43eedca8e906..fdfaef4c1f2d4498134010d984cadb24 } remote_cocoa::mojom::NativeWidgetNSWindow* -@@ -1330,20 +1338,24 @@ void HandleAccelerator(const ui::Accelerator& accelerator, +@@ -1326,20 +1334,24 @@ void HandleAccelerator(const ui::Accelerator& accelerator, void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens( const std::vector& window_token, const std::vector& view_token) { diff --git a/patches/chromium/mas_disable_remote_layer.patch b/patches/chromium/mas_disable_remote_layer.patch index 05dad57919921..0a14a7f69e2c9 100644 --- a/patches/chromium/mas_disable_remote_layer.patch +++ b/patches/chromium/mas_disable_remote_layer.patch @@ -16,11 +16,11 @@ cases where performance improves when disabling remote CoreAnimation (remote CoreAnimation is really only about battery usage). diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h -index c4eda85ebb59f2f9fc440c93590b99d1e8a16447..5f518ffa672ef62a94dd043e5bc4a53c8775defa 100644 +index ee83f9e5504eda6bd1ad80db7bd486934b7f3b6d..5db55a349f7eaf829d8458b279fd64f1f28a9a2c 100644 --- a/gpu/ipc/service/image_transport_surface_overlay_mac.h +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h -@@ -28,7 +28,9 @@ - #error "This file requires ARC support." +@@ -24,7 +24,9 @@ + #include "gpu/ipc/service/gpu_vsync_mac.h" #endif +#if !IS_MAS_BUILD() @@ -29,7 +29,7 @@ index c4eda85ebb59f2f9fc440c93590b99d1e8a16447..5f518ffa672ef62a94dd043e5bc4a53c @class CALayer; namespace ui { -@@ -83,8 +85,10 @@ class ImageTransportSurfaceOverlayMacEGL : public gl::Presenter { +@@ -79,8 +81,10 @@ class ImageTransportSurfaceOverlayMacEGL : public gl::Presenter { base::WeakPtr delegate_; @@ -41,10 +41,10 @@ index c4eda85ebb59f2f9fc440c93590b99d1e8a16447..5f518ffa672ef62a94dd043e5bc4a53c gfx::Size pixel_size_; diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm -index 2972a8ad8e4eaffbc798ee57cd94400661f854bc..99b3dab8d0b29ffea8f11f3a15ccb90d42537a02 100644 +index bd2f1d8a8d82456390a5efb641545e9177727542..c368baeb3b8141a84f461eff5bd84129dc26f0fd 100644 --- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm -@@ -57,7 +57,9 @@ +@@ -53,7 +53,9 @@ ImageTransportSurfaceOverlayMacEGL::ImageTransportSurfaceOverlayMacEGL( base::WeakPtr delegate) : delegate_(delegate), @@ -54,7 +54,7 @@ index 2972a8ad8e4eaffbc798ee57cd94400661f854bc..99b3dab8d0b29ffea8f11f3a15ccb90d scale_factor_(1), weak_ptr_factory_(this) { static bool av_disabled_at_command_line = -@@ -69,6 +71,7 @@ +@@ -65,6 +67,7 @@ ->workarounds() .disable_av_sample_buffer_display_layer; @@ -62,7 +62,7 @@ index 2972a8ad8e4eaffbc798ee57cd94400661f854bc..99b3dab8d0b29ffea8f11f3a15ccb90d ca_layer_tree_coordinator_ = std::make_unique( use_remote_layer_api_, allow_av_sample_buffer_display_layer); -@@ -89,6 +92,10 @@ +@@ -85,6 +88,10 @@ #endif ca_context_.layer = ca_layer_tree_coordinator_->GetCALayerForDisplay(); } @@ -73,7 +73,7 @@ index 2972a8ad8e4eaffbc798ee57cd94400661f854bc..99b3dab8d0b29ffea8f11f3a15ccb90d #if BUILDFLAG(IS_MAC) if (features::UseGpuVsync()) { -@@ -180,9 +187,13 @@ +@@ -176,9 +183,13 @@ TRACE_EVENT_INSTANT2("test_gpu", "SwapBuffers", TRACE_EVENT_SCOPE_THREAD, "GLImpl", static_cast(gl::GetGLImplementation()), "width", pixel_size_.width()); @@ -88,10 +88,10 @@ index 2972a8ad8e4eaffbc798ee57cd94400661f854bc..99b3dab8d0b29ffea8f11f3a15ccb90d ca_layer_tree_coordinator_->GetIOSurfaceForDisplay(); if (io_surface) { diff --git a/ui/accelerated_widget_mac/display_ca_layer_tree.mm b/ui/accelerated_widget_mac/display_ca_layer_tree.mm -index 9f4869f00f31c6d3ad5081b1e7b67c4cf495fbdd..228b8d2e8835dc3a4f0454521a2bbd523cfd8933 100644 +index cdcb1da0c11b07cce895369aba56b78623a0bef5..3765fb5106c8f2fbc1438ad759a173610b5db2aa 100644 --- a/ui/accelerated_widget_mac/display_ca_layer_tree.mm +++ b/ui/accelerated_widget_mac/display_ca_layer_tree.mm -@@ -124,6 +124,7 @@ - (void)setContentsChanged; +@@ -120,6 +120,7 @@ - (void)setContentsChanged; } void DisplayCALayerTree::GotCALayerFrame(uint32_t ca_context_id) { @@ -99,7 +99,7 @@ index 9f4869f00f31c6d3ad5081b1e7b67c4cf495fbdd..228b8d2e8835dc3a4f0454521a2bbd52 // Early-out if the remote layer has not changed. if (remote_layer_.contextId == ca_context_id) { return; -@@ -153,6 +154,9 @@ - (void)setContentsChanged; +@@ -149,6 +150,9 @@ - (void)setContentsChanged; [io_surface_layer_ removeFromSuperlayer]; io_surface_layer_ = nil; } @@ -131,10 +131,10 @@ index 59dc2f82214cfd883b6ebef3b0fb25af6387a9cd..d585ba14b34021a93c878d0d9f9d9ef7 // This function will check if all of the interfaces listed above are supported diff --git a/ui/base/cocoa/remote_layer_api.mm b/ui/base/cocoa/remote_layer_api.mm -index 4aaf26f077c397184e2a304ecb827377b002b8bf..65ff1f2d0c9118734f86d3ecfc720a2f4415241f 100644 +index fc25ba79d2b0e1acdb7ba54b89e7d6e16f94771b..962df2d65d61ec0836cf465d847eb666033846f2 100644 --- a/ui/base/cocoa/remote_layer_api.mm +++ b/ui/base/cocoa/remote_layer_api.mm -@@ -14,6 +14,7 @@ +@@ -10,6 +10,7 @@ namespace ui { @@ -142,7 +142,7 @@ index 4aaf26f077c397184e2a304ecb827377b002b8bf..65ff1f2d0c9118734f86d3ecfc720a2f namespace { // Control use of cross-process CALayers to display content directly from the // GPU process on Mac. -@@ -21,8 +22,10 @@ +@@ -17,8 +18,10 @@ "RemoteCoreAnimationAPI", base::FEATURE_ENABLED_BY_DEFAULT); } // namespace @@ -153,7 +153,7 @@ index 4aaf26f077c397184e2a304ecb827377b002b8bf..65ff1f2d0c9118734f86d3ecfc720a2f if (!base::FeatureList::IsEnabled(kRemoteCoreAnimationAPI)) return false; -@@ -59,6 +62,9 @@ bool RemoteLayerAPISupported() { +@@ -55,6 +58,9 @@ bool RemoteLayerAPISupported() { // If everything is there, we should be able to use the API. return true; diff --git a/patches/chromium/mas_no_private_api.patch b/patches/chromium/mas_no_private_api.patch index a75a2dd13fb7d..41570aa730820 100644 --- a/patches/chromium/mas_no_private_api.patch +++ b/patches/chromium/mas_no_private_api.patch @@ -33,7 +33,7 @@ index 94a028be3c315edc0056408ab9ab41b6b001a1c1..0d830234edb5621f57e39f4a951d357a } // namespace base diff --git a/content/renderer/renderer_main_platform_delegate_mac.mm b/content/renderer/renderer_main_platform_delegate_mac.mm -index 22c7e07dffab64061d546aa537620c50948afec0..bf7f32fe6908ad5bf0186b0ad7a5e5ced88f21a5 100644 +index d4db3b179725cb96bcbd0f73db7d52ef8b7522db..6afbf1defb0591d9fe59a81e6c74746d3e15f081 100644 --- a/content/renderer/renderer_main_platform_delegate_mac.mm +++ b/content/renderer/renderer_main_platform_delegate_mac.mm @@ -10,9 +10,11 @@ @@ -46,9 +46,9 @@ index 22c7e07dffab64061d546aa537620c50948afec0..bf7f32fe6908ad5bf0186b0ad7a5e5ce } +#endif - #if !defined(__has_feature) || !__has_feature(objc_arc) - #error "This file requires ARC support." -@@ -26,6 +28,7 @@ + namespace content { + +@@ -22,6 +24,7 @@ // verifies there are no existing open connections), and then indicates that // Chrome should continue execution without access to launchservicesd. void DisableSystemServices() { @@ -56,7 +56,7 @@ index 22c7e07dffab64061d546aa537620c50948afec0..bf7f32fe6908ad5bf0186b0ad7a5e5ce // Tell the WindowServer that we don't want to make any future connections. // This will return Success as long as there are no open connections, which // is what we want. -@@ -34,6 +37,7 @@ void DisableSystemServices() { +@@ -30,6 +33,7 @@ void DisableSystemServices() { sandbox::DisableLaunchServices(); sandbox::DisableCoreServicesCheckFix(); @@ -65,12 +65,12 @@ index 22c7e07dffab64061d546aa537620c50948afec0..bf7f32fe6908ad5bf0186b0ad7a5e5ce } // namespace diff --git a/content/renderer/theme_helper_mac.mm b/content/renderer/theme_helper_mac.mm -index 75c28eeec5cae1afcefd0f429b151df6334c115b..6fee85efb4149e1b2cfff18404f0451cdc772b9e 100644 +index a119b4439bfb9218c7aaf09dca8e78527da7f20d..faa813b003940280c6eeb87e70173019bdd5280c 100644 --- a/content/renderer/theme_helper_mac.mm +++ b/content/renderer/theme_helper_mac.mm -@@ -12,10 +12,11 @@ - #error "This file requires ARC support." - #endif +@@ -8,10 +8,11 @@ + + #include "base/strings/sys_string_conversions.h" +#if !IS_MAS_BUILD() extern "C" { @@ -81,7 +81,7 @@ index 75c28eeec5cae1afcefd0f429b151df6334c115b..6fee85efb4149e1b2cfff18404f0451c namespace content { void SystemColorsDidChange(int aqua_color_variant) { -@@ -28,8 +29,18 @@ void SystemColorsDidChange(int aqua_color_variant) { +@@ -24,8 +25,18 @@ void SystemColorsDidChange(int aqua_color_variant) { } bool IsSubpixelAntialiasingAvailable() { @@ -101,18 +101,18 @@ index 75c28eeec5cae1afcefd0f429b151df6334c115b..6fee85efb4149e1b2cfff18404f0451c } // namespace content diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm -index aa93fcc4de03d8032e9090ca8b66019eeb7be8b0..721e7083e94fa977908858c908274c8db49c07a0 100644 +index 4b1d57ef72d6a9235edc7a2591c8c3242c283235..680cf1ee57e0a9748a3b1efa93cb2d1569ac5655 100644 --- a/device/bluetooth/bluetooth_adapter_mac.mm +++ b/device/bluetooth/bluetooth_adapter_mac.mm -@@ -41,6 +41,7 @@ - #error "This file requires ARC support." - #endif +@@ -37,6 +37,7 @@ + #include "device/bluetooth/bluetooth_socket_mac.h" + #include "device/bluetooth/public/cpp/bluetooth_address.h" +#if !IS_MAS_BUILD() extern "C" { // Undocumented IOBluetooth Preference API [1]. Used by `blueutil` [2] and // `Karabiner` [3] to programmatically control the Bluetooth state. Calling the -@@ -54,6 +55,7 @@ +@@ -50,6 +51,7 @@ // [4] https://support.apple.com/kb/PH25091 void IOBluetoothPreferenceSetControllerPowerState(int state); } @@ -120,7 +120,7 @@ index aa93fcc4de03d8032e9090ca8b66019eeb7be8b0..721e7083e94fa977908858c908274c8d namespace { -@@ -97,8 +99,10 @@ bool IsDeviceSystemPaired(const std::string& device_address) { +@@ -93,8 +95,10 @@ bool IsDeviceSystemPaired(const std::string& device_address) { : controller_state_function_( base::BindRepeating(&BluetoothAdapterMac::GetHostControllerState, base::Unretained(this))), @@ -131,7 +131,7 @@ index aa93fcc4de03d8032e9090ca8b66019eeb7be8b0..721e7083e94fa977908858c908274c8d classic_discovery_manager_( BluetoothDiscoveryManagerMac::CreateClassic(this)), device_paired_status_callback_( -@@ -247,8 +251,12 @@ bool IsDeviceSystemPaired(const std::string& device_address) { +@@ -243,8 +247,12 @@ bool IsDeviceSystemPaired(const std::string& device_address) { } bool BluetoothAdapterMac::SetPoweredImpl(bool powered) { @@ -426,10 +426,10 @@ index 18479382a277cb2b25626ec8d31442bfd1377ee6..7d80d7fa8337523c3a70f317f883f0cc NOTREACHED(); return nullptr; diff --git a/ui/accessibility/platform/inspect/ax_transform_mac.mm b/ui/accessibility/platform/inspect/ax_transform_mac.mm -index fa8915da42d7c16534fd97d75f975d49b2f1cc51..45f7a83beb467f98ff15f60cec685e5fda69ddc7 100644 +index 701b59231f2e5fbd31482775a248a0ff9755a480..271f9d1eebcf29aa7a8b98a0655038e75464a56b 100644 --- a/ui/accessibility/platform/inspect/ax_transform_mac.mm +++ b/ui/accessibility/platform/inspect/ax_transform_mac.mm -@@ -112,6 +112,7 @@ +@@ -108,6 +108,7 @@ } } @@ -437,7 +437,7 @@ index fa8915da42d7c16534fd97d75f975d49b2f1cc51..45f7a83beb467f98ff15f60cec685e5f // AXTextMarker if (IsAXTextMarker(value)) { return AXTextMarkerToBaseValue(value, indexer); -@@ -121,6 +122,7 @@ +@@ -117,6 +118,7 @@ if (IsAXTextMarkerRange(value)) { return AXTextMarkerRangeToBaseValue(value, indexer); } diff --git a/patches/chromium/mas_use_public_apis_to_determine_if_a_font_is_a_system_font.patch b/patches/chromium/mas_use_public_apis_to_determine_if_a_font_is_a_system_font.patch index d01a1e9c3af76..23199bac389c6 100644 --- a/patches/chromium/mas_use_public_apis_to_determine_if_a_font_is_a_system_font.patch +++ b/patches/chromium/mas_use_public_apis_to_determine_if_a_font_is_a_system_font.patch @@ -9,10 +9,10 @@ system font by checking if it's kCTFontPriorityAttribute is set to system priority. diff --git a/ui/gfx/platform_font_mac.mm b/ui/gfx/platform_font_mac.mm -index 1e1bfb0068096b7ff8c8e1913ee884a245cfb226..2a30628c84d8f6bc2fd5548e838d2d13824bc7d3 100644 +index 20abc5cbd3ab4a8a1a20390b1cfda49b6cf22f19..1e3deea10901f141a8672a5faad26a6a91fb19a8 100644 --- a/ui/gfx/platform_font_mac.mm +++ b/ui/gfx/platform_font_mac.mm -@@ -32,9 +32,11 @@ +@@ -28,9 +28,11 @@ using Weight = Font::Weight; @@ -24,7 +24,7 @@ index 1e1bfb0068096b7ff8c8e1913ee884a245cfb226..2a30628c84d8f6bc2fd5548e838d2d13 namespace { -@@ -249,7 +251,13 @@ CTFontRef SystemFontForConstructorOfType(PlatformFontMac::SystemFontType type) { +@@ -245,7 +247,13 @@ CTFontRef SystemFontForConstructorOfType(PlatformFontMac::SystemFontType type) { // TODO(avi, etienneb): Figure out this font stuff. base::ScopedCFTypeRef descriptor( CTFontCopyFontDescriptor(font)); 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 b791a7862a508..f849385d3ea1e 100644 --- a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch +++ b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch @@ -7,7 +7,7 @@ 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 fcba565164b4879d198a03003269996e64571a96..a07eed86e0845bb63bb9b4f8f952c02a3cbaba1c 100644 +index c5f4244e73195a478be144fe02c11b19440521dd..46b6efb81e456d1f4543e21acbda669e89204e67 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc @@ -146,6 +146,11 @@ @@ -122,7 +122,7 @@ index fcba565164b4879d198a03003269996e64571a96..a07eed86e0845bb63bb9b4f8f952c02a constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess; NetworkContext::PendingCertVerify::PendingCertVerify() = default; -@@ -773,6 +871,13 @@ void NetworkContext::SetClient( +@@ -781,6 +879,13 @@ void NetworkContext::SetClient( client_.Bind(std::move(client)); } @@ -136,7 +136,7 @@ index fcba565164b4879d198a03003269996e64571a96..a07eed86e0845bb63bb9b4f8f952c02a void NetworkContext::CreateURLLoaderFactory( mojo::PendingReceiver receiver, mojom::URLLoaderFactoryParamsPtr params) { -@@ -2329,6 +2434,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2340,6 +2445,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( std::move(cert_verifier)); cert_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_.get()); #endif // BUILDFLAG(IS_CHROMEOS) @@ -147,10 +147,10 @@ index fcba565164b4879d198a03003269996e64571a96..a07eed86e0845bb63bb9b4f8f952c02a builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier( diff --git a/services/network/network_context.h b/services/network/network_context.h -index 5a6cfcf157071de3da5b485e43ef66c9feb89782..1f18813a6a27c24c915f7b0d40c1d4f5d88d062b 100644 +index b2b848b38840ba1205d376643735cedea77443a5..8b232e22bdeb5fdcd1033889d041b42c2bc68f5a 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h -@@ -115,6 +115,7 @@ class URLMatcher; +@@ -114,6 +114,7 @@ class URLMatcher; namespace network { class CertVerifierWithTrustAnchors; @@ -158,7 +158,7 @@ index 5a6cfcf157071de3da5b485e43ef66c9feb89782..1f18813a6a27c24c915f7b0d40c1d4f5 class CookieManager; class HostResolver; class MdnsResponderManager; -@@ -248,6 +249,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -247,6 +248,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext void CreateURLLoaderFactory( mojo::PendingReceiver receiver, mojom::URLLoaderFactoryParamsPtr params) override; @@ -167,7 +167,7 @@ index 5a6cfcf157071de3da5b485e43ef66c9feb89782..1f18813a6a27c24c915f7b0d40c1d4f5 void ResetURLLoaderFactories() override; void GetViaObliviousHttp( mojom::ObliviousHttpRequestPtr request, -@@ -887,6 +890,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -882,6 +885,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext std::vector dismount_closures_; #endif // BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED) @@ -177,7 +177,7 @@ index 5a6cfcf157071de3da5b485e43ef66c9feb89782..1f18813a6a27c24c915f7b0d40c1d4f5 std::unique_ptr internal_host_resolver_; // Map values set to non-null only if that HostResolver has its own private diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 17cac41687df6075647142d14fc7a5e6770afe98..055f212db4a53cd1283e4d5bed8377cb34aff81a 100644 +index e1385ffd429409aad74b73a1a7a1e7feea7181cd..e082a44bbeb6a99a6d1f0cbcc1be52646fc2c3b6 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom @@ -311,6 +311,17 @@ struct NetworkContextFilePaths { @@ -198,7 +198,7 @@ index 17cac41687df6075647142d14fc7a5e6770afe98..055f212db4a53cd1283e4d5bed8377cb // Parameters for constructing a network context. struct NetworkContextParams { // The user agent string. -@@ -925,6 +936,9 @@ interface NetworkContext { +@@ -922,6 +933,9 @@ interface NetworkContext { // Sets a client for this network context. SetClient(pending_remote client); diff --git a/patches/chromium/notification_provenance.patch b/patches/chromium/notification_provenance.patch index a642b5f729d19..6baa53d92330b 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -7,7 +7,7 @@ Pass RenderFrameHost through to PlatformNotificationService so Electron can identify which renderer a notification came from. diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc -index f2ef4881ffacd2f76bffdcca774de614ad1fc593..c78571b85e7d76f8d0e9258cf1a5f1eb0474632e 100644 +index 21683b9fba4414d825a32a7c12cf55b4bcc488a9..367299bdfc6d716099ff4ceafe493af4fe880bad 100644 --- a/chrome/browser/notifications/platform_notification_service_impl.cc +++ b/chrome/browser/notifications/platform_notification_service_impl.cc @@ -201,6 +201,7 @@ bool PlatformNotificationServiceImpl::WasClosedProgrammatically( @@ -19,10 +19,10 @@ index f2ef4881ffacd2f76bffdcca774de614ad1fc593..c78571b85e7d76f8d0e9258cf1a5f1eb const GURL& origin, const GURL& document_url, diff --git a/chrome/browser/notifications/platform_notification_service_impl.h b/chrome/browser/notifications/platform_notification_service_impl.h -index 380a2da617ff5e49f780f4b89d87ceefd75bb6f7..ec78a854531b7d52fbaa5de71fc5e67180fad8c8 100644 +index 4ffd662e1411c8ba707cfab6970d7533246633e1..9266120342a179bb642286e617feeafb8f57d798 100644 --- a/chrome/browser/notifications/platform_notification_service_impl.h +++ b/chrome/browser/notifications/platform_notification_service_impl.h -@@ -56,6 +56,7 @@ class PlatformNotificationServiceImpl +@@ -57,6 +57,7 @@ class PlatformNotificationServiceImpl // content::PlatformNotificationService implementation. void DisplayNotification( @@ -133,7 +133,7 @@ index d0e0d10739b5daf99435a67e18dc51df8e670e09..704f3d6c2fdd27a84d1c4e1b7bf680f6 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 fdd7b9f419c597ece34e1a9d7c625e2c2dd67c5e..7a6ac28c250f2c4947f7035a34dccf9b5d9f1918 100644 +index 7f34ad97947dfb3dccc29edeb06365b007236183..1165a7e81de03921ab774006cfb06f928cb2632e 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -2230,7 +2230,7 @@ void RenderProcessHostImpl::CreateNotificationService( @@ -176,10 +176,10 @@ index d9e36712dc3fbc6a9043e2c33660090ca2f7367b..7d910583eb22fc315eb0619febe518d5 const GURL& origin, const GURL& document_url, diff --git a/content/test/mock_platform_notification_service.cc b/content/test/mock_platform_notification_service.cc -index 56b56dff38b6f0e6a2967e10462667e0a8ead6ce..85a1894767df7026388e0486f96d9ddb602391e4 100644 +index c9a01dd2bd6e0de08c09b417c3dce5ef13adb304..ded3b477c9766a77cd8fe1c2646bcc1935ebb1ec 100644 --- a/content/test/mock_platform_notification_service.cc +++ b/content/test/mock_platform_notification_service.cc -@@ -28,6 +28,7 @@ MockPlatformNotificationService::MockPlatformNotificationService( +@@ -29,6 +29,7 @@ MockPlatformNotificationService::MockPlatformNotificationService( MockPlatformNotificationService::~MockPlatformNotificationService() = default; void MockPlatformNotificationService::DisplayNotification( diff --git a/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch b/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch index 59c4c8ce44749..d720d6bbd4b18 100644 --- a/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch +++ b/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch @@ -8,10 +8,10 @@ needed in chromium but our autofill implementation uses them. This patch can be our autofill implementation to work like Chromium's. diff --git a/ui/color/color_id.h b/ui/color/color_id.h -index d493cfc3d71338532bdaad72bae184d2e9f55280..e868644967e2bdb107eb28775b18e7f20c46ab73 100644 +index 7fb6f6449dcfac86fdc4f3af628d5b6a9e91f5c4..962c878e2e19ca1cb932e9f9332508f2ac989026 100644 --- a/ui/color/color_id.h +++ b/ui/color/color_id.h -@@ -379,6 +379,10 @@ +@@ -388,6 +388,10 @@ E_CPONLY(kColorScrollbarThumbInactive) \ E_CPONLY(kColorScrollbarThumbPressed) \ E_CPONLY(kColorScrollbarTrack) \ @@ -22,7 +22,7 @@ index d493cfc3d71338532bdaad72bae184d2e9f55280..e868644967e2bdb107eb28775b18e7f2 E_CPONLY(kColorSegmentedButtonBorder) \ E_CPONLY(kColorSegmentedButtonFocus) \ E_CPONLY(kColorSegmentedButtonForegroundChecked) \ -@@ -472,6 +476,7 @@ +@@ -488,6 +492,7 @@ E_CPONLY(kColorTreeNodeForeground) \ E_CPONLY(kColorTreeNodeForegroundSelectedFocused) \ E_CPONLY(kColorTreeNodeForegroundSelectedUnfocused) \ diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index d13241df0d409..1ae1cf253eef6 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -11,10 +11,10 @@ majority of changes originally come from these PRs: This patch also fixes callback for manual user cancellation and success. diff --git a/BUILD.gn b/BUILD.gn -index 83530a3a22a75ec4010ed2ffb20e7a6f4751b835..f7b75fa8f943861b211cbe9a981face8317cc8f0 100644 +index dfcf0ad8238688f9e25d09cc3842cd8a42cf7316..e7b0bd77727f9c352a287a3100f35f7672d4b4a8 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -971,7 +971,6 @@ if (is_win) { +@@ -974,7 +974,6 @@ if (is_win) { "//media:media_unittests", "//media/midi:midi_unittests", "//net:net_unittests", @@ -22,7 +22,7 @@ index 83530a3a22a75ec4010ed2ffb20e7a6f4751b835..f7b75fa8f943861b211cbe9a981face8 "//sql:sql_unittests", "//third_party/breakpad:symupload($host_toolchain)", "//ui/base:ui_base_unittests", -@@ -980,6 +979,10 @@ if (is_win) { +@@ -983,6 +982,10 @@ if (is_win) { "//ui/views:views_unittests", "//url:url_unittests", ] @@ -34,7 +34,7 @@ index 83530a3a22a75ec4010ed2ffb20e7a6f4751b835..f7b75fa8f943861b211cbe9a981face8 } diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc -index 3a66a52b8d3c6da9cd8d7e9afdc8d59f528ec3d5..facaa6fbca8ee7c04f83607e62b81b9594727ada 100644 +index c27e2d50aa6cd45484c222221c6a8dda50baf8ff..43c48b75806bb08f3a4ea45689fe2469368cca4a 100644 --- a/chrome/browser/printing/print_job.cc +++ b/chrome/browser/printing/print_job.cc @@ -93,6 +93,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) { @@ -66,7 +66,7 @@ index 3a66a52b8d3c6da9cd8d7e9afdc8d59f528ec3d5..facaa6fbca8ee7c04f83607e62b81b95 #endif auto new_doc = base::MakeRefCounted(std::move(settings), -@@ -374,8 +374,10 @@ void PrintJob::StartPdfToEmfConversion( +@@ -381,8 +381,10 @@ void PrintJob::StartPdfToEmfConversion( const PrintSettings& settings = document()->settings(); @@ -78,7 +78,7 @@ index 3a66a52b8d3c6da9cd8d7e9afdc8d59f528ec3d5..facaa6fbca8ee7c04f83607e62b81b95 using RenderMode = PdfRenderSettings::Mode; RenderMode mode = print_with_reduced_rasterization -@@ -465,8 +467,10 @@ void PrintJob::StartPdfToPostScriptConversion( +@@ -472,8 +474,10 @@ void PrintJob::StartPdfToPostScriptConversion( if (ps_level2) { mode = PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2; } else { @@ -91,7 +91,7 @@ index 3a66a52b8d3c6da9cd8d7e9afdc8d59f528ec3d5..facaa6fbca8ee7c04f83607e62b81b95 : PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3; } diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc -index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508025af64c 100644 +index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c884d5d8351 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc @@ -23,7 +23,9 @@ @@ -273,7 +273,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 } } -@@ -647,10 +688,12 @@ void PrintViewManagerBase::DidPrintDocument( +@@ -635,10 +676,12 @@ void PrintViewManagerBase::DidPrintDocument( void PrintViewManagerBase::GetDefaultPrintSettings( GetDefaultPrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -286,7 +286,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 #if BUILDFLAG(ENABLE_OOP_PRINTING) if (printing::features::kEnableOopPrintDriversJobPrint.Get() && #if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS) -@@ -702,10 +745,12 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -690,10 +733,12 @@ void PrintViewManagerBase::UpdatePrintSettings( base::Value::Dict job_settings, UpdatePrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -299,7 +299,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 absl::optional printer_type_value = job_settings.FindInt(kSettingPrinterType); -@@ -716,6 +761,7 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -704,6 +749,7 @@ void PrintViewManagerBase::UpdatePrintSettings( mojom::PrinterType printer_type = static_cast(*printer_type_value); @@ -307,7 +307,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 if (printer_type != mojom::PrinterType::kExtension && printer_type != mojom::PrinterType::kPdf && printer_type != mojom::PrinterType::kLocal) { -@@ -735,6 +781,7 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -723,6 +769,7 @@ void PrintViewManagerBase::UpdatePrintSettings( if (value > 0) job_settings.Set(kSettingRasterizePdfDpi, value); } @@ -315,7 +315,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 std::unique_ptr print_settings = PrintSettingsFromJobSettings(job_settings); -@@ -754,7 +801,21 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -742,7 +789,21 @@ void PrintViewManagerBase::UpdatePrintSettings( } } @@ -338,15 +338,16 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 // TODO(crbug.com/1424368): Remove this if the printable areas can be made // fully available from `PrintBackend::GetPrinterSemanticCapsAndDefaults()` // for in-browser queries. -@@ -776,15 +837,13 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -764,8 +825,6 @@ void PrintViewManagerBase::UpdatePrintSettings( } #endif - CompleteUpdatePrintSettings(std::move(job_settings), - std::move(print_settings), std::move(callback)); } - #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) + void PrintViewManagerBase::SetAccessibilityTree( +@@ -781,7 +840,7 @@ void PrintViewManagerBase::SetAccessibilityTree( void PrintViewManagerBase::IsPrintingEnabled( IsPrintingEnabledCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -355,7 +356,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 } void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, -@@ -800,14 +859,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, +@@ -797,14 +856,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, // didn't happen for some reason. bad_message::ReceivedBadMessage( render_process_host, bad_message::PVMB_SCRIPTED_PRINT_FENCED_FRAME); @@ -372,7 +373,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 return; } #endif -@@ -843,6 +902,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, +@@ -850,6 +909,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, PrintManager::PrintingFailed(cookie, reason); @@ -380,7 +381,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 // `PrintingFailed()` can occur because asynchronous compositing results // don't complete until after a print job has already failed and been // destroyed. In such cases the error notification to the user will -@@ -852,7 +912,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, +@@ -859,7 +919,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, print_job_->document()->cookie() == cookie) { ShowPrintErrorDialogForGenericError(); } @@ -389,7 +390,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 ReleasePrinterQuery(); } -@@ -864,15 +924,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) { +@@ -871,15 +931,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) { test_observers_.RemoveObserver(&observer); } @@ -414,7 +415,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 } void PrintViewManagerBase::RenderFrameDeleted( -@@ -924,7 +993,12 @@ void PrintViewManagerBase::OnJobDone() { +@@ -931,7 +1000,12 @@ void PrintViewManagerBase::OnJobDone() { // Printing is done, we don't need it anymore. // print_job_->is_job_pending() may still be true, depending on the order // of object registration. @@ -428,7 +429,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 ReleasePrintJob(); } -@@ -933,9 +1007,10 @@ void PrintViewManagerBase::OnCanceling() { +@@ -940,9 +1014,10 @@ void PrintViewManagerBase::OnCanceling() { } void PrintViewManagerBase::OnFailed() { @@ -440,7 +441,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 TerminatePrintJob(true); } -@@ -945,7 +1020,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() { +@@ -952,7 +1027,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() { // Is the document already complete? if (print_job_->document() && print_job_->document()->IsComplete()) { @@ -449,7 +450,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 return true; } -@@ -993,7 +1068,10 @@ bool PrintViewManagerBase::CreateNewPrintJob( +@@ -1000,7 +1075,10 @@ bool PrintViewManagerBase::CreateNewPrintJob( // Disconnect the current `print_job_`. auto weak_this = weak_ptr_factory_.GetWeakPtr(); @@ -461,7 +462,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 if (!weak_this) return false; -@@ -1014,7 +1092,7 @@ bool PrintViewManagerBase::CreateNewPrintJob( +@@ -1021,7 +1099,7 @@ bool PrintViewManagerBase::CreateNewPrintJob( #endif print_job_->AddObserver(*this); @@ -470,7 +471,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 return true; } -@@ -1082,6 +1160,11 @@ void PrintViewManagerBase::ReleasePrintJob() { +@@ -1089,6 +1167,11 @@ void PrintViewManagerBase::ReleasePrintJob() { } #endif @@ -482,7 +483,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 if (!print_job_) return; -@@ -1089,7 +1172,7 @@ void PrintViewManagerBase::ReleasePrintJob() { +@@ -1096,7 +1179,7 @@ void PrintViewManagerBase::ReleasePrintJob() { // printing_rfh_ should only ever point to a RenderFrameHost with a live // RenderFrame. DCHECK(rfh->IsRenderFrameLive()); @@ -491,7 +492,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 } print_job_->RemoveObserver(*this); -@@ -1131,7 +1214,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() { +@@ -1138,7 +1221,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() { } bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) { @@ -500,7 +501,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 return true; if (!cookie) { -@@ -1277,7 +1360,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() { +@@ -1284,7 +1367,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() { } void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) { @@ -509,7 +510,7 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 for (auto& observer : GetTestObservers()) { observer.OnPrintNow(rfh); -@@ -1327,7 +1410,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis( +@@ -1334,7 +1417,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis( set_analyzing_content(/*analyzing=*/false); if (!allowed || !printing_rfh_ || IsCrashed() || !printing_rfh_->IsRenderFrameLive()) { @@ -519,10 +520,10 @@ index 0c4e987c5bf3298c3600e248f0213fb9288a59c7..8ae1217098b15f1634612945a6f10508 } CompleteScriptedPrint(printing_rfh_, std::move(params), std::move(callback)); diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h -index 78c9218049835cafdc9a0d7719bc073a81432c81..f233546a63a3b0f3531042b055a0011cc1980958 100644 +index eab82d64b186ca820d7c28a1a1060e95fc67fff8..1292c0050f67c09be87f8fd06026412c816b505d 100644 --- a/chrome/browser/printing/print_view_manager_base.h +++ b/chrome/browser/printing/print_view_manager_base.h -@@ -47,6 +47,8 @@ namespace printing { +@@ -44,6 +44,8 @@ namespace printing { class PrintQueriesQueue; class PrinterQuery; @@ -531,7 +532,7 @@ index 78c9218049835cafdc9a0d7719bc073a81432c81..f233546a63a3b0f3531042b055a0011c // Base class for managing the print commands for a WebContents. class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { public: -@@ -83,7 +85,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -77,7 +79,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { // Prints the current document immediately. Since the rendering is // asynchronous, the actual printing will not be completed on the return of // this function. Returns false if printing is impossible at the moment. @@ -543,7 +544,7 @@ index 78c9218049835cafdc9a0d7719bc073a81432c81..f233546a63a3b0f3531042b055a0011c // Like PrintNow(), but for the node under the context menu, instead of the // entire frame. -@@ -139,8 +144,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -131,8 +136,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { void IsPrintingEnabled(IsPrintingEnabledCallback callback) override; void ScriptedPrint(mojom::ScriptedPrintParamsPtr params, ScriptedPrintCallback callback) override; @@ -554,7 +555,7 @@ index 78c9218049835cafdc9a0d7719bc073a81432c81..f233546a63a3b0f3531042b055a0011c // Adds and removes observers for `PrintViewManagerBase` events. The order in // which notifications are sent to observers is undefined. Observers must be -@@ -148,6 +155,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -140,6 +147,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { void AddTestObserver(TestObserver& observer); void RemoveTestObserver(TestObserver& observer); @@ -569,7 +570,7 @@ index 78c9218049835cafdc9a0d7719bc073a81432c81..f233546a63a3b0f3531042b055a0011c protected: explicit PrintViewManagerBase(content::WebContents* web_contents); -@@ -285,6 +300,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -277,6 +292,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { bool success); #endif void CompleteUpdatePrintSettings( @@ -577,7 +578,7 @@ index 78c9218049835cafdc9a0d7719bc073a81432c81..f233546a63a3b0f3531042b055a0011c base::Value::Dict job_settings, std::unique_ptr print_settings, UpdatePrintSettingsCallback callback); -@@ -320,7 +336,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -312,7 +328,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { // Runs `callback` with `params` to reply to ScriptedPrint(). void ScriptedPrintReply(ScriptedPrintCallback callback, int process_id, @@ -587,7 +588,7 @@ index 78c9218049835cafdc9a0d7719bc073a81432c81..f233546a63a3b0f3531042b055a0011c // Requests the RenderView to render all the missing pages for the print job. // No-op if no print job is pending. Returns true if at least one page has -@@ -401,8 +418,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -393,8 +410,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { // The current RFH that is printing with a system printing dialog. raw_ptr printing_rfh_ = nullptr; @@ -680,7 +681,7 @@ index ca71560874a0189068dd11fbc039f5673bf6bd96..a8551d95e64da2afbc1685b2df8f1fc3 mojom::PrintFailureReason reason) override; diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom -index c46e272beafd30a089b06d0920f0e94d8736b81b..b5d61250dc58d20e9c17958ac26a519b7c888ccc 100644 +index 0f535d5dd1db2e538382a91a0cf06f37d6b4961f..8156c74ad9ffeabfc0d87570a2d2ae1304f1ffa7 100644 --- a/components/printing/common/print.mojom +++ b/components/printing/common/print.mojom @@ -302,7 +302,7 @@ union PrintWithParamsResult { @@ -705,7 +706,7 @@ index c46e272beafd30a089b06d0920f0e94d8736b81b..b5d61250dc58d20e9c17958ac26a519b // Tells the browser printing failed. 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 bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0b645513a 100644 +index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e7820f1de 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc @@ -46,6 +46,7 @@ @@ -716,17 +717,25 @@ index bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0 #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" -@@ -1384,7 +1385,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { - if (!weak_this) - return; +@@ -1351,7 +1352,6 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { + } -- Print(web_frame, blink::WebNode(), PrintRequestType::kScripted); -+ Print(web_frame, blink::WebNode(), PrintRequestType::kScripted, -+ false /* silent */, base::Value::Dict() /* new_settings */); - if (!weak_this) - return; + print_in_progress_ = true; +- + auto weak_this = weak_ptr_factory_.GetWeakPtr(); + RecordBeforeAfterPrintEventForDebugging(__LINE__); + web_frame->DispatchBeforePrintEvent(/*print_client=*/nullptr); +@@ -1359,7 +1359,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { + return; + } -@@ -1416,7 +1418,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( +- Print(web_frame, blink::WebNode(), PrintRequestType::kScripted); ++ Print(web_frame, blink::WebNode(), PrintRequestType::kScripted, ++ false /* silent */, base::Value::Dict() /* new_settings */); + if (!weak_this) { + return; + } +@@ -1391,7 +1392,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( receivers_.Add(this, std::move(receiver)); } @@ -735,7 +744,7 @@ index bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0 ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr()); if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; -@@ -1432,7 +1434,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { +@@ -1407,7 +1408,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { // plugin node and print that instead. auto plugin = delegate_->GetPdfElement(frame); @@ -744,17 +753,17 @@ index bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0 if (!render_frame_gone_) { RecordBeforeAfterPrintEventForDebugging(__LINE__); -@@ -1516,7 +1518,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { +@@ -1491,7 +1492,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { } Print(frame, print_preview_context_.source_node(), - PrintRequestType::kRegular); + PrintRequestType::kRegular, false, + base::Value::Dict()); - if (!render_frame_gone_) { - RecordBeforeAfterPrintEventForDebugging(__LINE__); - print_preview_context_.DispatchAfterPrintEvent(); -@@ -1570,6 +1573,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { + if (render_frame_gone_) { + return; + } +@@ -1555,6 +1557,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; @@ -763,17 +772,17 @@ index bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0 print_preview_context_.OnPrintPreview(); #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -2193,7 +2198,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { - return; +@@ -2189,7 +2193,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { + } - Print(duplicate_node.GetDocument().GetFrame(), duplicate_node, -- PrintRequestType::kRegular); -+ PrintRequestType::kRegular, false /* silent */, -+ base::Value::Dict() /* new_settings */); - // Check if |this| is still valid. - if (!weak_this) - return; -@@ -2209,7 +2215,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { + Print(duplicate_node.GetDocument().GetFrame(), duplicate_node, +- PrintRequestType::kRegular); ++ PrintRequestType::kRegular, false /* silent */, ++ base::Value::Dict() /* new_settings */); + // Check if |this| is still valid. + if (!weak_this) { + return; +@@ -2206,7 +2211,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -784,7 +793,7 @@ index bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0 // If still not finished with earlier print request simply ignore. if (prep_frame_view_) return; -@@ -2217,7 +2225,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2214,7 +2221,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, FrameReference frame_ref(frame); uint32_t expected_page_count = 0; @@ -793,7 +802,7 @@ index bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0 DidFinishPrinting(PrintingResult::kFailPrintInit); return; // Failed to init print page settings. } -@@ -2236,8 +2244,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2233,8 +2240,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, print_pages_params_->params->print_scaling_option; auto self = weak_ptr_factory_.GetWeakPtr(); @@ -810,7 +819,7 @@ index bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0 // Check if |this| is still valid. if (!self) return; -@@ -2480,35 +2495,47 @@ void PrintRenderFrameHelper::IPCProcessed() { +@@ -2478,35 +2492,47 @@ void PrintRenderFrameHelper::IPCProcessed() { } } @@ -868,7 +877,7 @@ index bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0 return false; } -@@ -2613,7 +2640,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser( +@@ -2611,7 +2637,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser( std::move(params), base::BindOnce( [](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output, @@ -878,7 +887,7 @@ index bc7a6f8d4fb1778af3b56f2c336e8941567ad4a7..d7811ae12c6828ecbe28824a46c139e0 std::move(quit_closure).Run(); }, diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h -index 54241ff910b7198761fd76a21e4fe4bd42cc7ce2..51735091523fdd208b2c799a1c7910fdcc703e44 100644 +index 731b0fa4c0e1b3a5b4ce73d5bf2322767c70f9be..58921e7fdb9c33e21694186f436f409f74c81c3a 100644 --- a/components/printing/renderer/print_render_frame_helper.h +++ b/components/printing/renderer/print_render_frame_helper.h @@ -247,7 +247,7 @@ class PrintRenderFrameHelper @@ -919,7 +928,7 @@ index 54241ff910b7198761fd76a21e4fe4bd42cc7ce2..51735091523fdd208b2c799a1c7910fd #if BUILDFLAG(ENABLE_PRINT_PREVIEW) // Set options for print preset from source PDF document. diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 904c0ef40a0fa23e0f3b7d0023e6418500ce45e9..88eca71122353752154a29e4f54693c3ac13f930 100644 +index 7ed78907d28c0b79914eae27dac3b3b5184f1540..224a6884ef5070efe1a51fdf1c24662388288432 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -2916,8 +2916,9 @@ source_set("browser") { @@ -971,12 +980,12 @@ index 2fb3aef0797f204f08c20e48987cd8c2703185de..75a70e331f8b539027748dad3252912c bool skip_system_calls() const { #if BUILDFLAG(ENABLE_OOP_PRINTING) diff --git a/sandbox/policy/mac/sandbox_mac.mm b/sandbox/policy/mac/sandbox_mac.mm -index cc0e9b58d2686c45f8471eccdde7d9c5b03b4cae..d0ad07b3205aa7e9dcb8cc6217426a1bde22a15f 100644 +index 10096f5a3824c71e6cb13b86ef7bdd02488f76c8..f7de11c89efed78f0280ada29f55f3bbd119ee88 100644 --- a/sandbox/policy/mac/sandbox_mac.mm +++ b/sandbox/policy/mac/sandbox_mac.mm -@@ -41,6 +41,10 @@ - #error "This file requires ARC support." - #endif +@@ -37,6 +37,10 @@ + #include "sandbox/policy/mac/utility.sb.h" + #include "sandbox/policy/mojom/sandbox.mojom.h" +#if BUILDFLAG(ENABLE_PRINTING) +#include "sandbox/policy/mac/print_backend.sb.h" 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 11c0d670cce78..3ac785f7dfcee 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 fe010b1f001130fbdeaf4ef9ce7798e4baf958b5..28f1305f439be7f669e482ac0e4804c0 // 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 7a84a4e6c65eb5b9373b0667166188d93948ad68..e621a92c42c5cd2d818bcbc99d9b3e7add9e30eb 100644 +index 3e0ed454b09a3d23570479a390e3dff92cbf83bc..b637d621504667c89d13e1943e28c8a6c77f95fc 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -2113,6 +2113,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) { @@ -44,10 +44,10 @@ index 7a84a4e6c65eb5b9373b0667166188d93948ad68..e621a92c42c5cd2d818bcbc99d9b3e7a void RenderWidgetHostImpl::ShowContextMenuAtPoint( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index f362dc586802e47f45558b0cc068e2bf44cb796e..d95743b1ab3461f69326ca904448636de88ea070 100644 +index 94d7caadca3d07fe2886715bc9b5eac6a7dfbd46..b01b8386fd519c239a3525cae9cbda58ea99a176 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4902,6 +4902,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { +@@ -4911,6 +4911,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { return text_input_manager_.get(); } @@ -60,7 +60,7 @@ index f362dc586802e47f45558b0cc068e2bf44cb796e..d95743b1ab3461f69326ca904448636d 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 7893e253691ef0e51b1ba619c4579cb0e39e2ff1..0be4c605413b9a7a27deafc9c13d1e45885e92fe 100644 +index 0bdd28ec245e984c83bde8114c545d69294fbfce..4a82e5536bed5b49dce416221e749acd1550a47c 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -994,6 +994,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, diff --git a/patches/chromium/render_widget_host_view_base.patch b/patches/chromium/render_widget_host_view_base.patch index e53fb1ecd37bd..cdbb026233d4f 100644 --- a/patches/chromium/render_widget_host_view_base.patch +++ b/patches/chromium/render_widget_host_view_base.patch @@ -6,10 +6,10 @@ 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 74ec46063f18be47e9cc5ed35194e51dcc733ae8..923e1bfcb9a0f19aae8dc7d763b2472f34301417 100644 +index c099a8701b7e0451207c21e6ebbe26eac65f0164..8a61b858c0c8a3fdd8522821a14fe369cea2d2fc 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc -@@ -683,6 +683,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( +@@ -690,6 +690,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( return false; } @@ -24,7 +24,7 @@ index 74ec46063f18be47e9cc5ed35194e51dcc733ae8..923e1bfcb9a0f19aae8dc7d763b2472f const blink::WebMouseEvent& event, const ui::LatencyInfo& latency) { diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h -index 6c1196ed1af86525e899fc0dfb7606a1e8666ccf..d0c9b6d927dc73bf8579ecebe2160f5d9119ced5 100644 +index eed8db485e54bb906f3d640f9c6ebd9a58b04c09..f0747ab5597ca286ab29bdd6518784634d740708 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -25,8 +25,11 @@ @@ -60,7 +60,7 @@ index 6c1196ed1af86525e899fc0dfb7606a1e8666ccf..d0c9b6d927dc73bf8579ecebe2160f5d class WebContentsAccessibility; class DelegatedFrameHost; -@@ -142,6 +147,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -157,6 +162,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { const gfx::Rect& keyboard_rect) override {} bool IsHTMLFormPopup() const override; @@ -70,7 +70,7 @@ index 6c1196ed1af86525e899fc0dfb7606a1e8666ccf..d0c9b6d927dc73bf8579ecebe2160f5d // This only needs to be overridden by RenderWidgetHostViewBase subclasses // that handle content embedded within other RenderWidgetHostViews. gfx::PointF TransformPointToRootCoordSpaceF( -@@ -310,6 +318,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -325,6 +333,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { virtual void ProcessGestureEvent(const blink::WebGestureEvent& event, const ui::LatencyInfo& latency); diff --git a/patches/chromium/render_widget_host_view_mac.patch b/patches/chromium/render_widget_host_view_mac.patch index 38902de68ad33..745ae808d105d 100644 --- a/patches/chromium/render_widget_host_view_mac.patch +++ b/patches/chromium/render_widget_host_view_mac.patch @@ -10,10 +10,10 @@ kinds of utility windows. Similarly for `disableAutoHideCursor`. Additionally, disables usage of some private APIs in MAS builds. diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -index df227a4f7a6717d4c60102f44b6457b1d619baa3..4472a474a7e5771698e53c9e89618352c58d8c0e 100644 +index 0bdd7c7813fdbbf148fe1fba2c38ef78d2923efc..c11453b8e3ce6345eead3b80c4f9036a1d07f5c7 100644 --- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -@@ -161,6 +161,15 @@ void ExtractUnderlines(NSAttributedString* string, +@@ -157,6 +157,15 @@ void ExtractUnderlines(NSAttributedString* string, } // namespace @@ -29,7 +29,7 @@ index df227a4f7a6717d4c60102f44b6457b1d619baa3..4472a474a7e5771698e53c9e89618352 // RenderWidgetHostViewCocoa --------------------------------------------------- // Private methods: -@@ -748,6 +757,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { +@@ -744,6 +753,9 @@ - (BOOL)acceptsMouseEventsWhenInactive { } - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent { @@ -39,7 +39,7 @@ index df227a4f7a6717d4c60102f44b6457b1d619baa3..4472a474a7e5771698e53c9e89618352 return [self acceptsMouseEventsWhenInactive]; } -@@ -824,6 +836,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent { +@@ -820,6 +832,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent { // its parent view. BOOL hitSelf = NO; while (view) { @@ -50,7 +50,7 @@ index df227a4f7a6717d4c60102f44b6457b1d619baa3..4472a474a7e5771698e53c9e89618352 if (view == self) hitSelf = YES; if ([view isKindOfClass:[self class]] && ![view isEqual:self] && -@@ -1143,6 +1159,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { +@@ -1139,6 +1155,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { eventType == NSEventTypeKeyDown && !(modifierFlags & NSEventModifierFlagCommand); @@ -61,7 +61,7 @@ index df227a4f7a6717d4c60102f44b6457b1d619baa3..4472a474a7e5771698e53c9e89618352 // We only handle key down events and just simply forward other events. if (eventType != NSEventTypeKeyDown) { _hostHelper->ForwardKeyboardEvent(event, latency_info); -@@ -1974,15 +1994,21 @@ - (NSAccessibilityRole)accessibilityRole { +@@ -1970,15 +1990,21 @@ - (NSAccessibilityRole)accessibilityRole { // Since this implementation doesn't have to wait any IPC calls, this doesn't // make any key-typing jank. --hbono 7/23/09 // diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index 18c4067644328..22cd93a5f8e85 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 7a6ac28c250f2c4947f7035a34dccf9b5d9f1918..f628a6f0d914c6d2bec3160c9e3ef714792aa3bc 100644 +index 1165a7e81de03921ab774006cfb06f928cb2632e..36142abc8d5322e2408b186560ff34b1b268b7b9 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1915,9 +1915,15 @@ bool RenderProcessHostImpl::Init() { @@ -42,7 +42,7 @@ index 7a6ac28c250f2c4947f7035a34dccf9b5d9f1918..f628a6f0d914c6d2bec3160c9e3ef714 auto file_data = std::make_unique(); diff --git a/content/browser/renderer_host/renderer_sandboxed_process_launcher_delegate.cc b/content/browser/renderer_host/renderer_sandboxed_process_launcher_delegate.cc -index 5d96b358a52b01af0cb853125782af6202ae77b7..32b8ed19e9f265dc8f371c4e9c07f71487eb36f6 100644 +index e5a087e3e26253901a84d509d8a4f1268a2569fe..7dab0443f8897553830f1f4cc98457839b354264 100644 --- a/content/browser/renderer_host/renderer_sandboxed_process_launcher_delegate.cc +++ b/content/browser/renderer_host/renderer_sandboxed_process_launcher_delegate.cc @@ -33,6 +33,9 @@ namespace content { diff --git a/patches/chromium/sysroot.patch b/patches/chromium/sysroot.patch deleted file mode 100644 index b46ad403a9386..0000000000000 --- a/patches/chromium/sysroot.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jeremy Apthorp -Date: Thu, 18 Oct 2018 17:03:57 -0700 -Subject: sysroot.patch - -Make chrome's install-sysroot scripts point to our custom sysroot builds, -which include extra deps that Electron needs (e.g. libnotify) - -diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py -index 67d52b47a7531453a1baa83b6863441ef1fadea7..da0b2142ca3fa9d4228e2592b8be9930ee1acdb3 100755 ---- a/build/linux/sysroot_scripts/install-sysroot.py -+++ b/build/linux/sysroot_scripts/install-sysroot.py -@@ -33,9 +33,11 @@ import sys - from urllib.request import urlopen - - SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) -+SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(SCRIPT_DIR))) -+SYSTOORS_CONFIG_DIR = os.path.join(SRC_DIR, 'electron', 'script') - --URL_PREFIX = 'https://commondatastorage.googleapis.com' --URL_PATH = 'chrome-linux-sysroot/toolchain' -+URL_PREFIX = 'https://dev-cdn.electronjs.org' -+URL_PATH = 'linux-sysroots' - - VALID_ARCHS = ('amd64', 'i386', 'armhf', 'arm64', 'armel', 'mipsel', 'mips64el') - -@@ -100,7 +102,7 @@ def GetSysrootDict(target_platform, target_arch): - if target_arch not in VALID_ARCHS: - raise Error('Unknown architecture: %s' % target_arch) - -- sysroots_file = os.path.join(SCRIPT_DIR, 'sysroots.json') -+ sysroots_file = os.path.join(SYSTOORS_CONFIG_DIR, 'sysroots.json') - sysroots = json.load(open(sysroots_file)) - sysroot_key = '%s_%s' % (target_platform, target_arch) - if sysroot_key not in sysroots: diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index ed51ce41098bc..4e94bb6b1d366 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 a32f963654763cc0c706f752eca96e8cf5d0be54..998357b01a55def3d9c1e37d09f52d61b5ecd6f2 100644 +index c7c515bf753a4a9851b1d68c206b9c7487f02578..3fef597d18025bd35b4f7af105c6907602958223 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3314,6 +3314,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3323,6 +3323,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 a32f963654763cc0c706f752eca96e8cf5d0be54..998357b01a55def3d9c1e37d09f52d61 std::unique_ptr delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -3324,6 +3331,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3333,6 +3340,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } diff --git a/patches/chromium/webview_cross_drag.patch b/patches/chromium/webview_cross_drag.patch index 0186c3be5bfde..264c9450d7782 100644 --- a/patches/chromium/webview_cross_drag.patch +++ b/patches/chromium/webview_cross_drag.patch @@ -24,10 +24,10 @@ index 8a6fd2e52b81f1f541d88c795fbc2697a58f0ea9..9d3efca9c19c9c97c636258017cc16c8 //////////////////////////////////////////////////////////////////////////////// diff --git a/content/browser/web_contents/web_drag_dest_mac.mm b/content/browser/web_contents/web_drag_dest_mac.mm -index a9c529375474c66c35ed509f77b20cd0f4464057..4a461468cea5e3ee210d0ab3916a6f493b428b93 100644 +index 808e3103cd12d32b54dc80dc122746923db83138..298ad238a2d26603b2af8f9143fa5881ba09184a 100644 --- a/content/browser/web_contents/web_drag_dest_mac.mm +++ b/content/browser/web_contents/web_drag_dest_mac.mm -@@ -426,9 +426,7 @@ - (void)resetDragStartTrackers { +@@ -422,9 +422,7 @@ - (void)resetDragStartTrackers { } - (bool)isValidDragTarget:(content::RenderWidgetHostImpl*)targetRWH { diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index 74aa6d4c203fe..d174734908333 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -14,10 +14,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 81b495cce7891a30c3ea1acc9160566d66acaef0..e4925235a152e15bb38a680b3ed428b65e289404 100644 +index 4da6272864fd6709dcb56b9561ec86f4b0e037be..03d913c1ab176dfb330ba3192daeaed3e212c131 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -7263,6 +7263,17 @@ void RenderFrameHostImpl::EnterFullscreen( +@@ -7286,6 +7286,17 @@ void RenderFrameHostImpl::EnterFullscreen( } } diff --git a/patches/v8/build_gn.patch b/patches/v8/build_gn.patch index f2e1612372d3e..0da610a433e60 100644 --- a/patches/v8/build_gn.patch +++ b/patches/v8/build_gn.patch @@ -9,10 +9,10 @@ necessary for native modules to load. Also change visibility on mksnapshot in order to target mksnapshot for mksnapshot zip. diff --git a/BUILD.gn b/BUILD.gn -index 72e11bf5ff1468545e2ae3f59ba06edca96678e2..5b9abb1eb2f61499f22c4502ffa2deb254931b97 100644 +index ca081a790959d22b12f10e9c08f9acbc339e7ed7..06465300718a74d089c2281f60bb63735657e3bd 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -743,7 +743,7 @@ config("internal_config") { +@@ -739,7 +739,7 @@ config("internal_config") { ":cppgc_header_features", ] @@ -21,7 +21,7 @@ index 72e11bf5ff1468545e2ae3f59ba06edca96678e2..5b9abb1eb2f61499f22c4502ffa2deb2 defines += [ "BUILDING_V8_SHARED" ] } -@@ -6706,7 +6706,7 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -6711,7 +6711,7 @@ if (current_toolchain == v8_generator_toolchain) { "src/interpreter/bytecodes.h", ] @@ -30,7 +30,7 @@ index 72e11bf5ff1468545e2ae3f59ba06edca96678e2..5b9abb1eb2f61499f22c4502ffa2deb2 deps = [ ":v8_libbase", -@@ -6718,7 +6718,6 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -6723,7 +6723,6 @@ if (current_toolchain == v8_generator_toolchain) { if (current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { diff --git a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch index 99c9723edde9d..70063fe419b85 100644 --- a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch +++ b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch @@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not contain any standard C++ library exports (e.g. `std::ostringstream`). diff --git a/BUILD.gn b/BUILD.gn -index 5b9abb1eb2f61499f22c4502ffa2deb254931b97..2de11af08a8f20c0b04a7f7454b10cb7141837e2 100644 +index 06465300718a74d089c2281f60bb63735657e3bd..d691bf98c074693c692f4a9ad58098bc1b163c24 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -743,6 +743,10 @@ config("internal_config") { +@@ -739,6 +739,10 @@ config("internal_config") { ":cppgc_header_features", ] diff --git a/script/gen-libc++-filenames.js b/script/gen-libc++-filenames.js index c6fbe3347a6de..86776338d802e 100644 --- a/script/gen-libc++-filenames.js +++ b/script/gen-libc++-filenames.js @@ -20,8 +20,8 @@ function findAllHeaders (basePath) { for (const folder of ['libc++', 'libc++abi']) { const prettyName = folder.replace(/\+/g, 'x'); - const libcxxIncludeDir = path.resolve(__dirname, '..', '..', 'buildtools', 'third_party', folder, 'trunk', 'include'); - const gclientPath = `buildtools/third_party/${folder}/trunk/include`; + const libcxxIncludeDir = path.resolve(__dirname, '..', '..', 'third_party', folder, 'src', 'include'); + const gclientPath = `third_party/${folder}/src/include`; const headers = findAllHeaders(libcxxIncludeDir).map(absPath => path.relative(path.resolve(__dirname, '../..', gclientPath), absPath)); @@ -29,7 +29,7 @@ for (const folder of ['libc++', 'libc++abi']) { ${headers.map(f => `"//${path.posix.join(gclientPath, f)}"`).join(',\n ')}, ] -${prettyName}_licenses = [ "//buildtools/third_party/${folder}/trunk/LICENSE.TXT" ] +${prettyName}_licenses = [ "//third_party/${folder}/src/LICENSE.TXT" ] `; const filenamesPath = path.resolve(__dirname, '..', `filenames.${prettyName}.gni`); diff --git a/script/nan-spec-runner.js b/script/nan-spec-runner.js index d8f8a644ed450..f56a17d6e2f54 100644 --- a/script/nan-spec-runner.js +++ b/script/nan-spec-runner.js @@ -57,11 +57,15 @@ async function main () { // file and pull cflags_cc from it instead of using bespoke code here? // I think it's unlikely to work; but if it does, it would be more futureproof const cxxflags = [ - '-std=c++17', + '-std=c++20', + '-Wno-trigraphs', + '-fno-exceptions', + '-fno-rtti', '-nostdinc++', - `-I"${path.resolve(BASE, 'buildtools', 'third_party', 'libc++')}"`, - `-isystem"${path.resolve(BASE, 'buildtools', 'third_party', 'libc++', 'trunk', 'include')}"`, - `-isystem"${path.resolve(BASE, 'buildtools', 'third_party', 'libc++abi', 'trunk', 'include')}"`, + `-isystem "${path.resolve(BASE, 'buildtools', 'third_party', 'libc++')}"`, + `-isystem "${path.resolve(BASE, 'third_party', 'libc++', 'src', 'include')}"`, + `-isystem "${path.resolve(BASE, 'third_party', 'libc++abi', 'src', 'include')}"`, + ' -fvisibility-inlines-hidden', '-fPIC', '-D_LIBCPP_ABI_NAMESPACE=Cr', ...platformFlags diff --git a/script/sysroots.json b/script/sysroots.json index 8fcb670728a41..e924fcb6e01ab 100644 --- a/script/sysroots.json +++ b/script/sysroots.json @@ -3,42 +3,49 @@ "Key": "20230329T085712Z-1", "Sha1Sum": "dcd5767244034c6f9b42b64a85423d6cb849fa1e", "SysrootDir": "debian_bullseye_amd64-sysroot", - "Tarball": "debian_bullseye_amd64_sysroot.tar.xz" + "Tarball": "debian_bullseye_amd64_sysroot.tar.xz", + "URL": "https://dev-cdn.electronjs.org/linux-sysroots" }, "bullseye_arm64": { "Key": "20230329T085712Z-1", "Sha1Sum": "3531a8b78fa72e7939f8082a56c9041e5bff423a", "SysrootDir": "debian_bullseye_arm64-sysroot", - "Tarball": "debian_bullseye_arm64_sysroot.tar.xz" + "Tarball": "debian_bullseye_arm64_sysroot.tar.xz", + "URL": "https://dev-cdn.electronjs.org/linux-sysroots" }, "bullseye_armel": { "Key": "20230329T085712Z-1", "Sha1Sum": "cf3a1348649eb26f40e358459c96afbb8e58017e", "SysrootDir": "debian_bullseye_armel-sysroot", - "Tarball": "debian_bullseye_armel_sysroot.tar.xz" + "Tarball": "debian_bullseye_armel_sysroot.tar.xz", + "URL": "https://dev-cdn.electronjs.org/linux-sysroots" }, "bullseye_armhf": { "Key": "20230329T085712Z-1", "Sha1Sum": "3fe59c416d0472dd4115fa3d42a29aa34191c0bf", "SysrootDir": "debian_bullseye_armhf-sysroot", - "Tarball": "debian_bullseye_armhf_sysroot.tar.xz" + "Tarball": "debian_bullseye_armhf_sysroot.tar.xz", + "URL": "https://dev-cdn.electronjs.org/linux-sysroots" }, "bullseye_i386": { "Key": "20230329T085712Z-1", "Sha1Sum": "9b158682e7c111748e16914977546120429c9287", "SysrootDir": "debian_bullseye_i386-sysroot", - "Tarball": "debian_bullseye_i386_sysroot.tar.xz" + "Tarball": "debian_bullseye_i386_sysroot.tar.xz", + "URL": "https://dev-cdn.electronjs.org/linux-sysroots" }, "bullseye_mips64el": { "Key": "20230329T085712Z-1", "Sha1Sum": "c0d04d577608226d9fb0649b455800493fba2cde", "SysrootDir": "debian_bullseye_mips64el-sysroot", - "Tarball": "debian_bullseye_mips64el_sysroot.tar.xz" + "Tarball": "debian_bullseye_mips64el_sysroot.tar.xz", + "URL": "https://dev-cdn.electronjs.org/linux-sysroots" }, "bullseye_mipsel": { "Key": "20230329T085712Z-1", "Sha1Sum": "65f095e4edf23f0e789b22290dde9eb455aa54a0", "SysrootDir": "debian_bullseye_mipsel-sysroot", - "Tarball": "debian_bullseye_mipsel_sysroot.tar.xz" + "Tarball": "debian_bullseye_mipsel_sysroot.tar.xz", + "URL": "https://dev-cdn.electronjs.org/linux-sysroots" } } \ No newline at end of file diff --git a/shell/app/electron_main_delegate_mac.mm b/shell/app/electron_main_delegate_mac.mm index 857a01f66abc9..15d74b32797db 100644 --- a/shell/app/electron_main_delegate_mac.mm +++ b/shell/app/electron_main_delegate_mac.mm @@ -69,7 +69,9 @@ helper_path = GetHelperAppPath(frameworks_path, GetApplicationName()); if (!base::PathExists(helper_path)) LOG(FATAL) << "Unable to find helper app"; - base::PathService::Override(content::CHILD_PROCESS_EXE, helper_path); + base::PathService::OverrideAndCreateIfNeeded( + content::CHILD_PROCESS_EXE, helper_path, /*is_absolute=*/true, + /*create=*/false); } void ElectronMainDelegate::SetUpBundleOverrides() { diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index e4253d2466495..993861fe5813a 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -3075,6 +3075,8 @@ v8::Local WebContents::PrintToPDF(const base::Value& settings) { auto header_template = *settings.GetDict().FindString("headerTemplate"); auto footer_template = *settings.GetDict().FindString("footerTemplate"); auto prefer_css_page_size = settings.GetDict().FindBool("preferCSSPageSize"); + auto generate_tagged_pdf = + settings.GetDict().FindBool("shouldGenerateTaggedPDF"); absl::variant print_pages_params = print_to_pdf::GetPrintPagesParams( @@ -3082,7 +3084,8 @@ v8::Local WebContents::PrintToPDF(const base::Value& settings) { landscape, display_header_footer, print_background, scale, paper_width, paper_height, margin_top, margin_bottom, margin_left, margin_right, absl::make_optional(header_template), - absl::make_optional(footer_template), prefer_css_page_size); + absl::make_optional(footer_template), prefer_css_page_size, + generate_tagged_pdf); if (absl::holds_alternative(print_pages_params)) { auto error = absl::get(print_pages_params); diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc index b11b7c02ce0c7..6995be4069bbb 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -95,7 +95,6 @@ #if BUILDFLAG(IS_WIN) #include "ui/base/l10n/l10n_util_win.h" -#include "ui/display/win/dpi.h" #include "ui/gfx/system_fonts_win.h" #include "ui/strings/grit/app_locale_settings.h" #endif @@ -149,13 +148,6 @@ void Erase(T* container, typename T::iterator iter) { } #if BUILDFLAG(IS_WIN) -// gfx::Font callbacks -void AdjustUIFont(gfx::win::FontAdjustment* font_adjustment) { - l10n_util::NeedOverrideDefaultUIFont(&font_adjustment->font_family_override, - &font_adjustment->font_scale); - font_adjustment->font_scale *= display::win::GetAccessibilityFontScale(); -} - int GetMinimumFontSize() { int min_font_size; base::StringToInt(l10n_util::GetStringUTF16(IDS_MINIMUM_UI_FONT_SIZE), @@ -464,7 +456,7 @@ void ElectronBrowserMainParts::ToolkitInitialized() { #endif #if BUILDFLAG(IS_WIN) - gfx::win::SetAdjustFontCallback(&AdjustUIFont); + gfx::win::SetAdjustFontCallback(&l10n_util::AdjustUiFont); gfx::win::SetGetMinimumFontSizeCallback(&GetMinimumFontSize); #endif diff --git a/shell/browser/electron_permission_manager.cc b/shell/browser/electron_permission_manager.cc index ae664f81cc221..6fb6116963918 100644 --- a/shell/browser/electron_permission_manager.cc +++ b/shell/browser/electron_permission_manager.cc @@ -282,9 +282,10 @@ blink::mojom::PermissionStatus ElectronPermissionManager::GetPermissionStatus( content::PermissionResult ElectronPermissionManager::GetPermissionResultForOriginWithoutContext( blink::PermissionType permission, - const url::Origin& origin) { - blink::mojom::PermissionStatus status = - GetPermissionStatus(permission, origin.GetURL(), origin.GetURL()); + const url::Origin& requesting_origin, + const url::Origin& embedding_origin) { + blink::mojom::PermissionStatus status = GetPermissionStatus( + permission, requesting_origin.GetURL(), embedding_origin.GetURL()); return content::PermissionResult( status, content::PermissionStatusSource::UNSPECIFIED); } diff --git a/shell/browser/electron_permission_manager.h b/shell/browser/electron_permission_manager.h index fd7b1460226a8..57ab21fc9fb17 100644 --- a/shell/browser/electron_permission_manager.h +++ b/shell/browser/electron_permission_manager.h @@ -141,7 +141,8 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate { override; content::PermissionResult GetPermissionResultForOriginWithoutContext( blink::PermissionType permission, - const url::Origin& origin) override; + const url::Origin& requesting_origin, + const url::Origin& embedding_origin) override; blink::mojom::PermissionStatus GetPermissionStatusForCurrentDocument( blink::PermissionType permission, content::RenderFrameHost* render_frame_host) override; diff --git a/shell/browser/osr/osr_render_widget_host_view.cc b/shell/browser/osr/osr_render_widget_host_view.cc index 75340ac8cf519..06a36eb14d0e2 100644 --- a/shell/browser/osr/osr_render_widget_host_view.cc +++ b/shell/browser/osr/osr_render_widget_host_view.cc @@ -520,7 +520,8 @@ OffScreenRenderWidgetHostView::CreateSyntheticGestureTarget() { void OffScreenRenderWidgetHostView::ImeCompositionRangeChanged( const gfx::Range&, - const std::vector&) {} + const absl::optional>& character_bounds, + const absl::optional>& line_bounds) {} gfx::Size OffScreenRenderWidgetHostView::GetCompositorViewportPixelSize() { return gfx::ScaleToCeiledSize(GetRequestedRendererSize(), diff --git a/shell/browser/osr/osr_render_widget_host_view.h b/shell/browser/osr/osr_render_widget_host_view.h index 414b6d463be6f..122779eb68953 100644 --- a/shell/browser/osr/osr_render_widget_host_view.h +++ b/shell/browser/osr/osr_render_widget_host_view.h @@ -150,8 +150,10 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase, viz::SurfaceId GetCurrentSurfaceId() const override; std::unique_ptr CreateSyntheticGestureTarget() override; - void ImeCompositionRangeChanged(const gfx::Range&, - const std::vector&) override; + void ImeCompositionRangeChanged( + const gfx::Range&, + const absl::optional>& character_bounds, + const absl::optional>& line_bounds) override; gfx::Size GetCompositorViewportPixelSize() override; ui::Compositor* GetCompositor() override; diff --git a/shell/browser/ui/devtools_manager_delegate.cc b/shell/browser/ui/devtools_manager_delegate.cc index 6722ec64834cf..c4113d37e38de 100644 --- a/shell/browser/ui/devtools_manager_delegate.cc +++ b/shell/browser/ui/devtools_manager_delegate.cc @@ -125,7 +125,8 @@ void DevToolsManagerDelegate::HandleCommand( } scoped_refptr -DevToolsManagerDelegate::CreateNewTarget(const GURL& url, bool for_tab) { +DevToolsManagerDelegate::CreateNewTarget(const GURL& url, + TargetType target_type) { return nullptr; } diff --git a/shell/browser/ui/devtools_manager_delegate.h b/shell/browser/ui/devtools_manager_delegate.h index 325df5cbbecde..1cfa232d35fbc 100644 --- a/shell/browser/ui/devtools_manager_delegate.h +++ b/shell/browser/ui/devtools_manager_delegate.h @@ -30,7 +30,7 @@ class DevToolsManagerDelegate : public content::DevToolsManagerDelegate { NotHandledCallback callback) override; scoped_refptr CreateNewTarget( const GURL& url, - bool for_tab) override; + TargetType target_type) override; std::string GetDiscoveryPageHTML() override; bool HasBundledFrontendResources() override; }; diff --git a/shell/browser/usb/electron_usb_delegate.cc b/shell/browser/usb/electron_usb_delegate.cc index 1f602b8641252..51711119fdca2 100644 --- a/shell/browser/usb/electron_usb_delegate.cc +++ b/shell/browser/usb/electron_usb_delegate.cc @@ -25,6 +25,7 @@ #include "base/containers/fixed_flat_set.h" #include "chrome/common/chrome_features.h" #include "extensions/browser/extension_registry.h" +#include "extensions/browser/guest_view/web_view/web_view_guest.h" #include "extensions/common/constants.h" #include "extensions/common/extension.h" #include "services/device/public/mojom/usb_device.mojom.h" @@ -286,4 +287,33 @@ void ElectronUsbDelegate::DeleteControllerForFrame( controller_map_.erase(render_frame_host); } +bool ElectronUsbDelegate::PageMayUseUsb(content::Page& page) { + content::RenderFrameHost& main_rfh = page.GetMainDocument(); +#if BUILDFLAG(ENABLE_EXTENSIONS) + // WebViewGuests have no mechanism to show permission prompts and their + // embedder can't grant USB access through its permissionrequest API. Also + // since webviews use a separate StoragePartition, they must not gain access + // through permissions granted in non-webview contexts. + if (extensions::WebViewGuest::FromRenderFrameHost(&main_rfh)) { + return false; + } +#endif // BUILDFLAG(ENABLE_EXTENSIONS) + + // USB permissions are scoped to a BrowserContext instead of a + // StoragePartition, so we need to be careful about usage across + // StoragePartitions. Until this is scoped correctly, we'll try to avoid + // inappropriate sharing by restricting access to the API. We can't be as + // strict as we'd like, as cases like extensions and Isolated Web Apps still + // need USB access in non-default partitions, so we'll just guard against + // HTTP(S) as that presents a clear risk for inappropriate sharing. + // TODO(crbug.com/1469672): USB permissions should be explicitly scoped to + // StoragePartitions. + if (main_rfh.GetStoragePartition() != + main_rfh.GetBrowserContext()->GetDefaultStoragePartition()) { + return !main_rfh.GetLastCommittedURL().SchemeIsHTTPOrHTTPS(); + } + + return true; +} + } // namespace electron diff --git a/shell/browser/usb/electron_usb_delegate.h b/shell/browser/usb/electron_usb_delegate.h index 258f67f2c8bde..b15ce5fa1f474 100644 --- a/shell/browser/usb/electron_usb_delegate.h +++ b/shell/browser/usb/electron_usb_delegate.h @@ -85,6 +85,8 @@ class ElectronUsbDelegate : public content::UsbDelegate { void DeleteControllerForFrame(content::RenderFrameHost* render_frame_host); + bool PageMayUseUsb(content::Page& page) override; + private: UsbChooserController* ControllerForFrame( content::RenderFrameHost* render_frame_host); diff --git a/shell/common/gin_converters/gfx_converter.cc b/shell/common/gin_converters/gfx_converter.cc index 4fc3294323f78..a52d90bb8b00d 100644 --- a/shell/common/gin_converters/gfx_converter.cc +++ b/shell/common/gin_converters/gfx_converter.cc @@ -150,7 +150,7 @@ v8::Local Converter::ToV8( dict.Set("accelerometerSupport", val.accelerometer_support()); dict.Set("monochrome", val.is_monochrome()); dict.Set("colorDepth", val.color_depth()); - dict.Set("colorSpace", val.color_spaces().GetRasterColorSpace().ToString()); + dict.Set("colorSpace", val.GetColorSpaces().GetRasterColorSpace().ToString()); dict.Set("depthPerComponent", val.depth_per_component()); dict.Set("size", val.size()); dict.Set("displayFrequency", val.display_frequency()); From 3c1f1937b4f6dc45a8d4fd9c45eefa75403fe7e3 Mon Sep 17 00:00:00 2001 From: Michaela Laurencin <35157522+mlaurencin@users.noreply.github.com> Date: Tue, 15 Aug 2023 10:57:48 -0700 Subject: [PATCH 66/93] docs: update timelines for E27 (#39493) --- docs/tutorial/electron-timelines.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/tutorial/electron-timelines.md b/docs/tutorial/electron-timelines.md index bc6421c917303..bcabbfc98466f 100644 --- a/docs/tutorial/electron-timelines.md +++ b/docs/tutorial/electron-timelines.md @@ -9,10 +9,11 @@ check out our [Electron Versioning](./electron-versioning.md) doc. | Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported | | ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- | -| 26.0.0 | 2023-Jun-01 | 2023-Jun-27 | 2023-Aug-15 | TBD | M116 | TBD | ✅ | +| 27.0.0 | 2023-Aug-17 | 2023-Sep-13 | 2023-Oct-10 | TBD | M118 | TBD | ✅ | +| 26.0.0 | 2023-Jun-01 | 2023-Jun-27 | 2023-Aug-15 | 2024-Feb-27 | M116 | v18.16 | ✅ | | 25.0.0 | 2023-Apr-10 | 2023-May-02 | 2023-May-30 | 2024-Jan-02 | M114 | v18.15 | ✅ | | 24.0.0 | 2022-Feb-09 | 2023-Mar-07 | 2023-Apr-04 | 2023-Oct-10 | M112 | v18.14 | ✅ | -| 23.0.0 | 2022-Dec-01 | 2023-Jan-10 | 2023-Feb-07 | 2023-Aug-15 | M110 | v18.12 | ✅ | +| 23.0.0 | 2022-Dec-01 | 2023-Jan-10 | 2023-Feb-07 | 2023-Aug-15 | M110 | v18.12 | 🚫 | | 22.0.0 | 2022-Sep-29 | 2022-Oct-25 | 2022-Nov-29 | 2023-Oct-10 | M108 | v16.17 | ✅ | | 21.0.0 | 2022-Aug-04 | 2022-Aug-30 | 2022-Sep-27 | 2023-Apr-04 | M106 | v16.16 | 🚫 | | 20.0.0 | 2022-May-26 | 2022-Jun-21 | 2022-Aug-02 | 2023-Feb-07 | M104 | v16.15 | 🚫 | From e1cda8d7ba98dc71820ab9c3912286b56254a94e Mon Sep 17 00:00:00 2001 From: David Sanders Date: Tue, 15 Aug 2023 11:41:29 -0700 Subject: [PATCH 67/93] ci: fix @electron/github-app-auth CLI usage (#39507) --- .github/workflows/branch-created.yml | 2 +- .github/workflows/issue-labeled.yml | 2 +- .github/workflows/issue-unlabeled.yml | 2 +- .github/workflows/pull-request-labeled.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/branch-created.yml b/.github/workflows/branch-created.yml index ff72b8123f10a..08c37b813955f 100644 --- a/.github/workflows/branch-created.yml +++ b/.github/workflows/branch-created.yml @@ -64,7 +64,7 @@ jobs: env: RELEASE_BOARD_GH_APP_CREDS: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }} run: | - TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org electron) + TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org=electron) echo "TOKEN=$TOKEN" >> "$GITHUB_OUTPUT" - name: Create Release Project Board if: ${{ steps.check-major-version.outputs.MAJOR }} diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 3cf7e33783a73..bed340c28db89 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -19,7 +19,7 @@ jobs: RELEASE_BOARD_GH_APP_CREDS: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }} run: | set -eo pipefail - TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org electron) + TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org=electron) echo "TOKEN=$TOKEN" >> "$GITHUB_OUTPUT" - name: Set status if: ${{ steps.generate-token.outputs.TOKEN }} diff --git a/.github/workflows/issue-unlabeled.yml b/.github/workflows/issue-unlabeled.yml index 41d4658470a1d..08c3e421fc9b7 100644 --- a/.github/workflows/issue-unlabeled.yml +++ b/.github/workflows/issue-unlabeled.yml @@ -28,7 +28,7 @@ jobs: RELEASE_BOARD_GH_APP_CREDS: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }} run: | set -eo pipefail - TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org electron) + TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org=electron) echo "TOKEN=$TOKEN" >> "$GITHUB_OUTPUT" - name: Set status if: ${{ steps.generate-token.outputs.TOKEN }} diff --git a/.github/workflows/pull-request-labeled.yml b/.github/workflows/pull-request-labeled.yml index a60279b5c372f..d15c75fbc11f1 100644 --- a/.github/workflows/pull-request-labeled.yml +++ b/.github/workflows/pull-request-labeled.yml @@ -19,7 +19,7 @@ jobs: RELEASE_BOARD_GH_APP_CREDS: ${{ secrets.RELEASE_BOARD_GH_APP_CREDS }} run: | set -eo pipefail - TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org electron) + TOKEN=$(npx @electron/github-app-auth --creds=$RELEASE_BOARD_GH_APP_CREDS --org=electron) echo "TOKEN=$TOKEN" >> "$GITHUB_OUTPUT" - name: Set status if: ${{ steps.generate-token.outputs.TOKEN }} From aeac6d4dd5e33f6308f7e58c7ae0b93845210241 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 15 Aug 2023 20:49:21 +0200 Subject: [PATCH 68/93] refactor: clean up Node.js cli arg parsing (#39465) * refactor: clean up Node.js arg parsing * chore: feedback from review --- docs/api/command-line-switches.md | 12 +++++-- shell/app/node_main.cc | 54 ++++++++++--------------------- shell/common/node_bindings.cc | 23 +++---------- shell/common/node_bindings.h | 2 +- 4 files changed, 32 insertions(+), 59 deletions(-) diff --git a/docs/api/command-line-switches.md b/docs/api/command-line-switches.md index fd63da4f1cbe6..8237cf53f20fe 100644 --- a/docs/api/command-line-switches.md +++ b/docs/api/command-line-switches.md @@ -116,14 +116,20 @@ Ignore the connections limit for `domains` list separated by `,`. ### --js-flags=`flags` -Specifies the flags passed to the Node.js engine. It has to be passed when starting -Electron if you want to enable the `flags` in the main process. +Specifies the flags passed to the [V8 engine](https://v8.dev). In order to enable the `flags` in the main process, +this switch must be passed on startup. ```sh $ electron --js-flags="--harmony_proxies --harmony_collections" your-app ``` -See the [Node.js documentation][node-cli] or run `node --help` in your terminal for a list of available flags. Additionally, run `node --v8-options` to see a list of flags that specifically refer to Node.js's V8 JavaScript engine. +Run `node --v8-options` or `electron --js-flags="--help"` in your terminal for the list of available flags. These can be used to enable early-stage JavaScript features, or log and manipulate garbage collection, among other things. + +For example, to trace V8 optimization and deoptimization: + +```sh +$ electron --js-flags="--trace-opt --trace-deopt" your-app +``` ### --lang diff --git a/shell/app/node_main.cc b/shell/app/node_main.cc index 8d06bef9a7228..79483e2fae6db 100644 --- a/shell/app/node_main.cc +++ b/shell/app/node_main.cc @@ -50,10 +50,10 @@ namespace { -// Initialize Node.js cli options to pass to Node.js +// Preparse Node.js cli options to pass to Node.js // See https://nodejs.org/api/cli.html#cli_options -int SetNodeCliFlags() { - // Options that are unilaterally disallowed +void ExitIfContainsDisallowedFlags(const std::vector& argv) { + // Options that are unilaterally disallowed. static constexpr auto disallowed = base::MakeFixedFlatSet({ "--enable-fips", "--force-fips", @@ -62,40 +62,18 @@ int SetNodeCliFlags() { "--use-openssl-ca", }); - const auto argv = base::CommandLine::ForCurrentProcess()->argv(); - std::vector args; - - // TODO(codebytere): We need to set the first entry in args to the - // process name owing to src/node_options-inl.h#L286-L290 but this is - // redundant and so should be refactored upstream. - args.reserve(argv.size() + 1); - args.emplace_back("electron"); - for (const auto& arg : argv) { -#if BUILDFLAG(IS_WIN) - const auto& option = base::WideToUTF8(arg); -#else - const auto& option = arg; -#endif - const auto stripped = base::StringPiece(option).substr(0, option.find('=')); - if (disallowed.contains(stripped)) { - LOG(ERROR) << "The Node.js cli flag " << stripped + const auto key = base::StringPiece(arg).substr(0, arg.find('=')); + if (disallowed.contains(key)) { + LOG(ERROR) << "The Node.js cli flag " << key << " is not supported in Electron"; // Node.js returns 9 from ProcessGlobalArgs for any errors encountered // when setting up cli flags and env vars. Since we're outlawing these - // flags (making them errors) return 9 here for consistency. - return 9; - } else { - args.push_back(option); + // flags (making them errors) exit with the same error code for + // consistency. + exit(9); } } - - std::vector errors; - - // Node.js itself will output parsing errors to - // console so we don't need to handle that ourselves - return ProcessGlobalArgs(&args, nullptr, &errors, - node::kDisallowedInEnvironment); } #if IS_MAS_BUILD() @@ -116,7 +94,11 @@ v8::Local GetParameters(v8::Isolate* isolate) { } int NodeMain(int argc, char* argv[]) { - base::CommandLine::Init(argc, argv); + bool initialized = base::CommandLine::Init(argc, argv); + if (!initialized) { + LOG(ERROR) << "Failed to initialize CommandLine"; + exit(1); + } #if BUILDFLAG(IS_WIN) v8_crashpad_support::SetUp(); @@ -153,15 +135,13 @@ int NodeMain(int argc, char* argv[]) { // Explicitly register electron's builtin bindings. NodeBindings::RegisterBuiltinBindings(); - // Parse and set Node.js cli flags. - int flags_exit_code = SetNodeCliFlags(); - if (flags_exit_code != 0) - exit(flags_exit_code); - // Hack around with the argv pointer. Used for process.title = "blah". argv = uv_setup_args(argc, argv); + // Parse Node.js cli flags and strip out disallowed options. std::vector args(argv, argv + argc); + ExitIfContainsDisallowedFlags(args); + std::unique_ptr result = node::InitializeOncePerProcess( args, diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 766d043059997..815dbb7d28c08 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -386,7 +386,7 @@ bool NodeBindings::IsInitialized() { // Initialize Node.js cli options to pass to Node.js // See https://nodejs.org/api/cli.html#cli_options -void NodeBindings::SetNodeCliFlags() { +std::vector NodeBindings::ParseNodeCliFlags() { const auto argv = base::CommandLine::ForCurrentProcess()->argv(); std::vector args; @@ -403,9 +403,7 @@ void NodeBindings::SetNodeCliFlags() { const auto& option = arg; #endif const auto stripped = base::StringPiece(option).substr(0, option.find('=')); - - // Only allow in no-op (--) option or a small set of debug - // and trace related options. + // Only allow no-op or a small set of debug/trace related options. if (IsAllowedOption(stripped) || stripped == "--") args.push_back(option); } @@ -417,16 +415,7 @@ void NodeBindings::SetNodeCliFlags() { args.push_back("--no-experimental-fetch"); } - std::vector errors; - const int exit_code = ProcessGlobalArgs(&args, nullptr, &errors, - node::kDisallowedInEnvironment); - - const std::string err_str = "Error parsing Node.js cli flags "; - if (exit_code != 0) { - LOG(ERROR) << err_str; - } else if (!errors.empty()) { - LOG(ERROR) << err_str << base::JoinString(errors, " "); - } + return args; } void NodeBindings::Initialize(v8::Local context) { @@ -442,13 +431,11 @@ void NodeBindings::Initialize(v8::Local context) { // Explicitly register electron's builtin bindings. RegisterBuiltinBindings(); - // Parse and set Node.js cli flags. - SetNodeCliFlags(); - auto env = base::Environment::Create(); SetNodeOptions(env.get()); - std::vector argv = {"electron"}; + // Parse and set Node.js cli flags. + std::vector argv = ParseNodeCliFlags(); std::vector exec_argv; std::vector errors; uint64_t process_flags = node::ProcessFlags::kNoFlags; diff --git a/shell/common/node_bindings.h b/shell/common/node_bindings.h index cb0dd998c9354..9182f5440b2aa 100644 --- a/shell/common/node_bindings.h +++ b/shell/common/node_bindings.h @@ -92,7 +92,7 @@ class NodeBindings { // Setup V8, libuv. void Initialize(v8::Local context); - void SetNodeCliFlags(); + std::vector ParseNodeCliFlags(); // Create the environment and load node.js. node::Environment* CreateEnvironment(v8::Handle context, From a630faaff546baae260abbbf8a672e7655216098 Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Tue, 15 Aug 2023 15:44:24 -0400 Subject: [PATCH 69/93] chore: bump chromium to 118.0.5949.0 (main) (#39505) * chore: bump chromium in DEPS to 118.0.5949.0 * chore: update mas_disable_remote_accessibility.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4705386 no manual code changes; existing patch applied with fuzz * chore: update printing.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4779059 no manual code changes; existing patch applied with fuzz * chore: add OffScreenRenderWidgetHostView::InvalidateLocalSurfaceIdAndAllocationGroup() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4563504 Add an impl for a new pure virtual method that was added upstream. Local impl inspired by upstream implementations in same CL * chore: update patches --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> --- DEPS | 2 +- ..._scheduler_throttling_per_renderview.patch | 6 +- ...leges_in_unsandboxed_child_processes.patch | 4 +- .../build_add_electron_tracing_category.patch | 2 +- ..._depend_on_packed_resource_integrity.patch | 18 +-- ...ld_config_in_the_required_components.patch | 12 +- patches/chromium/can_create_window.patch | 18 +-- ...d_buildflag_guard_around_new_include.patch | 2 +- ...tition_attribute_dcheck_for_webviews.patch | 2 +- ...screationoverridden_with_full_params.patch | 12 +- .../disable_color_correct_rendering.patch | 6 +- .../disable_compositor_recycling.patch | 4 +- patches/chromium/disable_hidden.patch | 6 +- ...dd_set_theme_source_to_allow_apps_to.patch | 12 +- ...e_launch_options_for_service_process.patch | 8 +- ...uest_webcontents_to_enter_fullscreen.patch | 4 +- ...ding_non-standard_schemes_in_iframes.patch | 6 +- .../chromium/fix_export_zlib_symbols.patch | 2 +- ...board_hides_on_input_blur_in_webview.patch | 12 +- ...t_menu_item_when_opened_via_keyboard.patch | 2 +- patches/chromium/frame_host_manager.patch | 6 +- .../chromium/gritsettings_resource_ids.patch | 4 +- .../mas-cgdisplayusesforcetogray.patch | 2 +- .../mas_disable_custom_window_frame.patch | 14 +-- .../mas_disable_remote_accessibility.patch | 24 ++-- .../chromium/notification_provenance.patch | 2 +- ...utofill_colors_to_the_color_pipeline.patch | 12 +- patches/chromium/printing.patch | 105 +++++++++--------- ...r_changes_to_the_webcontentsobserver.patch | 10 +- .../render_widget_host_view_base.patch | 4 +- patches/chromium/resource_file_conflict.patch | 6 +- .../support_mixed_sandbox_with_zygote.patch | 2 +- patches/chromium/web_contents.patch | 6 +- patches/chromium/webview_fullscreen.patch | 4 +- .../worker_context_will_destroy.patch | 8 +- ...feat_add_hook_to_notify_script_ready.patch | 8 +- patches/v8/build_gn.patch | 8 +- ...export_private_v8_symbols_on_windows.patch | 4 +- .../osr/osr_render_widget_host_view.cc | 5 + .../browser/osr/osr_render_widget_host_view.h | 1 + 40 files changed, 190 insertions(+), 185 deletions(-) diff --git a/DEPS b/DEPS index cb72ae85b56c1..8e7e18bb4428a 100644 --- a/DEPS +++ b/DEPS @@ -2,7 +2,7 @@ gclient_gn_args_from = 'src' vars = { 'chromium_version': - '117.0.5938.0', + '118.0.5949.0', 'node_version': 'v18.17.1', 'nan_version': 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 7314233933b05..4b02144f5aae4 100644 --- a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch +++ b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch @@ -6,10 +6,10 @@ Subject: allow disabling blink scheduler throttling per RenderView This allows us to disable throttling for hidden windows. diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc -index 830307d5113f28027c8e99befb8eb47a19b37b7f..063d6a1af7d4cc516d9a5ece9fd178b5c5bd3df6 100644 +index df0c283413566e3a1bdfc8d12add7461eb65a8ee..14f3212aea671b07cf82067100e04f6840387ab3 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc -@@ -710,6 +710,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { +@@ -716,6 +716,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque); } @@ -34,7 +34,7 @@ index d44652650891eff7cd6111bc6d6454a009942cb6..16522609163ba6bc422fc30a8d145a25 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 8fa040071ba1e70890f7dcf8193e83e147679ed7..3cc38ccd2793b801f5debd3d2815c367ce036e6b 100644 +index 10ee30af7650f67d4c27af4df357f2316b992abc..d35b2058d9584143cc76480e6bdf17f13a6eaad9 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -565,8 +565,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) { diff --git a/patches/chromium/allow_new_privileges_in_unsandboxed_child_processes.patch b/patches/chromium/allow_new_privileges_in_unsandboxed_child_processes.patch index fa38a2b622d17..fc1d13954cb0f 100644 --- a/patches/chromium/allow_new_privileges_in_unsandboxed_child_processes.patch +++ b/patches/chromium/allow_new_privileges_in_unsandboxed_child_processes.patch @@ -6,10 +6,10 @@ Subject: allow new privileges in unsandboxed child processes This allows unsandboxed child process to launch setuid processes on Linux. diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc -index 31ccdd899b06f91ab73ab27380ad0712b23fd563..b8147fce70f90191f9d4a794f69f32b23eac0e08 100644 +index ff73345339ccaa9d5375184efb13185ed9f0a298..bd80ca431a5c50ac001d7607841c64e90f4fe4c3 100644 --- a/content/browser/child_process_launcher_helper_linux.cc +++ b/content/browser/child_process_launcher_helper_linux.cc -@@ -62,6 +62,15 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( +@@ -63,6 +63,15 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( options->fds_to_remap.emplace_back(sandbox_fd, GetSandboxFD()); } diff --git a/patches/chromium/build_add_electron_tracing_category.patch b/patches/chromium/build_add_electron_tracing_category.patch index a819a4fa7e388..a5fe6fa2e5628 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 1ddaeafd2779a40a56c11b2e0b22e057c578bd0a..0f52af2a437c548fd85b82b313cf2826f4dea590 100644 +index c175e896868e99391ee8382d37fa08e17afb6768..d80b28386150f089ca48534d680759bcf0859b09 100644 --- a/base/trace_event/builtin_categories.h +++ b/base/trace_event/builtin_categories.h @@ -80,6 +80,8 @@ 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 0bd9512136784..f63737d5233af 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,10 +11,10 @@ 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 7e99d7493ac1f9281668eb3283f7475769245021..3b11f490c77fb667e40c30e7d61e484df1e9972f 100644 +index 07a98cf6892e7e1a81f15ccfd349012784ecf2b0..7a624d697cfe3627cc8f026d005132f17df8d433 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -202,11 +202,16 @@ if (!is_android && !is_mac) { +@@ -199,11 +199,16 @@ if (!is_android && !is_mac) { "common/crash_keys.h", ] @@ -33,10 +33,10 @@ index 7e99d7493ac1f9281668eb3283f7475769245021..3b11f490c77fb667e40c30e7d61e484d "//base", "//build:branding_buildflags", diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index d2207552c449f0219c6b2da984491144d14817b5..5b4bca66693337249d82545b58e6e0f1024a013d 100644 +index 606f58f90759a270f35e0da9448dca1fc3c920ea..b45deb7d8d745ef08c0401a622c1b0beaa503a65 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -4678,7 +4678,7 @@ static_library("browser") { +@@ -4690,7 +4690,7 @@ static_library("browser") { # On Windows, the hashes are embedded in //chrome:chrome_initial rather # than here in :chrome_dll. @@ -46,10 +46,10 @@ index d2207552c449f0219c6b2da984491144d14817b5..5b4bca66693337249d82545b58e6e0f1 sources += [ "certificate_viewer_stub.cc" ] } diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index 840813730d52d1cf930cfbb3e322dc8f328836dc..9eee8efe4a43cacc70851f3427f471f0b59024ff 100644 +index 9b97632ddba8343e90cc3f38c9a69f82ce1147e9..865c47f4a449f2930a3174f959e933c94a033f40 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -6755,7 +6755,6 @@ test("unit_tests") { +@@ -6789,7 +6789,6 @@ test("unit_tests") { deps += [ "//chrome:other_version", @@ -57,7 +57,7 @@ index 840813730d52d1cf930cfbb3e322dc8f328836dc..9eee8efe4a43cacc70851f3427f471f0 "//chrome//services/util_win:unit_tests", "//chrome/app:chrome_dll_resources", "//chrome/app:win_unit_tests", -@@ -6781,6 +6780,10 @@ test("unit_tests") { +@@ -6815,6 +6814,10 @@ test("unit_tests") { "//ui/resources", ] @@ -68,7 +68,7 @@ index 840813730d52d1cf930cfbb3e322dc8f328836dc..9eee8efe4a43cacc70851f3427f471f0 ldflags = [ "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll", "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll", -@@ -7740,7 +7743,6 @@ test("unit_tests") { +@@ -7774,7 +7777,6 @@ test("unit_tests") { } deps += [ @@ -76,7 +76,7 @@ index 840813730d52d1cf930cfbb3e322dc8f328836dc..9eee8efe4a43cacc70851f3427f471f0 "//chrome/browser/apps:icon_standardizer", "//chrome/browser/apps/app_service", "//chrome/browser/apps/app_service:test_support", -@@ -7826,6 +7828,10 @@ test("unit_tests") { +@@ -7860,6 +7862,10 @@ test("unit_tests") { "//ui/webui/resources/js/browser_command:mojo_bindings", ] diff --git a/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch b/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch index eb06ac79054e2..0d31accdac89a 100644 --- a/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch +++ b/patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch @@ -6,10 +6,10 @@ Subject: build: only use the mas build config in the required components Before landing this patch should be split into the relevant MAS patches, or at least the patch this one partially reverts diff --git a/base/BUILD.gn b/base/BUILD.gn -index 6e6f24e479cce61b5f189faed40601e8f3e82ef9..bfad3b64106388a9d5f917bcbd1af646bc47833f 100644 +index 87ffd0b51817838306f1d0d0eb8a7d3c04022b41..68f599f110cc78c49d04f8bb2a315375b5d909e3 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn -@@ -1039,6 +1039,7 @@ component("base") { +@@ -1038,6 +1038,7 @@ component("base") { "//build/config/compiler:prevent_unsafe_narrowing", "//build/config/compiler:wexit_time_destructors", "//build/config/compiler:wglobal_constructors", @@ -74,7 +74,7 @@ index 440fa0b3ff9b08016ff19ab54c70a453dc8c5f86..2e2f358829bf0492fd3e44173eeb7d0b if (is_win) { diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 224a6884ef5070efe1a51fdf1c24662388288432..95ea998ec0d00558ef12ebc172671e02e2efdcfc 100644 +index 2f165461b7326b4e426d4b2552766896bb273c29..c05a51a74e2f753b46d984930130e31cd9801542 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn @@ -56,6 +56,7 @@ source_set("browser") { @@ -110,7 +110,7 @@ index 62117d9c83972003d0483ed9fc6efad6a4490a75..246d7289fd5727886054e182e17520c5 public_deps = [ diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn -index 87cb6cc7da672c93271dab01f29b5611a736a6b9..30dd8742a8fbbb60d18988c1ff68cfc51f42a6ca 100644 +index 1ef02e527e7e3bc551b9a0a2a12259c34b4d5f0b..79fc4b4e888688126cce4483adbc9fd70d0d7377 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn @@ -477,6 +477,7 @@ static_library("test_support") { @@ -249,10 +249,10 @@ index 4e23c38763184840a393589b3f55dcabb0db8121..e4ad30d0d7acecdca3a22fe05935a340 if (use_atk) { diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index 9233e89712a12e27d85232fb51f113f41375a08a..a73f9cb635a09b44ba35b0d5b1196dfdf921d277 100644 +index 22a11fe6cf0ee95e3535d46c80f77a25a5e550b3..4ea70349a2e72beb7db40c4ba7775dba806a48f2 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn -@@ -356,6 +356,7 @@ component("base") { +@@ -358,6 +358,7 @@ component("base") { "interaction/element_tracker_mac.mm", "resource/resource_bundle_mac.mm", ] diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index fe7e3f17cb2ea..83cd3cbbeab7f 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 fa8adac96c069c93a0b98ef79c6941a1907503bd..4da6272864fd6709dcb56b9561ec86f4b0e037be 100644 +index 09c322c7a7c653befdb5dc0d974ebca4551296bc..01eb116b51037bff5da7a87d119b78387f5e72c6 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -8065,6 +8065,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -8064,6 +8064,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 fa8adac96c069c93a0b98ef79c6941a1907503bd..4da6272864fd6709dcb56b9561ec86f4 &no_javascript_access); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 1caf3d1f032c407d2309c83d862104a24fcf5749..94d7caadca3d07fe2886715bc9b5eac6a7dfbd46 100644 +index fe8d2992c67233e356d35b98fd28381b92709537..278e45752fe57ea81a4d825d9dd528ca67265808 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4310,6 +4310,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4315,6 +4315,12 @@ FrameTree* WebContentsImpl::CreateNewWindow( auto* new_contents_impl = new_contents.get(); @@ -37,7 +37,7 @@ index 1caf3d1f032c407d2309c83d862104a24fcf5749..94d7caadca3d07fe2886715bc9b5eac6 // 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 -@@ -4351,12 +4357,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4356,12 +4362,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( AddWebContentsDestructionObserver(new_contents_impl); } @@ -66,7 +66,7 @@ index a1757960b139dea126e34776e9ec7768d9e3d89d..a3226c9a8080537daa2454b8014a6919 // 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 af623d96cb4a0d9397cfcc798e3b8d20ed331b1e..40a7acacf1218368245d20e50ecaaa267adabc5c 100644 +index 8727ca6878d50e538e94f13616ac7defb0da9521..1822d2961a6e9dafd6174f331f4e6bcc3a482049 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc @@ -677,6 +677,8 @@ bool ContentBrowserClient::CanCreateWindow( @@ -79,7 +79,7 @@ index af623d96cb4a0d9397cfcc798e3b8d20ed331b1e..40a7acacf1218368245d20e50ecaaa26 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 5fec5acd6fac364e815014ac0166c6f241acae37..8e464a60370317ebd8682a0bb2aa983eb54f0c69 100644 +index 7e7f12866a3ce0494dc059e0b6fcb3ed0f62227d..a5361ff2553c9e5c99a65a8f13eb3f5cded9fb78 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -173,6 +173,7 @@ class NetworkService; @@ -122,7 +122,7 @@ index 688fac1fd874438ad9bc6494691b0eadca7e5bb2..db12930a449b38966e63c2274275b115 const OpenURLParams& params) { return nullptr; diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h -index 791cd97dd0c45055b7b447c733dd25f81cd2ed09..8b5a2052cb2b53b58253d42a36168da2a47ca532 100644 +index 34d3d2feb7d236d8f220da8e2aadda28b6eb4d26..39e142eedd051073a5f31b5455001a37b839a6bc 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h @@ -16,6 +16,7 @@ @@ -133,7 +133,7 @@ index 791cd97dd0c45055b7b447c733dd25f81cd2ed09..8b5a2052cb2b53b58253d42a36168da2 #include "content/public/browser/eye_dropper.h" #include "content/public/browser/fullscreen_types.h" #include "content/public/browser/invalidate_type.h" -@@ -343,6 +344,13 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -344,6 +345,13 @@ class CONTENT_EXPORT WebContentsDelegate { const StoragePartitionConfig& partition_config, SessionStorageNamespace* session_storage_namespace); diff --git a/patches/chromium/chore_add_buildflag_guard_around_new_include.patch b/patches/chromium/chore_add_buildflag_guard_around_new_include.patch index b1074081d1614..f8855c89f22ae 100644 --- a/patches/chromium/chore_add_buildflag_guard_around_new_include.patch +++ b/patches/chromium/chore_add_buildflag_guard_around_new_include.patch @@ -9,7 +9,7 @@ This is an experimental commit; but if it's successful, This patch should be upstreamed and then removed from electron's code. diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h -index 58f128d2217a07be876b0878d64ebf593ce6eb37..dedb231d21ead676fd0f568d3cebd3fb8ad2ed6d 100644 +index f653d059664196a5015bbe53b8ca33e15efa0782..41a3a070b9070984ca980787041c88b03b00627d 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -43,7 +43,6 @@ diff --git a/patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch b/patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch index f98a6c0432fae..1d230f1017e53 100644 --- a/patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch +++ b/patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch @@ -14,7 +14,7 @@ This change patches it out to prevent the DCHECK. It can be removed once/if we see a better solution to the problem. diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc -index 276d831dba64b941a80f5804669f5e9f72f359b5..5110dbb5efd152872a03f074a1e57f0c2bf4603c 100644 +index a478ec236b193a42296aa30be384b54973f2ff89..e65c53f1ad3f0b79bd820970436788ae4e5b61fe 100644 --- a/content/browser/site_instance_impl.cc +++ b/content/browser/site_instance_impl.cc @@ -205,7 +205,7 @@ scoped_refptr SiteInstanceImpl::CreateForGuest( diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index cbcac2cbab7c5..faead1774edb4 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 aaaa61d5c3a1d5ade2fd355e38a3985ef5cc4e7d..b45746ba0f38a381a2ee5ca17f3a1685 } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc -index 501783a57a06e7c2473046eefa9f798004af0416..9104dd5825d1705f0e90dd8f5b75ef07789f4a67 100644 +index 3390eb25d8e648282591fd05b2cd6a0b86964d3a..b4e2f99c25ebce78a6346e5bedd6728a1c528911 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc -@@ -1860,12 +1860,11 @@ bool Browser::IsWebContentsCreationOverridden( +@@ -1868,12 +1868,11 @@ bool Browser::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -218,10 +218,10 @@ index 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7 void AddNewContents(content::WebContents* source, std::unique_ptr new_contents, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index b01b8386fd519c239a3525cae9cbda58ea99a176..c7c515bf753a4a9851b1d68c206b9c7487f02578 100644 +index e3d811b00c799fba8aa9d52a9b437618e579e169..2f2e089817f8b9392f0a793c3702d04f9ad5b97b 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4217,8 +4217,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -4222,8 +4222,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( if (delegate_ && delegate_->IsWebContentsCreationOverridden( source_site_instance, params.window_container_type, @@ -246,10 +246,10 @@ index db12930a449b38966e63c2274275b1157f38bea7..2d770e9c0c88e5ad1fac15fd13b70e6b } diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h -index 8b5a2052cb2b53b58253d42a36168da2a47ca532..976ffa66d145b4dc45606b7f45292bf2dd817c77 100644 +index 39e142eedd051073a5f31b5455001a37b839a6bc..dcc4a956485b61514f0fa208d96083aaf53d563e 100644 --- a/content/public/browser/web_contents_delegate.h +++ b/content/public/browser/web_contents_delegate.h -@@ -322,8 +322,7 @@ class CONTENT_EXPORT WebContentsDelegate { +@@ -323,8 +323,7 @@ class CONTENT_EXPORT WebContentsDelegate { SiteInstance* source_site_instance, mojom::WindowContainerType window_container_type, const GURL& opener_url, diff --git a/patches/chromium/disable_color_correct_rendering.patch b/patches/chromium/disable_color_correct_rendering.patch index 435f511ed1f98..023785ca5034e 100644 --- a/patches/chromium/disable_color_correct_rendering.patch +++ b/patches/chromium/disable_color_correct_rendering.patch @@ -20,7 +20,7 @@ to deal with color spaces. That is being tracked at https://crbug.com/634542 and https://crbug.com/711107. diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc -index b390a74131118d19dfe51c311abbab68370aef1e..62df2a48bf8b588f1ed08b05a83ca91dd3449b2b 100644 +index cc5461a832fedab9e862456df4751a456afb1b48..b5e4367ccd29042c32d6ee7d72aa08fa31eb395f 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1873,6 +1873,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( @@ -93,10 +93,10 @@ index 9d7e9780c3ae58b45b2f443e48175254dd3f480b..6a276759550e6f80740875df654a136c sandbox::policy::switches::kGpuSandboxAllowSysVShm, sandbox::policy::switches::kGpuSandboxFailuresFatal, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 36142abc8d5322e2408b186560ff34b1b268b7b9..6a91a06b31ca43300e08cbf51b87078ec564e40c 100644 +index c240d818b3a8f93ccbf77cb74e48d271c82fa08a..f6ce53a6f38cac3e1381940614b91526da9283dc 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -3537,6 +3537,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -3535,6 +3535,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( // Propagate the following switches to the renderer command line (along // with any associated values) if present in the browser command line. static const char* const kSwitchNames[] = { diff --git a/patches/chromium/disable_compositor_recycling.patch b/patches/chromium/disable_compositor_recycling.patch index cbba1acd88d14..ad47c897d129a 100644 --- a/patches/chromium/disable_compositor_recycling.patch +++ b/patches/chromium/disable_compositor_recycling.patch @@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron. diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index 7f2b627031f65ad45a8ad182d3b7421005893ff4..43e5a96a5a191da992bdfa85dfeb080081358c88 100644 +index 701b2e4d9e91c138179fde12a21fccf53c02937b..09d45ce54763b65a9713e4f43ec3e07626937029 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -536,7 +536,11 @@ +@@ -546,7 +546,11 @@ return; host()->WasHidden(); diff --git a/patches/chromium/disable_hidden.patch b/patches/chromium/disable_hidden.patch index a6de3d482d519..55580c5d2b9dd 100644 --- a/patches/chromium/disable_hidden.patch +++ b/patches/chromium/disable_hidden.patch @@ -6,10 +6,10 @@ 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 55364bf0f6313eb57a96b46ad0a28051ab33fd62..3e0ed454b09a3d23570479a390e3dff92cbf83bc 100644 +index 2212b6575e885f60def207d7614114c72ac3ea9d..5e09ede19e2b54e806ae212cccb9c43c93439fbc 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc -@@ -800,6 +800,9 @@ void RenderWidgetHostImpl::WasHidden() { +@@ -801,6 +801,9 @@ void RenderWidgetHostImpl::WasHidden() { return; } @@ -33,7 +33,7 @@ index 401123216fccc830a240b0b473e0426a65e630e6..2c205dd684340ddbed4fd301d5928ce6 protected: // |routing_id| must not be MSG_ROUTING_NONE. 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 628724f3cc5c970402479a5c4a0c23af0d1f906d..8fa040071ba1e70890f7dcf8193e83e147679ed7 100644 +index 8fc7b8a81ddf634efff0f1dfb49723ff44225d2a..10ee30af7650f67d4c27af4df357f2316b992abc 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -617,7 +617,7 @@ void RenderWidgetHostViewAura::HideImpl() { 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 4ba7fa7626ede..de5d7b10a622a 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,7 +13,7 @@ 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 cb532ff5d2e653fb1b67ffb8c8d5c75916f912f2..1d387e531a80a3abbfd06d6e4ec16ba30332f0f9 100644 +index f6556e141a76b0766f672bfa5819256e635c60af..06c7ac178cefc149732294ed790f2b7cbb328d34 100644 --- a/ui/native_theme/native_theme.cc +++ b/ui/native_theme/native_theme.cc @@ -153,6 +153,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors, @@ -26,10 +26,10 @@ index cb532ff5d2e653fb1b67ffb8c8d5c75916f912f2..1d387e531a80a3abbfd06d6e4ec16ba3 } diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h -index 472988beb8048ac30b1a25cbbc5081627a06a7b6..640414b40d589d66a77e6efad7d71e676ca85ead 100644 +index c0a4e3a9f6cb29eead5b1a95da696c92277b3722..97d4db79bcb4a874d0f40f4f0ef0a466a3cfe3b1 100644 --- a/ui/native_theme/native_theme.h +++ b/ui/native_theme/native_theme.h -@@ -417,6 +417,23 @@ class NATIVE_THEME_EXPORT NativeTheme { +@@ -421,6 +421,23 @@ class NATIVE_THEME_EXPORT NativeTheme { scoped_refptr custom_theme, bool use_custom_frame = true) const; @@ -53,7 +53,7 @@ index 472988beb8048ac30b1a25cbbc5081627a06a7b6..640414b40d589d66a77e6efad7d71e67 // 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 -@@ -627,6 +644,7 @@ class NATIVE_THEME_EXPORT NativeTheme { +@@ -631,6 +648,7 @@ class NATIVE_THEME_EXPORT NativeTheme { bool inverted_colors_ = false; PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight; PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference; @@ -62,10 +62,10 @@ index 472988beb8048ac30b1a25cbbc5081627a06a7b6..640414b40d589d66a77e6efad7d71e67 SEQUENCE_CHECKER(sequence_checker_); }; diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc -index d3f9fcbed28f92a113fc2734cc0789e663ccfff9..7c71f93a8aaff618e59a2477b0608f0e437b9b44 100644 +index faa15be0b3e08360c702b32968d3b1633038d776..7a6c284143e873b408333fa2052e05863935cb89 100644 --- a/ui/native_theme/native_theme_win.cc +++ b/ui/native_theme/native_theme_win.cc -@@ -632,6 +632,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const { +@@ -658,6 +658,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_configure_launch_options_for_service_process.patch b/patches/chromium/feat_configure_launch_options_for_service_process.patch index c33bb204b4917..87e115f02f34b 100644 --- a/patches/chromium/feat_configure_launch_options_for_service_process.patch +++ b/patches/chromium/feat_configure_launch_options_for_service_process.patch @@ -58,10 +58,10 @@ index e515503a0f636d935fdcd779a5ac01bd8f351e74..0669361cb063c9dd15a19486fce1a609 // Launches a process asynchronously and notifies the client of the process diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc -index b8147fce70f90191f9d4a794f69f32b23eac0e08..89c9d1982b575312ba730ab952b22326c8d83a6a 100644 +index bd80ca431a5c50ac001d7607841c64e90f4fe4c3..befc9666c3901e84b75934c6c98ca6de864eaa19 100644 --- a/content/browser/child_process_launcher_helper_linux.cc +++ b/content/browser/child_process_launcher_helper_linux.cc -@@ -62,6 +62,11 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( +@@ -63,6 +63,11 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( options->fds_to_remap.emplace_back(sandbox_fd, GetSandboxFD()); } @@ -73,7 +73,7 @@ index b8147fce70f90191f9d4a794f69f32b23eac0e08..89c9d1982b575312ba730ab952b22326 // (For Electron), if we're launching without zygote, that means we're // launching an unsandboxed process (since all sandboxed processes are // forked from the zygote). Relax the allow_new_privs option to permit -@@ -71,7 +76,9 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( +@@ -72,7 +77,9 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( options->allow_new_privs = true; } @@ -627,7 +627,7 @@ index cb43aa14c9742f3788ae58c3e49b890cd532f327..6a738f7aade504f2ff3bb6647a0da8f8 #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 2ee0182088f41846f352fae0b67fc90448855355..9dc5630e1e858ef4de91680ad119e5bf5696e1e3 100644 +index da5844e2ef28872d91f76ebbbaee3ca976304568..a4aaeaccb3cb73b7fc3244873d33af1af61a42c6 100644 --- a/sandbox/policy/win/sandbox_win.cc +++ b/sandbox/policy/win/sandbox_win.cc @@ -706,11 +706,9 @@ base::win::ScopedHandle CreateUnsandboxedJob() { diff --git a/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch b/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch index d5f00ca38104b..b8d1d532f01ec 100644 --- a/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch +++ b/patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch @@ -6,10 +6,10 @@ Subject: fix: allow guest webcontents to enter fullscreen This can be upstreamed, a guest webcontents can't technically become the focused webContents. This DCHECK should allow all guest webContents to request fullscreen entrance. diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 3fef597d18025bd35b4f7af105c6907602958223..a515cff65ec418ccd44bccd61b0cf8094cb864db 100644 +index 8d5a0e6aa6ea3a0965ed6abb76368d1f8e3ea91e..36cd52f18c83adc007d6f896a4136a93f0fa1c83 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3714,7 +3714,7 @@ void WebContentsImpl::EnterFullscreenMode( +@@ -3715,7 +3715,7 @@ void WebContentsImpl::EnterFullscreenMode( OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode"); DCHECK(CanEnterFullscreenMode(requesting_frame, options)); DCHECK(requesting_frame->IsActive()); 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 79df2ee66b0d9..0fe4f9963ae8c 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 @@ -17,10 +17,10 @@ policy->CanCommitOriginAndUrl. 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 da87a4f823d6fa36589b6efc7e3b381fdd07b11c..c242e3ac8d62faf29f39a8d7bc46d08192e850f4 100644 +index 2bd49672ebb2765e6fe4bc062f872de94a6c0af9..4e352bca9a73f4be12cdd54952265d89f85e6d75 100644 --- a/content/browser/renderer_host/navigation_request.cc +++ b/content/browser/renderer_host/navigation_request.cc -@@ -7454,10 +7454,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { +@@ -7456,10 +7456,11 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() { if (IsForMhtmlSubframe()) return origin_with_debug_info; @@ -37,7 +37,7 @@ index da87a4f823d6fa36589b6efc7e3b381fdd07b11c..c242e3ac8d62faf29f39a8d7bc46d081 } diff --git a/content/browser/renderer_host/render_frame_host_impl.h b/content/browser/renderer_host/render_frame_host_impl.h -index 1e6cfb0e983bd432a6b21c08bb9b2855c0c3889c..57107b584b442d5b3c2d4c1e4c4653e3fddf862f 100644 +index 3ea1aa4a27018aa9c36b15fbb9e34849bdafbd8e..5f2b1369a14e2e7c49ebf34e2535a847933296bf 100644 --- a/content/browser/renderer_host/render_frame_host_impl.h +++ b/content/browser/renderer_host/render_frame_host_impl.h @@ -2953,6 +2953,17 @@ class CONTENT_EXPORT RenderFrameHostImpl diff --git a/patches/chromium/fix_export_zlib_symbols.patch b/patches/chromium/fix_export_zlib_symbols.patch index 548608a59d68e..68fc71182bba4 100644 --- a/patches/chromium/fix_export_zlib_symbols.patch +++ b/patches/chromium/fix_export_zlib_symbols.patch @@ -6,7 +6,7 @@ Subject: fix: export zlib symbols This patch sets ZLIB_DLL so that we properly export zlib symbols. diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn -index ecf2a095bcb9b1443e299ecdf9eaa429afa3409b..39bd91489ee96b250cdb6a7f8bb4cea2af33f705 100644 +index 8ed0807a994b1e0e63ef356de91592c71efc143e..235a4715cb355538fd6008f9de07c4f318b57d7c 100644 --- a/third_party/zlib/BUILD.gn +++ b/third_party/zlib/BUILD.gn @@ -321,6 +321,10 @@ component("zlib") { 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 2f6053db8e5dc..50865be8220de 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 @@ -15,10 +15,10 @@ node does not change in this case. chromium-bug: https://crbug.com/1369605 diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc -index 844797a0f880354f590b84bf354d7f9375b2c31f..d251b241582208b21096d3e2ab650b9e1012c380 100644 +index 7f713269d7234448a7e59c8d3acdeeb74cb6a412..fe042289beb7d0239521f580aff9478a79719477 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc -@@ -1000,6 +1000,12 @@ RenderWidgetHostViewChildFrame::DidUpdateVisualProperties( +@@ -1006,6 +1006,12 @@ RenderWidgetHostViewChildFrame::DidUpdateVisualProperties( return viz::ScopedSurfaceIdAllocator(std::move(allocation_task)); } @@ -32,10 +32,10 @@ index 844797a0f880354f590b84bf354d7f9375b2c31f..d251b241582208b21096d3e2ab650b9e if (!text_input_manager_) return ui::TEXT_INPUT_TYPE_NONE; diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.h b/content/browser/renderer_host/render_widget_host_view_child_frame.h -index ed0641b888c6421b1791c086466bd9c158e9109d..3760b3823d5af3325017bb53f5b1d38e6d9091d8 100644 +index 1e9dcbb9f0a5e401a50d63be490755bc3eeaa1a3..1e2e0a321df6fe9dea4401ed327c93730a4fea07 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame.h +++ b/content/browser/renderer_host/render_widget_host_view_child_frame.h -@@ -181,6 +181,8 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame +@@ -182,6 +182,8 @@ class CONTENT_EXPORT RenderWidgetHostViewChildFrame void DisableAutoResize(const gfx::Size& new_size) override; viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties( const cc::RenderFrameMetadata& metadata) override; @@ -45,10 +45,10 @@ index ed0641b888c6421b1791c086466bd9c158e9109d..3760b3823d5af3325017bb53f5b1d38e // RenderFrameMetadataProvider::Observer implementation. void OnRenderFrameMetadataChangedBeforeActivation( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index a515cff65ec418ccd44bccd61b0cf8094cb864db..4345ec56895124c50651462386f3fad45fb651bb 100644 +index 36cd52f18c83adc007d6f896a4136a93f0fa1c83..99f6e45fe48449c2dbe88514648a4d907999e282 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -8277,7 +8277,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( +@@ -8319,7 +8319,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame( "WebContentsImpl::OnFocusedElementChangedInFrame", "render_frame_host", frame); RenderWidgetHostViewBase* root_view = 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 821f6d9273099..d4bfb69a18d88 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 3f81597c41a3e65454d2181548682e2e9441e9b6..9eac5dc78d68c7f49c594ddbf9935375c538162a 100644 +index 4f3ec48c9bc07473a4085dddce6c7b9de1afdefe..c4b7beb3d551130caf87280233161afa23f94c95 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc @@ -564,6 +564,7 @@ void MenuController::Run(Widget* parent, diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index 35f39ecf03162..9b2ee58b0b034 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 2028ef8c1817b564713930b92c84c53a880b4b22..836c74442392d317fd400eb9f1fde148dbf90757 100644 +index b482d14598859535508154b0ddac22a2e44cc2b5..131ecb24d5ec2af4e420357512c35c4c2de807da 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc -@@ -4123,6 +4123,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -4162,6 +4162,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request->ResetStateForSiteInstanceChange(); } @@ -20,7 +20,7 @@ index 2028ef8c1817b564713930b92c84c53a880b4b22..836c74442392d317fd400eb9f1fde148 } diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index 8e464a60370317ebd8682a0bb2aa983eb54f0c69..62b86c1a5065d9e5169a86ef5e37f41b1ebd8df6 100644 +index a5361ff2553c9e5c99a65a8f13eb3f5cded9fb78..0a26db1b85f97a811fc6ff3cb2dfcde77ff0e07b 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -311,6 +311,11 @@ class CONTENT_EXPORT ContentBrowserClient { diff --git a/patches/chromium/gritsettings_resource_ids.patch b/patches/chromium/gritsettings_resource_ids.patch index e81fb621f3aaa..f91e4d3e7a2ed 100644 --- a/patches/chromium/gritsettings_resource_ids.patch +++ b/patches/chromium/gritsettings_resource_ids.patch @@ -6,10 +6,10 @@ 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 a327136986b82869f394f47e4609e431c9f3a3ac..28cca57152b6168b008c27c1e82f560ba16b56b4 100644 +index 85c7d3e22358d4aeae011f67b8113fe5b62f9ff9..45354344860b90b4a8ba09a30c761e8fe20e5431 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec -@@ -1197,6 +1197,11 @@ +@@ -1205,6 +1205,11 @@ "includes": [7440], }, diff --git a/patches/chromium/mas-cgdisplayusesforcetogray.patch b/patches/chromium/mas-cgdisplayusesforcetogray.patch index 7d8bba9fc25dd..ef69b1723ed88 100644 --- a/patches/chromium/mas-cgdisplayusesforcetogray.patch +++ b/patches/chromium/mas-cgdisplayusesforcetogray.patch @@ -6,7 +6,7 @@ Subject: mas: avoid usage of CGDisplayUsesForceToGray Removes usage of the CGDisplayUsesForceToGray private API. diff --git a/ui/display/mac/screen_mac.mm b/ui/display/mac/screen_mac.mm -index 087284a1efd9e4f55dc93c88fe0118d653fa678c..5d6eac01000d42dc8c60ed5bcdb02a7bd0792e8d 100644 +index 370e0d24addbdd4989cac6dace70f1a9c6cea0fd..b647a2989911594a85a66b96ddca1533c96bd6e2 100644 --- a/ui/display/mac/screen_mac.mm +++ b/ui/display/mac/screen_mac.mm @@ -159,7 +159,17 @@ DisplayMac BuildDisplayForScreen(NSScreen* screen) { diff --git a/patches/chromium/mas_disable_custom_window_frame.patch b/patches/chromium/mas_disable_custom_window_frame.patch index 8abec3fa4b8f9..e0a0a13661869 100644 --- a/patches/chromium/mas_disable_custom_window_frame.patch +++ b/patches/chromium/mas_disable_custom_window_frame.patch @@ -75,7 +75,7 @@ index 3a815ebf505bd95fa7f6b61ba433d98fbfe20225..dbbebbdc1735bc14224dfcde0b7fe3a6 + @end diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h -index 9d0469a373c1e74d3007fa171459a0d9e831bd02..b0b5ebf56c790f1fb647994cefadf0bce3a11755 100644 +index 05a2f3730ea65510a9afc3522ededb1378232716..a5b4925530ce02d0f5bbe576a027d8dd893dd524 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h @@ -17,6 +17,7 @@ class NativeWidgetNSWindowBridge; @@ -95,10 +95,10 @@ index 9d0469a373c1e74d3007fa171459a0d9e831bd02..b0b5ebf56c790f1fb647994cefadf0bc // The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that // can only be accomplished by overriding methods. diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -index 64ea3046693835ebb263d30f7e30380851bacd38..f834876be0465ea27495814c37489ba6bdbed9bd 100644 +index a8c96509886c2b4c32b01524907edc9892709d9f..b5088a3217cb4a78c89526d3fc006431070ec959 100644 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm -@@ -97,7 +97,9 @@ void OrderChildWindow(NSWindow* child_window, +@@ -113,7 +113,9 @@ void OrderChildWindow(NSWindow* child_window, } // namespace @interface NSWindow (Private) @@ -108,7 +108,7 @@ index 64ea3046693835ebb263d30f7e30380851bacd38..f834876be0465ea27495814c37489ba6 - (BOOL)hasKeyAppearance; - (long long)_resizeDirectionForMouseLocation:(CGPoint)location; - (BOOL)_isConsideredOpenForPersistentState; -@@ -135,6 +137,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event { +@@ -161,6 +163,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event { } @end @@ -117,7 +117,7 @@ index 64ea3046693835ebb263d30f7e30380851bacd38..f834876be0465ea27495814c37489ba6 @implementation NativeWidgetMacNSWindowTitledFrame - (void)mouseDown:(NSEvent*)event { if (self.window.isMovable) -@@ -161,6 +165,8 @@ - (BOOL)usesCustomDrawing { +@@ -187,6 +191,8 @@ - (BOOL)usesCustomDrawing { } @end @@ -126,7 +126,7 @@ index 64ea3046693835ebb263d30f7e30380851bacd38..f834876be0465ea27495814c37489ba6 @implementation NativeWidgetMacNSWindow { @private CommandDispatcher* __strong _commandDispatcher; -@@ -355,6 +361,8 @@ - (NSAccessibilityRole)accessibilityRole { +@@ -401,6 +407,8 @@ - (NSAccessibilityRole)accessibilityRole { // NSWindow overrides. @@ -135,7 +135,7 @@ index 64ea3046693835ebb263d30f7e30380851bacd38..f834876be0465ea27495814c37489ba6 + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { if (windowStyle & NSWindowStyleMaskTitled) { if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class]) -@@ -366,6 +374,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { +@@ -412,6 +420,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle { return [super frameViewClassForStyleMask:windowStyle]; } diff --git a/patches/chromium/mas_disable_remote_accessibility.patch b/patches/chromium/mas_disable_remote_accessibility.patch index be163ee32d060..cee6a4ee90774 100644 --- a/patches/chromium/mas_disable_remote_accessibility.patch +++ b/patches/chromium/mas_disable_remote_accessibility.patch @@ -43,10 +43,10 @@ index 5a096477c123a782341115f964c4975301ccaf9a..ecfbb3b405425af346a6ba6788fc1d8f } // namespace diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm -index c4285bf227abf1536213835ebdb8ca16d2638263..73c27518cab1efbbd2e4ec334b8685bd25d6d693 100644 +index 40cc594101b8872b38b4c3bee31fcae5be5d9f3e..c9a73c823a8810daa140d88d6c36cc445f908a70 100644 --- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm +++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm -@@ -587,10 +587,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { +@@ -599,10 +599,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) { // this should be treated as an error and caught early. CHECK(bridged_view_); @@ -121,7 +121,7 @@ index 45aeb6838a859f57287bec51f79a4eb77d69b619..6f5c28de251d4f6db9b07b37d0b513c2 return false; } diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h -index fd35d3a94113f1337b097cfa4bf40d8330504e5a..04bd16db3b8a23b9e5d90ced459c440a34ffa375 100644 +index 286881d3a0d369e4d4b2c8ef42eda410e1c41951..0e064b773319fbcc86bbc00df60b9919bf61a57c 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h @@ -49,7 +49,9 @@ class ScopedPasswordInputEnabler; @@ -132,9 +132,9 @@ index fd35d3a94113f1337b097cfa4bf40d8330504e5a..04bd16db3b8a23b9e5d90ced459c440a @class NSAccessibilityRemoteUIElement; +#endif @class RenderWidgetHostViewCocoa; + @class CursorAccessibilityScaleFactorObserver; - namespace content { -@@ -667,9 +669,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac +@@ -672,9 +674,11 @@ class CONTENT_EXPORT RenderWidgetHostViewMac // EnsureSurfaceSynchronizedForWebTest(). uint32_t latest_capture_sequence_number_ = 0u; @@ -147,10 +147,10 @@ index fd35d3a94113f1337b097cfa4bf40d8330504e5a..04bd16db3b8a23b9e5d90ced459c440a // Used to force the NSApplication's focused accessibility element to be the // content::BrowserAccessibilityCocoa accessibility tree when the NSView for diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index b8d1f98c9c7c5831677d4c200aa085a4a168273c..7f2b627031f65ad45a8ad182d3b7421005893ff4 100644 +index a049d431b4657d17a23b2505666c84f94b20bc5e..701b2e4d9e91c138179fde12a21fccf53c02937b 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -263,8 +263,10 @@ +@@ -273,8 +273,10 @@ void RenderWidgetHostViewMac::MigrateNSViewBridge( remote_cocoa::mojom::Application* remote_cocoa_application, uint64_t parent_ns_view_id) { @@ -161,7 +161,7 @@ index b8d1f98c9c7c5831677d4c200aa085a4a168273c..7f2b627031f65ad45a8ad182d3b74210 // Reset `ns_view_` before resetting `remote_ns_view_` to avoid dangling // pointers. `ns_view_` gets reinitialized later in this method. -@@ -1614,8 +1616,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1628,8 +1630,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, gfx::NativeViewAccessible RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() { @@ -172,7 +172,7 @@ index b8d1f98c9c7c5831677d4c200aa085a4a168273c..7f2b627031f65ad45a8ad182d3b74210 return [GetInProcessNSView() window]; } -@@ -1659,9 +1663,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1673,9 +1677,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, } void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) { @@ -184,7 +184,7 @@ index b8d1f98c9c7c5831677d4c200aa085a4a168273c..7f2b627031f65ad45a8ad182d3b74210 } bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame( -@@ -2163,12 +2169,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -2177,12 +2183,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken( const std::vector& window_token) { @@ -200,10 +200,10 @@ index b8d1f98c9c7c5831677d4c200aa085a4a168273c..7f2b627031f65ad45a8ad182d3b74210 /////////////////////////////////////////////////////////////////////////////// diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index 121d8798571233799624a1e187b0f0edfdb9ca98..9233e89712a12e27d85232fb51f113f41375a08a 100644 +index cda1666e0e360c3d92bfa84d9060b79760762915..22a11fe6cf0ee95e3535d46c80f77a25a5e550b3 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn -@@ -373,6 +373,13 @@ component("base") { +@@ -375,6 +375,13 @@ component("base") { sources += [ "resource/resource_bundle_lacros.cc" ] } diff --git a/patches/chromium/notification_provenance.patch b/patches/chromium/notification_provenance.patch index 6baa53d92330b..32c4097bd95bb 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -133,7 +133,7 @@ index d0e0d10739b5daf99435a67e18dc51df8e670e09..704f3d6c2fdd27a84d1c4e1b7bf680f6 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 7f34ad97947dfb3dccc29edeb06365b007236183..1165a7e81de03921ab774006cfb06f928cb2632e 100644 +index e839fd0e67160d0b0c8ee9028e4b0200cc1f9647..3552da0688699735fdfb9ecab0d6adcfcc4061dd 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -2230,7 +2230,7 @@ void RenderProcessHostImpl::CreateNotificationService( diff --git a/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch b/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch index d720d6bbd4b18..acd8b85b9052e 100644 --- a/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch +++ b/patches/chromium/port_autofill_colors_to_the_color_pipeline.patch @@ -8,10 +8,10 @@ needed in chromium but our autofill implementation uses them. This patch can be our autofill implementation to work like Chromium's. diff --git a/ui/color/color_id.h b/ui/color/color_id.h -index 7fb6f6449dcfac86fdc4f3af628d5b6a9e91f5c4..962c878e2e19ca1cb932e9f9332508f2ac989026 100644 +index ddb9d4bc0822577a313fb160a3a0a584f1b41e07..f54024d355d24e1780f77314160220e1fe08de3c 100644 --- a/ui/color/color_id.h +++ b/ui/color/color_id.h -@@ -388,6 +388,10 @@ +@@ -387,6 +387,10 @@ E_CPONLY(kColorScrollbarThumbInactive) \ E_CPONLY(kColorScrollbarThumbPressed) \ E_CPONLY(kColorScrollbarTrack) \ @@ -22,7 +22,7 @@ index 7fb6f6449dcfac86fdc4f3af628d5b6a9e91f5c4..962c878e2e19ca1cb932e9f9332508f2 E_CPONLY(kColorSegmentedButtonBorder) \ E_CPONLY(kColorSegmentedButtonFocus) \ E_CPONLY(kColorSegmentedButtonForegroundChecked) \ -@@ -488,6 +492,7 @@ +@@ -487,6 +491,7 @@ E_CPONLY(kColorTreeNodeForeground) \ E_CPONLY(kColorTreeNodeForegroundSelectedFocused) \ E_CPONLY(kColorTreeNodeForegroundSelectedUnfocused) \ @@ -31,10 +31,10 @@ index 7fb6f6449dcfac86fdc4f3af628d5b6a9e91f5c4..962c878e2e19ca1cb932e9f9332508f2 #if BUILDFLAG(IS_CHROMEOS) diff --git a/ui/color/ui_color_mixer.cc b/ui/color/ui_color_mixer.cc -index 2dab7c10674d0d28f3b5f052dbec4b31819ea552..53ce7e6d9edd2b69267fd0d3e7b7c8eef95700fc 100644 +index 86be2b39a384b22fbd45ed4cbc7ab9f127563771..82cbaeee444d1c140bac70bc308c4d7ce096329b 100644 --- a/ui/color/ui_color_mixer.cc +++ b/ui/color/ui_color_mixer.cc -@@ -225,6 +225,17 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) { +@@ -224,6 +224,17 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) { : SkColorSetA(SK_ColorBLACK, 0x80)}; mixer[kColorScrollbarTrack] = {dark_mode ? SkColorSetRGB(0x42, 0x42, 0x42) : SkColorSetRGB(0xF1, 0xF1, 0xF1)}; @@ -52,7 +52,7 @@ index 2dab7c10674d0d28f3b5f052dbec4b31819ea552..53ce7e6d9edd2b69267fd0d3e7b7c8ee mixer[kColorSeparator] = {kColorMidground}; mixer[kColorShadowBase] = {dark_mode ? SK_ColorBLACK : gfx::kGoogleGrey800}; mixer[kColorShadowValueAmbientShadowElevationThree] = -@@ -336,6 +347,7 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) { +@@ -335,6 +346,7 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) { mixer[kColorTreeNodeForegroundSelectedFocused] = {kColorTreeNodeForeground}; mixer[kColorTreeNodeForegroundSelectedUnfocused] = { kColorTreeNodeForegroundSelectedFocused}; diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index 1ae1cf253eef6..eb1237a2bab62 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -11,10 +11,10 @@ majority of changes originally come from these PRs: This patch also fixes callback for manual user cancellation and success. diff --git a/BUILD.gn b/BUILD.gn -index dfcf0ad8238688f9e25d09cc3842cd8a42cf7316..e7b0bd77727f9c352a287a3100f35f7672d4b4a8 100644 +index dc86196ebcb7bb630dc3ca5b7e78244ae1e5ddd5..3e2cf78dc14a1d4b3d23ec9db4418a132c8b9df2 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -974,7 +974,6 @@ if (is_win) { +@@ -966,7 +966,6 @@ if (is_win) { "//media:media_unittests", "//media/midi:midi_unittests", "//net:net_unittests", @@ -22,7 +22,7 @@ index dfcf0ad8238688f9e25d09cc3842cd8a42cf7316..e7b0bd77727f9c352a287a3100f35f76 "//sql:sql_unittests", "//third_party/breakpad:symupload($host_toolchain)", "//ui/base:ui_base_unittests", -@@ -983,6 +982,10 @@ if (is_win) { +@@ -975,6 +974,10 @@ if (is_win) { "//ui/views:views_unittests", "//url:url_unittests", ] @@ -91,7 +91,7 @@ index c27e2d50aa6cd45484c222221c6a8dda50baf8ff..43c48b75806bb08f3a4ea45689fe2469 : PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3; } diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc -index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c884d5d8351 100644 +index 040a37a9eab2af1491f7f8f4dc2e6ed78ac1d20e..fe4b29c905d89d96e3abf163eb25d7fae20e3b22 100644 --- a/chrome/browser/printing/print_view_manager_base.cc +++ b/chrome/browser/printing/print_view_manager_base.cc @@ -23,7 +23,9 @@ @@ -174,7 +174,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 queue->QueuePrinterQuery(std::move(printer_query)); } -@@ -174,9 +195,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents) +@@ -189,9 +210,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents) : PrintManager(web_contents), queue_(g_browser_process->print_job_manager()->queue()) { DCHECK(queue_); @@ -187,7 +187,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 } PrintViewManagerBase::~PrintViewManagerBase() { -@@ -199,12 +222,20 @@ void PrintViewManagerBase::DisableThirdPartyBlocking() { +@@ -214,12 +237,20 @@ void PrintViewManagerBase::DisableThirdPartyBlocking() { } #endif // BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING) @@ -209,7 +209,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 return true; } -@@ -327,12 +358,13 @@ void PrintViewManagerBase::OnDidUpdatePrintableArea( +@@ -342,12 +373,13 @@ void PrintViewManagerBase::OnDidUpdatePrintableArea( } PRINTER_LOG(EVENT) << "Paper printable area updated for vendor id " << print_settings->requested_media().vendor_id; @@ -224,7 +224,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 base::Value::Dict job_settings, std::unique_ptr print_settings, UpdatePrintSettingsCallback callback) { -@@ -340,7 +372,8 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings( +@@ -355,7 +387,8 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings( settings->pages = GetPageRangesFromJobSettings(job_settings); settings->params = mojom::PrintParams::New(); RenderParamsFromPrintSettings(*print_settings, settings->params.get()); @@ -234,7 +234,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 if (!PrintMsgPrintParamsIsValid(*settings->params)) { mojom::PrinterType printer_type = static_cast( *job_settings.FindInt(kSettingPrinterType)); -@@ -352,6 +385,10 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings( +@@ -367,6 +400,10 @@ void PrintViewManagerBase::CompleteUpdatePrintSettings( return; } @@ -245,7 +245,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 set_cookie(settings->params->document_cookie); std::move(callback).Run(std::move(settings)); } -@@ -487,7 +524,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply( +@@ -502,7 +539,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply( void PrintViewManagerBase::ScriptedPrintReply( ScriptedPrintCallback callback, int process_id, @@ -255,7 +255,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); #if BUILDFLAG(ENABLE_OOP_PRINTING) -@@ -502,12 +540,15 @@ void PrintViewManagerBase::ScriptedPrintReply( +@@ -517,12 +555,15 @@ void PrintViewManagerBase::ScriptedPrintReply( return; } @@ -273,7 +273,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 } } -@@ -635,10 +676,12 @@ void PrintViewManagerBase::DidPrintDocument( +@@ -650,10 +691,12 @@ void PrintViewManagerBase::DidPrintDocument( void PrintViewManagerBase::GetDefaultPrintSettings( GetDefaultPrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -286,7 +286,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 #if BUILDFLAG(ENABLE_OOP_PRINTING) if (printing::features::kEnableOopPrintDriversJobPrint.Get() && #if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS) -@@ -690,10 +733,12 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -705,10 +748,12 @@ void PrintViewManagerBase::UpdatePrintSettings( base::Value::Dict job_settings, UpdatePrintSettingsCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -299,7 +299,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 absl::optional printer_type_value = job_settings.FindInt(kSettingPrinterType); -@@ -704,6 +749,7 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -719,6 +764,7 @@ void PrintViewManagerBase::UpdatePrintSettings( mojom::PrinterType printer_type = static_cast(*printer_type_value); @@ -307,7 +307,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 if (printer_type != mojom::PrinterType::kExtension && printer_type != mojom::PrinterType::kPdf && printer_type != mojom::PrinterType::kLocal) { -@@ -723,6 +769,7 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -738,6 +784,7 @@ void PrintViewManagerBase::UpdatePrintSettings( if (value > 0) job_settings.Set(kSettingRasterizePdfDpi, value); } @@ -315,7 +315,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 std::unique_ptr print_settings = PrintSettingsFromJobSettings(job_settings); -@@ -742,7 +789,21 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -757,7 +804,21 @@ void PrintViewManagerBase::UpdatePrintSettings( } } @@ -338,7 +338,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 // TODO(crbug.com/1424368): Remove this if the printable areas can be made // fully available from `PrintBackend::GetPrinterSemanticCapsAndDefaults()` // for in-browser queries. -@@ -764,8 +825,6 @@ void PrintViewManagerBase::UpdatePrintSettings( +@@ -779,8 +840,6 @@ void PrintViewManagerBase::UpdatePrintSettings( } #endif @@ -347,7 +347,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 } void PrintViewManagerBase::SetAccessibilityTree( -@@ -781,7 +840,7 @@ void PrintViewManagerBase::SetAccessibilityTree( +@@ -796,7 +855,7 @@ void PrintViewManagerBase::SetAccessibilityTree( void PrintViewManagerBase::IsPrintingEnabled( IsPrintingEnabledCallback callback) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); @@ -356,7 +356,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 } void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, -@@ -797,14 +856,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, +@@ -812,14 +871,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params, // didn't happen for some reason. bad_message::ReceivedBadMessage( render_process_host, bad_message::PVMB_SCRIPTED_PRINT_FENCED_FRAME); @@ -373,7 +373,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 return; } #endif -@@ -850,6 +909,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, +@@ -861,6 +920,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, PrintManager::PrintingFailed(cookie, reason); @@ -381,7 +381,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 // `PrintingFailed()` can occur because asynchronous compositing results // don't complete until after a print job has already failed and been // destroyed. In such cases the error notification to the user will -@@ -859,7 +919,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, +@@ -870,7 +930,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie, print_job_->document()->cookie() == cookie) { ShowPrintErrorDialogForGenericError(); } @@ -390,7 +390,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 ReleasePrinterQuery(); } -@@ -871,15 +931,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) { +@@ -882,15 +942,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) { test_observers_.RemoveObserver(&observer); } @@ -415,7 +415,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 } void PrintViewManagerBase::RenderFrameDeleted( -@@ -931,7 +1000,12 @@ void PrintViewManagerBase::OnJobDone() { +@@ -942,7 +1011,12 @@ void PrintViewManagerBase::OnJobDone() { // Printing is done, we don't need it anymore. // print_job_->is_job_pending() may still be true, depending on the order // of object registration. @@ -429,7 +429,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 ReleasePrintJob(); } -@@ -940,9 +1014,10 @@ void PrintViewManagerBase::OnCanceling() { +@@ -951,9 +1025,10 @@ void PrintViewManagerBase::OnCanceling() { } void PrintViewManagerBase::OnFailed() { @@ -441,7 +441,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 TerminatePrintJob(true); } -@@ -952,7 +1027,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() { +@@ -963,7 +1038,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() { // Is the document already complete? if (print_job_->document() && print_job_->document()->IsComplete()) { @@ -450,7 +450,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 return true; } -@@ -1000,7 +1075,10 @@ bool PrintViewManagerBase::CreateNewPrintJob( +@@ -1011,7 +1086,10 @@ bool PrintViewManagerBase::CreateNewPrintJob( // Disconnect the current `print_job_`. auto weak_this = weak_ptr_factory_.GetWeakPtr(); @@ -462,7 +462,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 if (!weak_this) return false; -@@ -1021,7 +1099,7 @@ bool PrintViewManagerBase::CreateNewPrintJob( +@@ -1032,7 +1110,7 @@ bool PrintViewManagerBase::CreateNewPrintJob( #endif print_job_->AddObserver(*this); @@ -471,7 +471,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 return true; } -@@ -1089,6 +1167,11 @@ void PrintViewManagerBase::ReleasePrintJob() { +@@ -1100,6 +1178,11 @@ void PrintViewManagerBase::ReleasePrintJob() { } #endif @@ -483,7 +483,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 if (!print_job_) return; -@@ -1096,7 +1179,7 @@ void PrintViewManagerBase::ReleasePrintJob() { +@@ -1107,7 +1190,7 @@ void PrintViewManagerBase::ReleasePrintJob() { // printing_rfh_ should only ever point to a RenderFrameHost with a live // RenderFrame. DCHECK(rfh->IsRenderFrameLive()); @@ -492,7 +492,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 } print_job_->RemoveObserver(*this); -@@ -1138,7 +1221,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() { +@@ -1149,7 +1232,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() { } bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) { @@ -501,7 +501,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 return true; if (!cookie) { -@@ -1284,7 +1367,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() { +@@ -1295,7 +1378,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() { } void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) { @@ -510,7 +510,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 for (auto& observer : GetTestObservers()) { observer.OnPrintNow(rfh); -@@ -1334,7 +1417,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis( +@@ -1345,7 +1428,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis( set_analyzing_content(/*analyzing=*/false); if (!allowed || !printing_rfh_ || IsCrashed() || !printing_rfh_->IsRenderFrameLive()) { @@ -520,7 +520,7 @@ index 6e5f0ae32837f5b08ff366b698a262b041b2bb96..bf31824cbeb49ccbe52b81a91edb3c88 } CompleteScriptedPrint(printing_rfh_, std::move(params), std::move(callback)); diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h -index eab82d64b186ca820d7c28a1a1060e95fc67fff8..1292c0050f67c09be87f8fd06026412c816b505d 100644 +index 9f62238a3f5a73219a604061e434c2a0400fba44..e46800600d53b3f0d1357eaa2fccd7d2e7c59251 100644 --- a/chrome/browser/printing/print_view_manager_base.h +++ b/chrome/browser/printing/print_view_manager_base.h @@ -44,6 +44,8 @@ namespace printing { @@ -578,7 +578,7 @@ index eab82d64b186ca820d7c28a1a1060e95fc67fff8..1292c0050f67c09be87f8fd06026412c base::Value::Dict job_settings, std::unique_ptr print_settings, UpdatePrintSettingsCallback callback); -@@ -312,7 +328,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -306,7 +322,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { // Runs `callback` with `params` to reply to ScriptedPrint(). void ScriptedPrintReply(ScriptedPrintCallback callback, int process_id, @@ -588,7 +588,7 @@ index eab82d64b186ca820d7c28a1a1060e95fc67fff8..1292c0050f67c09be87f8fd06026412c // Requests the RenderView to render all the missing pages for the print job. // No-op if no print job is pending. Returns true if at least one page has -@@ -393,8 +410,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { +@@ -387,8 +404,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer { // The current RFH that is printing with a system printing dialog. raw_ptr printing_rfh_ = nullptr; @@ -706,10 +706,10 @@ index 0f535d5dd1db2e538382a91a0cf06f37d6b4961f..8156c74ad9ffeabfc0d87570a2d2ae13 // Tells the browser printing failed. 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 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e7820f1de 100644 +index 8a510d66964572fab9facf34339239ba14028423..73ba3030b38af91e53fa2ac878fbcb5e61dd25c0 100644 --- a/components/printing/renderer/print_render_frame_helper.cc +++ b/components/printing/renderer/print_render_frame_helper.cc -@@ -46,6 +46,7 @@ +@@ -45,6 +45,7 @@ #include "printing/mojom/print.mojom.h" #include "printing/page_number.h" #include "printing/print_job_constants.h" @@ -717,15 +717,14 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e #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" -@@ -1351,7 +1352,6 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { +@@ -1318,14 +1319,14 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { } print_in_progress_ = true; - auto weak_this = weak_ptr_factory_.GetWeakPtr(); - RecordBeforeAfterPrintEventForDebugging(__LINE__); web_frame->DispatchBeforePrintEvent(/*print_client=*/nullptr); -@@ -1359,7 +1359,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { + if (!weak_this) { return; } @@ -735,7 +734,7 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e if (!weak_this) { return; } -@@ -1391,7 +1392,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( +@@ -1356,7 +1357,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver( receivers_.Add(this, std::move(receiver)); } @@ -744,7 +743,7 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr()); if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; -@@ -1407,7 +1408,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { +@@ -1371,7 +1372,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() { // plugin node and print that instead. auto plugin = delegate_->GetPdfElement(frame); @@ -752,8 +751,8 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e + Print(frame, plugin, PrintRequestType::kRegular, silent, std::move(settings)); if (!render_frame_gone_) { - RecordBeforeAfterPrintEventForDebugging(__LINE__); -@@ -1491,7 +1492,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { + frame->DispatchAfterPrintEvent(); +@@ -1452,7 +1453,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() { } Print(frame, print_preview_context_.source_node(), @@ -763,7 +762,7 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e if (render_frame_gone_) { return; } -@@ -1555,6 +1557,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { +@@ -1515,6 +1517,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) { if (ipc_nesting_level_ > kAllowedIpcDepthForPrint) return; @@ -772,7 +771,7 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e print_preview_context_.OnPrintPreview(); #if BUILDFLAG(IS_CHROMEOS_ASH) -@@ -2189,7 +2193,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -2145,7 +2149,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { } Print(duplicate_node.GetDocument().GetFrame(), duplicate_node, @@ -782,7 +781,7 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e // Check if |this| is still valid. if (!weak_this) { return; -@@ -2206,7 +2211,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { +@@ -2161,7 +2166,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, const blink::WebNode& node, @@ -793,7 +792,7 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e // If still not finished with earlier print request simply ignore. if (prep_frame_view_) return; -@@ -2214,7 +2221,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2169,7 +2176,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, FrameReference frame_ref(frame); uint32_t expected_page_count = 0; @@ -802,7 +801,7 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e DidFinishPrinting(PrintingResult::kFailPrintInit); return; // Failed to init print page settings. } -@@ -2233,8 +2240,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, +@@ -2188,8 +2195,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame, print_pages_params_->params->print_scaling_option; auto self = weak_ptr_factory_.GetWeakPtr(); @@ -819,7 +818,7 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e // Check if |this| is still valid. if (!self) return; -@@ -2478,35 +2492,47 @@ void PrintRenderFrameHelper::IPCProcessed() { +@@ -2433,35 +2447,47 @@ void PrintRenderFrameHelper::IPCProcessed() { } } @@ -877,7 +876,7 @@ index 33835f1bd82a2aa2d1efa2574ec52e182d479421..546c2e189b1a304a32ee9b10ef8d515e return false; } -@@ -2611,7 +2637,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser( +@@ -2566,7 +2592,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser( std::move(params), base::BindOnce( [](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output, @@ -928,10 +927,10 @@ index 731b0fa4c0e1b3a5b4ce73d5bf2322767c70f9be..58921e7fdb9c33e21694186f436f409f #if BUILDFLAG(ENABLE_PRINT_PREVIEW) // Set options for print preset from source PDF document. diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn -index 7ed78907d28c0b79914eae27dac3b3b5184f1540..224a6884ef5070efe1a51fdf1c24662388288432 100644 +index aeda95912420895271ecdf1883f04da07b32296e..2f165461b7326b4e426d4b2552766896bb273c29 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn -@@ -2916,8 +2916,9 @@ source_set("browser") { +@@ -2914,8 +2914,9 @@ source_set("browser") { "//ppapi/shared_impl", ] 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 3ac785f7dfcee..b173ed77cfede 100644 --- a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch +++ b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch @@ -30,10 +30,10 @@ index fe010b1f001130fbdeaf4ef9ce7798e4baf958b5..28f1305f439be7f669e482ac0e4804c0 // 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 3e0ed454b09a3d23570479a390e3dff92cbf83bc..b637d621504667c89d13e1943e28c8a6c77f95fc 100644 +index 5e09ede19e2b54e806ae212cccb9c43c93439fbc..23bb2e702405d25df08d3c3bd194cca9f4857757 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc -@@ -2113,6 +2113,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) { +@@ -2120,6 +2120,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) { if (view_) { view_->UpdateCursor(cursor); } @@ -44,10 +44,10 @@ index 3e0ed454b09a3d23570479a390e3dff92cbf83bc..b637d621504667c89d13e1943e28c8a6 void RenderWidgetHostImpl::ShowContextMenuAtPoint( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 94d7caadca3d07fe2886715bc9b5eac6a7dfbd46..b01b8386fd519c239a3525cae9cbda58ea99a176 100644 +index 278e45752fe57ea81a4d825d9dd528ca67265808..e3d811b00c799fba8aa9d52a9b437618e579e169 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4911,6 +4911,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { +@@ -4916,6 +4916,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { return text_input_manager_.get(); } @@ -60,7 +60,7 @@ index 94d7caadca3d07fe2886715bc9b5eac6a7dfbd46..b01b8386fd519c239a3525cae9cbda58 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 0bdd28ec245e984c83bde8114c545d69294fbfce..4a82e5536bed5b49dce416221e749acd1550a47c 100644 +index f4057f0dcbae2b0049267d27ac76f4ade77ce8dc..bb37b5101b6318b7b5c30097b501960399c77bb3 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -994,6 +994,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, diff --git a/patches/chromium/render_widget_host_view_base.patch b/patches/chromium/render_widget_host_view_base.patch index cdbb026233d4f..cead7d2a3c4c4 100644 --- a/patches/chromium/render_widget_host_view_base.patch +++ b/patches/chromium/render_widget_host_view_base.patch @@ -24,7 +24,7 @@ index c099a8701b7e0451207c21e6ebbe26eac65f0164..8a61b858c0c8a3fdd8522821a14fe369 const blink::WebMouseEvent& event, const ui::LatencyInfo& latency) { diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h -index eed8db485e54bb906f3d640f9c6ebd9a58b04c09..f0747ab5597ca286ab29bdd6518784634d740708 100644 +index 22e67e69dc33a9372530783a3fd26523a4cdff01..24937e4173605c6e0802b7e37a0472704da6d99a 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -25,8 +25,11 @@ @@ -70,7 +70,7 @@ index eed8db485e54bb906f3d640f9c6ebd9a58b04c09..f0747ab5597ca286ab29bdd651878463 // This only needs to be overridden by RenderWidgetHostViewBase subclasses // that handle content embedded within other RenderWidgetHostViews. gfx::PointF TransformPointToRootCoordSpaceF( -@@ -325,6 +333,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -330,6 +338,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { virtual void ProcessGestureEvent(const blink::WebGestureEvent& event, const ui::LatencyInfo& latency); diff --git a/patches/chromium/resource_file_conflict.patch b/patches/chromium/resource_file_conflict.patch index eb599229e6d95..38f3f1d4e2cc4 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 61f07f736047732cc631c713fafa507df48ebb90..7e99d7493ac1f9281668eb3283f7475769245021 100644 +index 4e128467f4e2e7ff17909d5d5176b867c188aa0b..07a98cf6892e7e1a81f15ccfd349012784ecf2b0 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -1616,7 +1616,7 @@ if (is_chrome_branded && !is_android) { +@@ -1613,7 +1613,7 @@ if (is_chrome_branded && !is_android) { } } @@ -64,7 +64,7 @@ index 61f07f736047732cc631c713fafa507df48ebb90..7e99d7493ac1f9281668eb3283f74757 chrome_paks("packed_resources") { if (is_mac) { output_dir = "$root_gen_dir/repack" -@@ -1645,6 +1645,12 @@ if (!is_android) { +@@ -1642,6 +1642,12 @@ if (!is_android) { } } diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index 22cd93a5f8e85..f307645972a6b 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 1165a7e81de03921ab774006cfb06f928cb2632e..36142abc8d5322e2408b186560ff34b1b268b7b9 100644 +index 3552da0688699735fdfb9ecab0d6adcfcc4061dd..c240d818b3a8f93ccbf77cb74e48d271c82fa08a 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -1915,9 +1915,15 @@ bool RenderProcessHostImpl::Init() { diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index 4e94bb6b1d366..9ca3f93a2308e 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 c7c515bf753a4a9851b1d68c206b9c7487f02578..3fef597d18025bd35b4f7af105c6907602958223 100644 +index 2f2e089817f8b9392f0a793c3702d04f9ad5b97b..8d5a0e6aa6ea3a0965ed6abb76368d1f8e3ea91e 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3323,6 +3323,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3324,6 +3324,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 c7c515bf753a4a9851b1d68c206b9c7487f02578..3fef597d18025bd35b4f7af105c69076 std::unique_ptr delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -3333,6 +3340,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, +@@ -3334,6 +3341,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params, view_ = CreateWebContentsView(this, std::move(delegate), &render_view_host_delegate_view_); } diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index d174734908333..e6b29891ec74d 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -14,10 +14,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 4da6272864fd6709dcb56b9561ec86f4b0e037be..03d913c1ab176dfb330ba3192daeaed3e212c131 100644 +index 01eb116b51037bff5da7a87d119b78387f5e72c6..7ab5609215ce352b2595b4953e1b9ca027c62b47 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -7286,6 +7286,17 @@ void RenderFrameHostImpl::EnterFullscreen( +@@ -7281,6 +7281,17 @@ void RenderFrameHostImpl::EnterFullscreen( } } diff --git a/patches/chromium/worker_context_will_destroy.patch b/patches/chromium/worker_context_will_destroy.patch index a0be1e00bdd8c..d98ca99f93dcf 100644 --- a/patches/chromium/worker_context_will_destroy.patch +++ b/patches/chromium/worker_context_will_destroy.patch @@ -26,10 +26,10 @@ index a4130ad4dc8158f8256b55fdd87f577687135626..3139aa65807cee23f0e8dbc85243566e // An empty URL is returned if the URL is not overriden. virtual GURL OverrideFlashEmbedWithHTML(const GURL& url); diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc -index 91bf7695e6cc5d7a3179cb185dd983dc8871ba8b..e7c75c4e7a62700257e5379fca38b166c8115dc1 100644 +index 321cfcb54a8dd80b12c741c9a8f20394aa004402..6f548767407d2e56ec259edf6d5103306e36233d 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -795,6 +795,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { +@@ -794,6 +794,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread(); } @@ -43,7 +43,7 @@ index 91bf7695e6cc5d7a3179cb185dd983dc8871ba8b..e7c75c4e7a62700257e5379fca38b166 const v8::Local& worker) { GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h -index 587565fa2fd5d677f77ed1a44cb39a9e3007c221..9b234f2ea8daa9300c2a41f7001b140c52ac5c0f 100644 +index 4813c8ce4525f047b45aab0bd02135d5cf73f1e2..5e54ca5d408716dc058287efceab4c8924344c54 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h @@ -173,6 +173,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { @@ -55,7 +55,7 @@ index 587565fa2fd5d677f77ed1a44cb39a9e3007c221..9b234f2ea8daa9300c2a41f7001b140c const blink::WebSecurityOrigin& script_origin) override; blink::ProtocolHandlerSecurityLevel GetProtocolHandlerSecurityLevel() diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h -index d5190a687527788319cedadafbb169b3090f7b7c..a7617a5fa849ac2dd516c2348126b3ade8592443 100644 +index 132096c44cf32d32f630a3d3ec941b1d79e4bb0e..f927a042a98cc4a94fa1a7c82346625f44af0c24 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h @@ -616,6 +616,7 @@ class BLINK_PLATFORM_EXPORT Platform { 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 5a0cb5f4634fc..ff24fb5d8e5fc 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 @@ -35,10 +35,10 @@ index 3139aa65807cee23f0e8dbc85243566ef9de89b9..19707edb1283f2432f3c0059f80fabd5 // from the worker thread. virtual void WillDestroyWorkerContextOnWorkerThread( diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc -index e7c75c4e7a62700257e5379fca38b166c8115dc1..7be8e368b29f0d4d48faf060c5d7ad2cc451186d 100644 +index 6f548767407d2e56ec259edf6d5103306e36233d..c4b490868e5c941461d422bbea3047438d6b476a 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -807,6 +807,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated( +@@ -806,6 +806,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated( worker); } @@ -52,7 +52,7 @@ index e7c75c4e7a62700257e5379fca38b166c8115dc1..7be8e368b29f0d4d48faf060c5d7ad2c const blink::WebSecurityOrigin& script_origin) { return GetContentClient()->renderer()->AllowScriptExtensionForServiceWorker( diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h -index 9b234f2ea8daa9300c2a41f7001b140c52ac5c0f..7b666ae7276f6393b4ce7390e811c0c4ccbc74e1 100644 +index 5e54ca5d408716dc058287efceab4c8924344c54..1ecc1079ecd2345138cb1a11498b6f721f611363 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h @@ -173,6 +173,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { @@ -65,7 +65,7 @@ index 9b234f2ea8daa9300c2a41f7001b140c52ac5c0f..7b666ae7276f6393b4ce7390e811c0c4 bool AllowScriptExtensionForServiceWorker( const blink::WebSecurityOrigin& script_origin) override; diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h -index a7617a5fa849ac2dd516c2348126b3ade8592443..6ab4740bd3719202af7c82e5e8eefbbe6f09d187 100644 +index f927a042a98cc4a94fa1a7c82346625f44af0c24..80c5368efbef0bde421e85b3a0336b179e50d116 100644 --- a/third_party/blink/public/platform/platform.h +++ b/third_party/blink/public/platform/platform.h @@ -616,6 +616,8 @@ class BLINK_PLATFORM_EXPORT Platform { diff --git a/patches/v8/build_gn.patch b/patches/v8/build_gn.patch index 0da610a433e60..5a3214bc0a783 100644 --- a/patches/v8/build_gn.patch +++ b/patches/v8/build_gn.patch @@ -9,10 +9,10 @@ necessary for native modules to load. Also change visibility on mksnapshot in order to target mksnapshot for mksnapshot zip. diff --git a/BUILD.gn b/BUILD.gn -index ca081a790959d22b12f10e9c08f9acbc339e7ed7..06465300718a74d089c2281f60bb63735657e3bd 100644 +index 46118001c123334c68e852a809f3e15338a40684..7a62143f763434c7f11b5fdd2d1ee682e99e400c 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -739,7 +739,7 @@ config("internal_config") { +@@ -747,7 +747,7 @@ config("internal_config") { ":cppgc_header_features", ] @@ -21,7 +21,7 @@ index ca081a790959d22b12f10e9c08f9acbc339e7ed7..06465300718a74d089c2281f60bb6373 defines += [ "BUILDING_V8_SHARED" ] } -@@ -6711,7 +6711,7 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -6727,7 +6727,7 @@ if (current_toolchain == v8_generator_toolchain) { "src/interpreter/bytecodes.h", ] @@ -30,7 +30,7 @@ index ca081a790959d22b12f10e9c08f9acbc339e7ed7..06465300718a74d089c2281f60bb6373 deps = [ ":v8_libbase", -@@ -6723,7 +6723,6 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -6739,7 +6739,6 @@ if (current_toolchain == v8_generator_toolchain) { if (current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { diff --git a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch index 70063fe419b85..417f9b876b889 100644 --- a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch +++ b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch @@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not contain any standard C++ library exports (e.g. `std::ostringstream`). diff --git a/BUILD.gn b/BUILD.gn -index 06465300718a74d089c2281f60bb63735657e3bd..d691bf98c074693c692f4a9ad58098bc1b163c24 100644 +index 7a62143f763434c7f11b5fdd2d1ee682e99e400c..5dd9b3315dd82a8417fdd492ecd0b1fdc6970914 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -739,6 +739,10 @@ config("internal_config") { +@@ -747,6 +747,10 @@ config("internal_config") { ":cppgc_header_features", ] diff --git a/shell/browser/osr/osr_render_widget_host_view.cc b/shell/browser/osr/osr_render_widget_host_view.cc index 06a36eb14d0e2..a60bbdcf84131 100644 --- a/shell/browser/osr/osr_render_widget_host_view.cc +++ b/shell/browser/osr/osr_render_widget_host_view.cc @@ -391,6 +391,11 @@ void OffScreenRenderWidgetHostView::TakeFallbackContentFrom( } } +void OffScreenRenderWidgetHostView:: + InvalidateLocalSurfaceIdAndAllocationGroup() { + compositor_allocator_.Invalidate(/*also_invalidate_allocation_group=*/true); +} + void OffScreenRenderWidgetHostView::ResetFallbackToFirstNavigationSurface() { GetDelegatedFrameHost()->ResetFallbackToFirstNavigationSurface(); } diff --git a/shell/browser/osr/osr_render_widget_host_view.h b/shell/browser/osr/osr_render_widget_host_view.h index 122779eb68953..6d95a6424004e 100644 --- a/shell/browser/osr/osr_render_widget_host_view.h +++ b/shell/browser/osr/osr_render_widget_host_view.h @@ -119,6 +119,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase, // content::RenderWidgetHostViewBase: + void InvalidateLocalSurfaceIdAndAllocationGroup() override; void ResetFallbackToFirstNavigationSurface() override; void InitAsPopup(content::RenderWidgetHostView* parent_host_view, const gfx::Rect& bounds, From e87641a2cf6fe357e187df1f1173653737018f32 Mon Sep 17 00:00:00 2001 From: Sergei Chestakov Date: Wed, 16 Aug 2023 06:26:02 -0400 Subject: [PATCH 70/93] docs: fix typo in open-url API docs (#39513) * Fix typo in open-url API docs * Update app.md --- docs/api/app.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/api/app.md b/docs/api/app.md index 23cf19e5f4fb4..1364ed2664f87 100755 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -128,9 +128,8 @@ Emitted when the user wants to open a URL with the application. Your application set `NSPrincipalClass` to `AtomApplication`. As with the `open-file` event, be sure to register a listener for the `open-url` -event early in your application startup to detect if the the application being -is being opened to handle a URL. If you register the listener in response to a -`ready` event, you'll miss URLs that trigger the launch of your application. +event early in your application startup to detect if the application is being opened to handle a URL. +If you register the listener in response to a `ready` event, you'll miss URLs that trigger the launch of your application. ### Event: 'activate' _macOS_ From 2830b95948d603c5fc813a40ef85b6c8e9cb8592 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 16 Aug 2023 13:28:29 +0200 Subject: [PATCH 71/93] fix: crash when calling `BrowserWindow.moveTop()` on modal children (#39499) fix: crash when calling moveTop() on modal children --- shell/browser/native_window_mac.mm | 7 ++++--- spec/api-browser-window-spec.ts | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 7c44cfbed18a1..b6ce683db3d82 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -812,7 +812,7 @@ void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) { if (!webrtc::GetWindowOwnerPid(window_id)) return false; - if (!parent()) { + if (!parent() || is_modal()) { [window_ orderWindow:NSWindowAbove relativeTo:window_id]; } else { NSWindow* other_window = [NSApp windowWithWindowNumber:window_id]; @@ -823,10 +823,11 @@ void ReorderChildWindowAbove(NSWindow* child_window, NSWindow* other_window) { } void NativeWindowMac::MoveTop() { - if (!parent()) + if (!parent() || is_modal()) { [window_ orderWindow:NSWindowAbove relativeTo:0]; - else + } else { ReorderChildWindowAbove(window_, nullptr); + } } void NativeWindowMac::SetResizable(bool resizable) { diff --git a/spec/api-browser-window-spec.ts b/spec/api-browser-window-spec.ts index bf7ddada8508b..c2057bce7b32a 100644 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -1283,6 +1283,8 @@ describe('BrowserWindow module', () => { }); describe('BrowserWindow.moveTop()', () => { + afterEach(closeAllWindows); + it('should not steal focus', async () => { const posDelta = 50; const wShownInactive = once(w, 'show'); @@ -1324,6 +1326,15 @@ describe('BrowserWindow module', () => { await closeWindow(otherWindow, { assertNotWindows: false }); expect(BrowserWindow.getAllWindows()).to.have.lengthOf(1); }); + + it('should not crash when called on a modal child window', async () => { + const shown = once(w, 'show'); + w.show(); + await shown; + + const child = new BrowserWindow({ modal: true, parent: w }); + expect(() => { child.moveTop(); }).to.not.throw(); + }); }); describe('BrowserWindow.moveAbove(mediaSourceId)', () => { From b0202bd258d6b6bca13dcd6746b5e7b290491407 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Wed, 16 Aug 2023 14:05:39 -0400 Subject: [PATCH 72/93] build: fixup libcxx zip (#39536) --- build/zip_libcxx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/zip_libcxx.py b/build/zip_libcxx.py index cf71cc1c27d9c..35cc30a78fef4 100644 --- a/build/zip_libcxx.py +++ b/build/zip_libcxx.py @@ -30,8 +30,8 @@ def get_object_files(base_path, archive_name): def main(argv): dist_zip, = argv out_dir = os.path.dirname(dist_zip) - base_path_libcxx = os.path.join(out_dir, 'obj/third_party/libc++') - base_path_libcxxabi = os.path.join(out_dir, 'obj/third_party/libc++abi') + base_path_libcxx = os.path.join(out_dir, 'obj/buildtools/third_party/libc++') + base_path_libcxxabi = os.path.join(out_dir, 'obj/buildtools/third_party/libc++abi') object_files_libcxx = get_object_files(base_path_libcxx, 'libc++.a') object_files_libcxxabi = get_object_files(base_path_libcxxabi, 'libc++abi.a') with zipfile.ZipFile( From d207c35b849312a758140248215d57328c9bcdfe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:06:19 -0400 Subject: [PATCH 73/93] build: update appveyor image to latest version - e-118.0.5949.0. (#39524) build: update appveyor image to latest version Co-authored-by: jkleinsc --- appveyor-woa.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 6bf813b9e5624..68daad4cf4ff3 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-117.0.5921.0 +image: e-118.0.5949.0 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default diff --git a/appveyor.yml b/appveyor.yml index 89d45b84c8b7a..f9f17eae66491 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -29,7 +29,7 @@ version: 1.0.{build} build_cloud: electronhq-16-core -image: e-117.0.5921.0 +image: e-118.0.5949.0 environment: GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache ELECTRON_OUT_DIR: Default From 10d5dad56cfc104528c87f52ade98b5ca613e65c Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Wed, 16 Aug 2023 11:46:16 -0700 Subject: [PATCH 74/93] build: update NMV to 118 (#39538) --- build/args/all.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/args/all.gn b/build/args/all.gn index e9e2d01120eeb..c63574b7ac84f 100644 --- a/build/args/all.gn +++ b/build/args/all.gn @@ -2,7 +2,7 @@ is_electron_build = true root_extra_deps = [ "//electron" ] # Registry of NMVs --> https://github.com/nodejs/node/blob/main/doc/abi_version_registry.json -node_module_version = 116 +node_module_version = 118 v8_promise_internal_field_count = 1 v8_embedder_string = "-electron.0" From a719de685881d4d47b0f94ec7badfa66f7d21e7b Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 17 Aug 2023 01:52:15 +0200 Subject: [PATCH 75/93] docs: add missing webview `render-process-gone` event (#39494) docs: add mising webview 'render-process-gone' event --- docs/api/app.md | 13 +------------ .../structures/render-process-gone-details.md | 13 +++++++++++++ docs/api/web-contents.md | 13 +------------ docs/api/webview-tag.md | 17 +++++++++++++++-- filenames.auto.gni | 1 + 5 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 docs/api/structures/render-process-gone-details.md diff --git a/docs/api/app.md b/docs/api/app.md index 1364ed2664f87..954da5f81f0bf 100755 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -412,18 +412,7 @@ Returns: * `event` Event * `webContents` [WebContents](web-contents.md) -* `details` Object - * `reason` string - The reason the render process is gone. Possible values: - * `clean-exit` - Process exited with an exit code of zero - * `abnormal-exit` - Process exited with a non-zero exit code - * `killed` - Process was sent a SIGTERM or otherwise killed externally - * `crashed` - Process crashed - * `oom` - Process ran out of memory - * `launch-failed` - Process never successfully launched - * `integrity-failure` - Windows code integrity checks failed - * `exitCode` Integer - The exit code of the process, unless `reason` is - `launch-failed`, in which case `exitCode` will be a platform-specific - launch failure error code. +* `details` [RenderProcessGoneDetails](structures/render-process-gone-details.md) Emitted when the renderer process unexpectedly disappears. This is normally because it was crashed or killed. diff --git a/docs/api/structures/render-process-gone-details.md b/docs/api/structures/render-process-gone-details.md new file mode 100644 index 0000000000000..e48800a5b87d7 --- /dev/null +++ b/docs/api/structures/render-process-gone-details.md @@ -0,0 +1,13 @@ +# RenderProcessGoneDetails Object + +* `reason` string - The reason the render process is gone. Possible values: + * `clean-exit` - Process exited with an exit code of zero + * `abnormal-exit` - Process exited with a non-zero exit code + * `killed` - Process was sent a SIGTERM or otherwise killed externally + * `crashed` - Process crashed + * `oom` - Process ran out of memory + * `launch-failed` - Process never successfully launched + * `integrity-failure` - Windows code integrity checks failed +* `exitCode` Integer - The exit code of the process, unless `reason` is + `launch-failed`, in which case `exitCode` will be a platform-specific + launch failure error code. diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index d4aac970368eb..de9c66ed5e9b8 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -479,18 +479,7 @@ checking `reason === 'killed'` when you switch to that event. Returns: * `event` Event -* `details` Object - * `reason` string - The reason the render process is gone. Possible values: - * `clean-exit` - Process exited with an exit code of zero - * `abnormal-exit` - Process exited with a non-zero exit code - * `killed` - Process was sent a SIGTERM or otherwise killed externally - * `crashed` - Process crashed - * `oom` - Process ran out of memory - * `launch-failed` - Process never successfully launched - * `integrity-failure` - Windows code integrity checks failed - * `exitCode` Integer - The exit code of the process, unless `reason` is - `launch-failed`, in which case `exitCode` will be a platform-specific - launch failure error code. +* `details` [RenderProcessGoneDetails](structures/render-process-gone-details.md) Emitted when the renderer process unexpectedly disappears. This is normally because it was crashed or killed. diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index 60927b5ce3cdf..340365b78c8f8 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -983,9 +983,22 @@ ipcRenderer.on('ping', () => { }) ``` -### Event: 'crashed' +### Event: 'crashed' _Deprecated_ -Fired when the renderer process is crashed. +Fired when the renderer process crashes or is killed. + +**Deprecated:** This event is superceded by the `render-process-gone` event +which contains more information about why the render process disappeared. It +isn't always because it crashed. + +### Event: 'render-process-gone' + +Returns: + +* `details` [RenderProcessGoneDetails](structures/render-process-gone-details.md) + +Fired when the renderer process unexpectedly disappears. This is normally +because it was crashed or killed. ### Event: 'plugin-crashed' diff --git a/filenames.auto.gni b/filenames.auto.gni index d675196e45dcd..d7aeead8c38e6 100644 --- a/filenames.auto.gni +++ b/filenames.auto.gni @@ -115,6 +115,7 @@ auto_filenames = { "docs/api/structures/protocol-response.md", "docs/api/structures/rectangle.md", "docs/api/structures/referrer.md", + "docs/api/structures/render-process-gone-details.md", "docs/api/structures/resolved-endpoint.md", "docs/api/structures/resolved-host.md", "docs/api/structures/scrubber-item.md", From 4640b66d6d0f8aa82c920f5e4fe2e92bb555be7e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 16 Aug 2023 23:06:24 -0500 Subject: [PATCH 76/93] fix: destruction order of js env fields (#39521) isolate_ depends on isolate_holder_ and so must be destroyed first. --- shell/browser/javascript_environment.cc | 7 ++++--- shell/browser/javascript_environment.h | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/shell/browser/javascript_environment.cc b/shell/browser/javascript_environment.cc index 4293871ad169d..c176a589c7217 100644 --- a/shell/browser/javascript_environment.cc +++ b/shell/browser/javascript_environment.cc @@ -104,9 +104,10 @@ gin::IsolateHolder CreateIsolateHolder(v8::Isolate* isolate) { JavascriptEnvironment::JavascriptEnvironment(uv_loop_t* event_loop, bool setup_wasm_streaming) - : isolate_(Initialize(event_loop, setup_wasm_streaming)), - isolate_holder_(CreateIsolateHolder(isolate_)), - locker_(isolate_) { + : isolate_holder_{CreateIsolateHolder( + Initialize(event_loop, setup_wasm_streaming))}, + isolate_{isolate_holder_.isolate()}, + locker_{isolate_} { isolate_->Enter(); v8::HandleScope scope(isolate_); diff --git a/shell/browser/javascript_environment.h b/shell/browser/javascript_environment.h index 459269f90ead9..bb38e3594592d 100644 --- a/shell/browser/javascript_environment.h +++ b/shell/browser/javascript_environment.h @@ -43,8 +43,12 @@ class JavascriptEnvironment { v8::Isolate* Initialize(uv_loop_t* event_loop, bool setup_wasm_streaming); std::unique_ptr platform_; - raw_ptr isolate_; gin::IsolateHolder isolate_holder_; + + // owned-by: isolate_holder_ + const raw_ptr isolate_; + + // depends-on: isolate_ v8::Locker locker_; std::unique_ptr microtasks_runner_; From 57941c322eec0cec2ba0c899d0ea825795ee746c Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 17 Aug 2023 11:02:03 +0200 Subject: [PATCH 77/93] docs: note macOS bounds Tray offset (#39512) * docs: note macOS bounds Tray offset * Update docs/api/browser-window.md Co-authored-by: David Sanders --------- Co-authored-by: David Sanders --- docs/api/browser-window.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index 7d927c29c33ea..d5d61e47e963a 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -820,10 +820,14 @@ win.setBounds({ width: 100 }) console.log(win.getBounds()) ``` +**Note:** On macOS, the y-coordinate value cannot be smaller than the [Tray](tray.md) height. The tray height has changed over time and depends on the operating system, but is between 20-40px. Passing a value lower than the tray height will result in a window that is flush to the tray. + #### `win.getBounds()` Returns [`Rectangle`](structures/rectangle.md) - The `bounds` of the window as `Object`. +**Note:** On macOS, the y-coordinate value returned will be at minimum the [Tray](tray.md) height. For example, calling `win.setBounds({ x: 25, y: 20, width: 800, height: 600 })` with a tray height of 38 means that `win.getBounds()` will return `{ x: 25, y: 38, width: 800, height: 600 }`. + #### `win.getBackgroundColor()` Returns `string` - Gets the background color of the window in Hex (`#RRGGBB`) format. From 725366b650af336ca834bffa85e20f213a25e0b1 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 17 Aug 2023 14:17:55 +0200 Subject: [PATCH 78/93] feat: allow headers to be sent with `webContents.downloadURL()` (#39455) feat: allow headers to be sent with webContents.downloadURL() --- docs/api/session.md | 2 +- docs/api/web-contents.md | 4 +- docs/api/webview-tag.md | 4 +- .../browser/api/electron_api_web_contents.cc | 19 +- shell/browser/api/electron_api_web_contents.h | 2 +- spec/api-session-spec.ts | 534 +++++++++++------- 6 files changed, 344 insertions(+), 221 deletions(-) diff --git a/docs/api/session.md b/docs/api/session.md index d157e3464a81b..d13ccf009c35f 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -1311,7 +1311,7 @@ The API will generate a [DownloadItem](download-item.md) that can be accessed with the [will-download](#event-will-download) event. **Note:** This does not perform any security checks that relate to a page's origin, -unlike [`webContents.downloadURL`](web-contents.md#contentsdownloadurlurl). +unlike [`webContents.downloadURL`](web-contents.md#contentsdownloadurlurl-options). #### `ses.createInterruptedDownload(options)` diff --git a/docs/api/web-contents.md b/docs/api/web-contents.md index de9c66ed5e9b8..715885369a78f 100644 --- a/docs/api/web-contents.md +++ b/docs/api/web-contents.md @@ -1046,9 +1046,11 @@ const win = new BrowserWindow() win.loadFile('src/index.html') ``` -#### `contents.downloadURL(url)` +#### `contents.downloadURL(url[, options])` * `url` string +* `options` Object (optional) + * `headers` Record (optional) - HTTP request headers. Initiates a download of the resource at `url` without navigating. The `will-download` event of `session` will be triggered. diff --git a/docs/api/webview-tag.md b/docs/api/webview-tag.md index 340365b78c8f8..825921b9be591 100644 --- a/docs/api/webview-tag.md +++ b/docs/api/webview-tag.md @@ -280,9 +280,11 @@ if the page fails to load (see Loads the `url` in the webview, the `url` must contain the protocol prefix, e.g. the `http://` or `file://`. -### `.downloadURL(url)` +### `.downloadURL(url[, options])` * `url` string +* `options` Object (optional) + * `headers` Record (optional) - HTTP request headers. Initiates a download of the resource at `url` without navigating. diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 993861fe5813a..069b777856bde 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -2444,12 +2444,25 @@ void WebContents::ReloadIgnoringCache() { /* check_for_repost */ true); } -void WebContents::DownloadURL(const GURL& url) { - auto* browser_context = web_contents()->GetBrowserContext(); - auto* download_manager = browser_context->GetDownloadManager(); +void WebContents::DownloadURL(const GURL& url, gin::Arguments* args) { + std::map headers; + gin_helper::Dictionary options; + if (args->GetNext(&options)) { + if (options.Has("headers") && !options.Get("headers", &headers)) { + args->ThrowTypeError("Invalid value for headers - must be an object"); + return; + } + } + std::unique_ptr download_params( content::DownloadRequestUtils::CreateDownloadForWebContentsMainFrame( web_contents(), url, MISSING_TRAFFIC_ANNOTATION)); + for (const auto& [name, value] : headers) { + download_params->add_request_header(name, value); + } + + auto* download_manager = + web_contents()->GetBrowserContext()->GetDownloadManager(); download_manager->DownloadUrl(std::move(download_params)); } diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index ae3d9ecd19af3..d0c65fd4b4bc1 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -169,7 +169,7 @@ class WebContents : public ExclusiveAccessContext, void LoadURL(const GURL& url, const gin_helper::Dictionary& options); void Reload(); void ReloadIgnoringCache(); - void DownloadURL(const GURL& url); + void DownloadURL(const GURL& url, gin::Arguments* args); GURL GetURL() const; std::u16string GetTitle() const; bool IsLoading() const; diff --git a/spec/api-session-spec.ts b/spec/api-session-spec.ts index 592d43eb6982e..614ec6cba6ad3 100644 --- a/spec/api-session-spec.ts +++ b/spec/api-session-spec.ts @@ -827,277 +827,383 @@ describe('session module', () => { fs.unlinkSync(downloadFilePath); }; - it('can download using session.downloadURL', (done) => { - session.defaultSession.once('will-download', function (e, item) { - item.savePath = downloadFilePath; - item.on('done', function (e, state) { - try { - assertDownload(state, item); - done(); - } catch (e) { - done(e); - } + describe('session.downloadURL', () => { + it('can perform a download', (done) => { + session.defaultSession.once('will-download', function (e, item) { + item.savePath = downloadFilePath; + item.on('done', function (e, state) { + try { + assertDownload(state, item); + done(); + } catch (e) { + done(e); + } + }); }); + session.defaultSession.downloadURL(`${url}:${port}`); }); - session.defaultSession.downloadURL(`${url}:${port}`); - }); - it('can download using session.downloadURL with a valid auth header', async () => { - const server = http.createServer((req, res) => { - const { authorization } = req.headers; - if (!authorization || authorization !== 'Basic i-am-an-auth-header') { - res.statusCode = 401; - res.setHeader('WWW-Authenticate', 'Basic realm="Restricted"'); - res.end(); - } else { - res.writeHead(200, { - 'Content-Length': mockPDF.length, - 'Content-Type': 'application/pdf', - 'Content-Disposition': req.url === '/?testFilename' ? 'inline' : contentDisposition - }); - res.end(mockPDF); - } - }); + it('can perform a download with a valid auth header', async () => { + const server = http.createServer((req, res) => { + const { authorization } = req.headers; + if (!authorization || authorization !== 'Basic i-am-an-auth-header') { + res.statusCode = 401; + res.setHeader('WWW-Authenticate', 'Basic realm="Restricted"'); + res.end(); + } else { + res.writeHead(200, { + 'Content-Length': mockPDF.length, + 'Content-Type': 'application/pdf', + 'Content-Disposition': req.url === '/?testFilename' ? 'inline' : contentDisposition + }); + res.end(mockPDF); + } + }); - const { port } = await listen(server); + const { port } = await listen(server); - const downloadDone: Promise = new Promise((resolve) => { - session.defaultSession.once('will-download', (e, item) => { - item.savePath = downloadFilePath; - item.on('done', () => { - try { - resolve(item); - } catch {} + const downloadDone: Promise = new Promise((resolve) => { + session.defaultSession.once('will-download', (e, item) => { + item.savePath = downloadFilePath; + item.on('done', () => { + try { + resolve(item); + } catch { } + }); }); }); + + session.defaultSession.downloadURL(`${url}:${port}`, { + headers: { + Authorization: 'Basic i-am-an-auth-header' + } + }); + + const item = await downloadDone; + expect(item.getState()).to.equal('completed'); + expect(item.getFilename()).to.equal('mock.pdf'); + expect(item.getMimeType()).to.equal('application/pdf'); + expect(item.getReceivedBytes()).to.equal(mockPDF.length); + expect(item.getTotalBytes()).to.equal(mockPDF.length); + expect(item.getContentDisposition()).to.equal(contentDisposition); }); - session.defaultSession.downloadURL(`${url}:${port}`, { - headers: { - Authorization: 'Basic i-am-an-auth-header' - } + it('throws when called with invalid headers', () => { + expect(() => { + session.defaultSession.downloadURL(`${url}:${port}`, { + // @ts-ignore this line is intentionally incorrect + headers: 'i-am-a-bad-header' + }); + }).to.throw(/Invalid value for headers - must be an object/); }); - const item = await downloadDone; - expect(item.getState()).to.equal('completed'); - expect(item.getFilename()).to.equal('mock.pdf'); - expect(item.getMimeType()).to.equal('application/pdf'); - expect(item.getReceivedBytes()).to.equal(mockPDF.length); - expect(item.getTotalBytes()).to.equal(mockPDF.length); - expect(item.getContentDisposition()).to.equal(contentDisposition); - }); + it('correctly handles a download with an invalid auth header', async () => { + const server = http.createServer((req, res) => { + const { authorization } = req.headers; + if (!authorization || authorization !== 'Basic i-am-an-auth-header') { + res.statusCode = 401; + res.setHeader('WWW-Authenticate', 'Basic realm="Restricted"'); + res.end(); + } else { + res.writeHead(200, { + 'Content-Length': mockPDF.length, + 'Content-Type': 'application/pdf', + 'Content-Disposition': req.url === '/?testFilename' ? 'inline' : contentDisposition + }); + res.end(mockPDF); + } + }); + + const { port } = await listen(server); + + const downloadFailed: Promise = new Promise((resolve) => { + session.defaultSession.once('will-download', (_, item) => { + item.savePath = downloadFilePath; + item.on('done', (e, state) => { + console.log(state); + try { + resolve(item); + } catch { } + }); + }); + }); - it('throws when session.downloadURL is called with invalid headers', () => { - expect(() => { session.defaultSession.downloadURL(`${url}:${port}`, { - // @ts-ignore this line is intentionally incorrect - headers: 'i-am-a-bad-header' + headers: { + Authorization: 'wtf-is-this' + } }); - }).to.throw(/Invalid value for headers - must be an object/); - }); - it('can download using session.downloadURL with an invalid auth header', async () => { - const server = http.createServer((req, res) => { - const { authorization } = req.headers; - if (!authorization || authorization !== 'Basic i-am-an-auth-header') { - res.statusCode = 401; - res.setHeader('WWW-Authenticate', 'Basic realm="Restricted"'); - res.end(); - } else { - res.writeHead(200, { - 'Content-Length': mockPDF.length, - 'Content-Type': 'application/pdf', - 'Content-Disposition': req.url === '/?testFilename' ? 'inline' : contentDisposition - }); - res.end(mockPDF); - } + const item = await downloadFailed; + expect(item.getState()).to.equal('interrupted'); + expect(item.getReceivedBytes()).to.equal(0); + expect(item.getTotalBytes()).to.equal(0); }); + }); - const { port } = await listen(server); - - const downloadFailed: Promise = new Promise((resolve) => { - session.defaultSession.once('will-download', (_, item) => { + describe('webContents.downloadURL', () => { + it('can perform a download', (done) => { + const w = new BrowserWindow({ show: false }); + w.webContents.session.once('will-download', function (e, item) { item.savePath = downloadFilePath; - item.on('done', (e, state) => { - console.log(state); + item.on('done', function (e, state) { try { - resolve(item); - } catch {} + assertDownload(state, item); + done(); + } catch (e) { + done(e); + } }); }); + w.webContents.downloadURL(`${url}:${port}`); }); - session.defaultSession.downloadURL(`${url}:${port}`, { - headers: { - Authorization: 'wtf-is-this' - } - }); + it('can perform a download with a valid auth header', async () => { + const server = http.createServer((req, res) => { + const { authorization } = req.headers; + if (!authorization || authorization !== 'Basic i-am-an-auth-header') { + res.statusCode = 401; + res.setHeader('WWW-Authenticate', 'Basic realm="Restricted"'); + res.end(); + } else { + res.writeHead(200, { + 'Content-Length': mockPDF.length, + 'Content-Type': 'application/pdf', + 'Content-Disposition': req.url === '/?testFilename' ? 'inline' : contentDisposition + }); + res.end(mockPDF); + } + }); - const item = await downloadFailed; - expect(item.getState()).to.equal('interrupted'); - expect(item.getReceivedBytes()).to.equal(0); - expect(item.getTotalBytes()).to.equal(0); - }); + const { port } = await listen(server); - it('can download using WebContents.downloadURL', (done) => { - const w = new BrowserWindow({ show: false }); - w.webContents.session.once('will-download', function (e, item) { - item.savePath = downloadFilePath; - item.on('done', function (e, state) { - try { - assertDownload(state, item); - done(); - } catch (e) { - done(e); + const w = new BrowserWindow({ show: false }); + const downloadDone: Promise = new Promise((resolve) => { + w.webContents.session.once('will-download', (e, item) => { + item.savePath = downloadFilePath; + item.on('done', () => { + try { + resolve(item); + } catch { } + }); + }); + }); + + w.webContents.downloadURL(`${url}:${port}`, { + headers: { + Authorization: 'Basic i-am-an-auth-header' } }); + + const item = await downloadDone; + expect(item.getState()).to.equal('completed'); + expect(item.getFilename()).to.equal('mock.pdf'); + expect(item.getMimeType()).to.equal('application/pdf'); + expect(item.getReceivedBytes()).to.equal(mockPDF.length); + expect(item.getTotalBytes()).to.equal(mockPDF.length); + expect(item.getContentDisposition()).to.equal(contentDisposition); }); - w.webContents.downloadURL(`${url}:${port}`); - }); - it('can download from custom protocols using WebContents.downloadURL', (done) => { - const protocol = session.defaultSession.protocol; - const handler = (ignoredError: any, callback: Function) => { - callback({ url: `${url}:${port}` }); - }; - protocol.registerHttpProtocol(protocolName, handler); - const w = new BrowserWindow({ show: false }); - w.webContents.session.once('will-download', function (e, item) { - item.savePath = downloadFilePath; - item.on('done', function (e, state) { - try { - assertDownload(state, item, true); - done(); - } catch (e) { - done(e); + it('throws when called with invalid headers', () => { + const w = new BrowserWindow({ show: false }); + expect(() => { + w.webContents.downloadURL(`${url}:${port}`, { + // @ts-ignore this line is intentionally incorrect + headers: 'i-am-a-bad-header' + }); + }).to.throw(/Invalid value for headers - must be an object/); + }); + + it('correctly handles a download and an invalid auth header', async () => { + const server = http.createServer((req, res) => { + const { authorization } = req.headers; + if (!authorization || authorization !== 'Basic i-am-an-auth-header') { + res.statusCode = 401; + res.setHeader('WWW-Authenticate', 'Basic realm="Restricted"'); + res.end(); + } else { + res.writeHead(200, { + 'Content-Length': mockPDF.length, + 'Content-Type': 'application/pdf', + 'Content-Disposition': req.url === '/?testFilename' ? 'inline' : contentDisposition + }); + res.end(mockPDF); } }); - }); - w.webContents.downloadURL(`${protocolName}://item`); - }); - it('can download using WebView.downloadURL', async () => { - const w = new BrowserWindow({ show: false, webPreferences: { webviewTag: true } }); - await w.loadURL('about:blank'); - function webviewDownload ({ fixtures, url, port }: {fixtures: string, url: string, port: string}) { - const webview = new (window as any).WebView(); - webview.addEventListener('did-finish-load', () => { - webview.downloadURL(`${url}:${port}/`); + const { port } = await listen(server); + + const w = new BrowserWindow({ show: false }); + const downloadFailed: Promise = new Promise((resolve) => { + w.webContents.session.once('will-download', (_, item) => { + item.savePath = downloadFilePath; + item.on('done', (e, state) => { + console.log(state); + try { + resolve(item); + } catch { } + }); + }); + }); + + w.webContents.downloadURL(`${url}:${port}`, { + headers: { + Authorization: 'wtf-is-this' + } }); - webview.src = `file://${fixtures}/api/blank.html`; - document.body.appendChild(webview); - } - const done: Promise<[string, Electron.DownloadItem]> = new Promise(resolve => { + + const item = await downloadFailed; + expect(item.getState()).to.equal('interrupted'); + expect(item.getReceivedBytes()).to.equal(0); + expect(item.getTotalBytes()).to.equal(0); + }); + + it('can download from custom protocols', (done) => { + const protocol = session.defaultSession.protocol; + const handler = (ignoredError: any, callback: Function) => { + callback({ url: `${url}:${port}` }); + }; + protocol.registerHttpProtocol(protocolName, handler); + const w = new BrowserWindow({ show: false }); w.webContents.session.once('will-download', function (e, item) { item.savePath = downloadFilePath; item.on('done', function (e, state) { - resolve([state, item]); + try { + assertDownload(state, item, true); + done(); + } catch (e) { + done(e); + } }); }); + w.webContents.downloadURL(`${protocolName}://item`); }); - await w.webContents.executeJavaScript(`(${webviewDownload})(${JSON.stringify({ fixtures, url, port })})`); - const [state, item] = await done; - assertDownload(state, item); - }); - it('can cancel download', (done) => { - const w = new BrowserWindow({ show: false }); - w.webContents.session.once('will-download', function (e, item) { - item.savePath = downloadFilePath; - item.on('done', function (e, state) { - try { - expect(state).to.equal('cancelled'); - expect(item.getFilename()).to.equal('mock.pdf'); - expect(item.getMimeType()).to.equal('application/pdf'); - expect(item.getReceivedBytes()).to.equal(0); - expect(item.getTotalBytes()).to.equal(mockPDF.length); - expect(item.getContentDisposition()).to.equal(contentDisposition); - done(); - } catch (e) { - done(e); - } + it('can cancel download', (done) => { + const w = new BrowserWindow({ show: false }); + w.webContents.session.once('will-download', function (e, item) { + item.savePath = downloadFilePath; + item.on('done', function (e, state) { + try { + expect(state).to.equal('cancelled'); + expect(item.getFilename()).to.equal('mock.pdf'); + expect(item.getMimeType()).to.equal('application/pdf'); + expect(item.getReceivedBytes()).to.equal(0); + expect(item.getTotalBytes()).to.equal(mockPDF.length); + expect(item.getContentDisposition()).to.equal(contentDisposition); + done(); + } catch (e) { + done(e); + } + }); + item.cancel(); }); - item.cancel(); + w.webContents.downloadURL(`${url}:${port}/`); }); - w.webContents.downloadURL(`${url}:${port}/`); - }); - it('can generate a default filename', function (done) { - if (process.env.APPVEYOR === 'True') { - // FIXME(alexeykuzmin): Skip the test. - // this.skip() - return done(); - } + it('can generate a default filename', function (done) { + if (process.env.APPVEYOR === 'True') { + // FIXME(alexeykuzmin): Skip the test. + // this.skip() + return done(); + } - const w = new BrowserWindow({ show: false }); - w.webContents.session.once('will-download', function (e, item) { - item.savePath = downloadFilePath; - item.on('done', function () { - try { - expect(item.getFilename()).to.equal('download.pdf'); - done(); - } catch (e) { - done(e); - } + const w = new BrowserWindow({ show: false }); + w.webContents.session.once('will-download', function (e, item) { + item.savePath = downloadFilePath; + item.on('done', function () { + try { + expect(item.getFilename()).to.equal('download.pdf'); + done(); + } catch (e) { + done(e); + } + }); + item.cancel(); }); - item.cancel(); + w.webContents.downloadURL(`${url}:${port}/?testFilename`); }); - w.webContents.downloadURL(`${url}:${port}/?testFilename`); - }); - - it('can set options for the save dialog', (done) => { - const filePath = path.join(__dirname, 'fixtures', 'mock.pdf'); - const options = { - window: null, - title: 'title', - message: 'message', - buttonLabel: 'buttonLabel', - nameFieldLabel: 'nameFieldLabel', - defaultPath: '/', - filters: [{ - name: '1', extensions: ['.1', '.2'] - }, { - name: '2', extensions: ['.3', '.4', '.5'] - }], - showsTagField: true, - securityScopedBookmarks: true - }; - const w = new BrowserWindow({ show: false }); - w.webContents.session.once('will-download', function (e, item) { - item.setSavePath(filePath); - item.setSaveDialogOptions(options); - item.on('done', function () { - try { - expect(item.getSaveDialogOptions()).to.deep.equal(options); - done(); - } catch (e) { - done(e); - } - }); - item.cancel(); - }); - w.webContents.downloadURL(`${url}:${port}`); - }); + it('can set options for the save dialog', (done) => { + const filePath = path.join(__dirname, 'fixtures', 'mock.pdf'); + const options = { + window: null, + title: 'title', + message: 'message', + buttonLabel: 'buttonLabel', + nameFieldLabel: 'nameFieldLabel', + defaultPath: '/', + filters: [{ + name: '1', extensions: ['.1', '.2'] + }, { + name: '2', extensions: ['.3', '.4', '.5'] + }], + showsTagField: true, + securityScopedBookmarks: true + }; - describe('when a save path is specified and the URL is unavailable', () => { - it('does not display a save dialog and reports the done state as interrupted', (done) => { const w = new BrowserWindow({ show: false }); w.webContents.session.once('will-download', function (e, item) { - item.savePath = downloadFilePath; - if (item.getState() === 'interrupted') { - item.resume(); - } - item.on('done', function (e, state) { + item.setSavePath(filePath); + item.setSaveDialogOptions(options); + item.on('done', function () { try { - expect(state).to.equal('interrupted'); + expect(item.getSaveDialogOptions()).to.deep.equal(options); done(); } catch (e) { done(e); } }); + item.cancel(); + }); + w.webContents.downloadURL(`${url}:${port}`); + }); + + describe('when a save path is specified and the URL is unavailable', () => { + it('does not display a save dialog and reports the done state as interrupted', (done) => { + const w = new BrowserWindow({ show: false }); + w.webContents.session.once('will-download', function (e, item) { + item.savePath = downloadFilePath; + if (item.getState() === 'interrupted') { + item.resume(); + } + item.on('done', function (e, state) { + try { + expect(state).to.equal('interrupted'); + done(); + } catch (e) { + done(e); + } + }); + }); + w.webContents.downloadURL(`file://${path.join(__dirname, 'does-not-exist.txt')}`); + }); + }); + }); + + describe('WebView.downloadURL', () => { + it('can perform a download', async () => { + const w = new BrowserWindow({ show: false, webPreferences: { webviewTag: true } }); + await w.loadURL('about:blank'); + function webviewDownload ({ fixtures, url, port }: { fixtures: string, url: string, port: string }) { + const webview = new (window as any).WebView(); + webview.addEventListener('did-finish-load', () => { + webview.downloadURL(`${url}:${port}/`); + }); + webview.src = `file://${fixtures}/api/blank.html`; + document.body.appendChild(webview); + } + const done: Promise<[string, Electron.DownloadItem]> = new Promise(resolve => { + w.webContents.session.once('will-download', function (e, item) { + item.savePath = downloadFilePath; + item.on('done', function (e, state) { + resolve([state, item]); + }); + }); }); - w.webContents.downloadURL(`file://${path.join(__dirname, 'does-not-exist.txt')}`); + await w.webContents.executeJavaScript(`(${webviewDownload})(${JSON.stringify({ fixtures, url, port })})`); + const [state, item] = await done; + assertDownload(state, item); }); }); }); From cb956aa8b5f1a1b68f8f8deb5af754e9a617c1a0 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Thu, 17 Aug 2023 05:24:57 -0700 Subject: [PATCH 79/93] ci: add prev-major variable to release board templating (#39454) --- .github/workflows/branch-created.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/branch-created.yml b/.github/workflows/branch-created.yml index 08c37b813955f..ef4585d363319 100644 --- a/.github/workflows/branch-created.yml +++ b/.github/workflows/branch-created.yml @@ -135,7 +135,7 @@ jobs: # # Do template replacement for draft issues # - echo "{\"major\": $MAJOR, \"next-major\": $((MAJOR + 1))}" > variables.json + echo "{\"major\": $MAJOR, \"next-major\": $((MAJOR + 1)), \"prev-major\": $((MAJOR - 1))}" > variables.json # npx mustache is annoyingly slow, so install mustache directly yarn add -D mustache From 9dfc8103f52c8d61d118ae4f1356d199fd3727b0 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 17 Aug 2023 08:58:04 -0500 Subject: [PATCH 80/93] refactor: prefer Sorted variant of MakeFixedFlatSet() (#39537) perf: prefer Sorted variant of MakeFixedFlatSet() https://chromium-review.googlesource.com/c/chromium/src/+/4660000 says that the sorted version is simpler at compile time because it can skip MakeFixedFlatSet()'s compile-time dynamic sorting. --- shell/app/node_main.cc | 15 ++++---- shell/browser/usb/electron_usb_delegate.cc | 2 +- shell/common/node_bindings.cc | 40 +++++++++++++--------- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/shell/app/node_main.cc b/shell/app/node_main.cc index 79483e2fae6db..e03d35cf90d2a 100644 --- a/shell/app/node_main.cc +++ b/shell/app/node_main.cc @@ -54,13 +54,14 @@ namespace { // See https://nodejs.org/api/cli.html#cli_options void ExitIfContainsDisallowedFlags(const std::vector& argv) { // Options that are unilaterally disallowed. - static constexpr auto disallowed = base::MakeFixedFlatSet({ - "--enable-fips", - "--force-fips", - "--openssl-config", - "--use-bundled-ca", - "--use-openssl-ca", - }); + static constexpr auto disallowed = + base::MakeFixedFlatSetSorted({ + "--enable-fips", + "--force-fips", + "--openssl-config", + "--use-bundled-ca", + "--use-openssl-ca", + }); for (const auto& arg : argv) { const auto key = base::StringPiece(arg).substr(0, arg.find('=')); diff --git a/shell/browser/usb/electron_usb_delegate.cc b/shell/browser/usb/electron_usb_delegate.cc index 51711119fdca2..8bb5726cf5fcd 100644 --- a/shell/browser/usb/electron_usb_delegate.cc +++ b/shell/browser/usb/electron_usb_delegate.cc @@ -45,7 +45,7 @@ electron::UsbChooserContext* GetChooserContext( // These extensions can claim the smart card USB class and automatically gain // permissions for devices that have an interface with this class. constexpr auto kSmartCardPrivilegedExtensionIds = - base::MakeFixedFlatSet({ + base::MakeFixedFlatSetSorted({ // Smart Card Connector Extension and its Beta version, see // crbug.com/1233881. "khpfeaanjngmcnplbdlpegiifgpfgdco", diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 815dbb7d28c08..4790b00e535df 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -232,7 +232,7 @@ void ErrorMessageListener(v8::Local message, // If node CLI inspect support is disabled, allow no debug options. bool IsAllowedOption(base::StringPiece option) { static constexpr auto debug_options = - base::MakeFixedFlatSet({ + base::MakeFixedFlatSetSorted({ "--debug", "--debug-brk", "--debug-port", @@ -244,13 +244,14 @@ bool IsAllowedOption(base::StringPiece option) { }); // This should be aligned with what's possible to set via the process object. - static constexpr auto options = base::MakeFixedFlatSet({ - "--trace-warnings", - "--trace-deprecation", - "--throw-deprecation", - "--no-deprecation", - "--dns-result-order", - }); + static constexpr auto options = + base::MakeFixedFlatSetSorted({ + "--dns-result-order", + "--no-deprecation", + "--throw-deprecation", + "--trace-deprecation", + "--trace-warnings", + }); if (debug_options.contains(option)) return electron::fuses::IsNodeCliInspectEnabled(); @@ -262,14 +263,21 @@ bool IsAllowedOption(base::StringPiece option) { // See https://nodejs.org/api/cli.html#cli_node_options_options void SetNodeOptions(base::Environment* env) { // Options that are unilaterally disallowed - static constexpr auto disallowed = base::MakeFixedFlatSet( - {"--enable-fips", "--force-fips", "--openssl-config", "--use-bundled-ca", - "--use-openssl-ca", "--experimental-policy"}); - - static constexpr auto pkg_opts = base::MakeFixedFlatSet({ - "--http-parser", - "--max-http-header-size", - }); + static constexpr auto disallowed = + base::MakeFixedFlatSetSorted({ + "--enable-fips", + "--experimental-policy", + "--force-fips", + "--openssl-config", + "--use-bundled-ca", + "--use-openssl-ca", + }); + + static constexpr auto pkg_opts = + base::MakeFixedFlatSetSorted({ + "--http-parser", + "--max-http-header-size", + }); if (env->HasVar("NODE_OPTIONS")) { if (electron::fuses::IsNodeOptionsEnabled()) { From f1a45f06c206bb21500146fbf43460062ca18c45 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 17 Aug 2023 16:42:53 +0200 Subject: [PATCH 81/93] chore: cleanup asar initialization logic (#39532) --- ...de_entrypoint_to_be_a_builtin_module.patch | 4 +- .../node/feat_initialize_asar_support.patch | 40 ++++++------------- 2 files changed, 14 insertions(+), 30 deletions(-) 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 68519aef7eac5..55d58d9b82aec 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 @@ -26,10 +26,10 @@ index 001343b74ce236f89dca030c0fc9dd0299df0b39..6f277daf4ce846f093f634c473daec07 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 2e35cbba2ac02494c44821af395fe0195b1ab6b5..f5b6fecf6843a6204ec532a77f39a36d33bf061d 100644 +index 4e7a9e7a7585fea2013ff70161672568477172b1..f96d19969aa59a9964d947a9fd6295cf25ad3b03 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js -@@ -149,11 +149,13 @@ function patchProcessObject(expandArgv1) { +@@ -151,11 +151,13 @@ 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/feat_initialize_asar_support.patch b/patches/node/feat_initialize_asar_support.patch index ccdc9a9bd43fd..6303ab63a4e06 100644 --- a/patches/node/feat_initialize_asar_support.patch +++ b/patches/node/feat_initialize_asar_support.patch @@ -5,25 +5,20 @@ Subject: feat: initialize asar support This patch initializes asar support in Node.js. -diff --git a/lib/internal/process/policy.js b/lib/internal/process/policy.js -index 8e07cb92118c84b2bc1156532cae8b033b9a48f4..2073a024ad548fe80e84cafee012b003454d6c93 100644 ---- a/lib/internal/process/policy.js -+++ b/lib/internal/process/policy.js -@@ -39,9 +39,6 @@ module.exports = ObjectFreeze({ - process.binding = function binding(_module) { - throw new ERR_ACCESS_DENIED('process.binding'); - }; -- process._linkedBinding = function _linkedBinding(_module) { -- throw new ERR_ACCESS_DENIED('process._linkedBinding'); -- }; - }, - - get manifest() { diff --git a/lib/internal/process/pre_execution.js b/lib/internal/process/pre_execution.js -index 250a43c5455b4f9ff72dd3a34d5b0aa270f43cc6..2e35cbba2ac02494c44821af395fe0195b1ab6b5 100644 +index 250a43c5455b4f9ff72dd3a34d5b0aa270f43cc6..4e7a9e7a7585fea2013ff70161672568477172b1 100644 --- a/lib/internal/process/pre_execution.js +++ b/lib/internal/process/pre_execution.js -@@ -117,12 +117,17 @@ function setupUserModules() { +@@ -49,6 +49,8 @@ function prepareWorkerThreadExecution() { + }); + } + ++ ++let processLinkedBinding = process._linkedBinding; + function prepareExecution(options) { + const { expandArgv1, initializeModules, isMainThread } = options; + +@@ -117,12 +119,17 @@ function setupUserModules() { loadPreloadModules(); // Need to be done after --require setup. initializeFrozenIntrinsics(); @@ -35,20 +30,9 @@ index 250a43c5455b4f9ff72dd3a34d5b0aa270f43cc6..2e35cbba2ac02494c44821af395fe019 } +function setupAsarSupport() { -+ process._linkedBinding('electron_common_asar').initAsarSupport(require); ++ processLinkedBinding('electron_common_asar').initAsarSupport(require); +} + function patchProcessObject(expandArgv1) { const binding = internalBinding('process_methods'); binding.patchProcessObject(process); -diff --git a/test/fixtures/policy/process-binding/app.js b/test/fixtures/policy/process-binding/app.js -index 16e26d12a160286b1b6aaeb64b15668b05b9865b..a287d0a2363acbf24077eec040116f96ef18a7b3 100644 ---- a/test/fixtures/policy/process-binding/app.js -+++ b/test/fixtures/policy/process-binding/app.js -@@ -5,6 +5,3 @@ const assert = require('assert'); - assert.throws(() => { process.binding(); }, { - code: 'ERR_ACCESS_DENIED' - }); --assert.throws(() => { process._linkedBinding(); }, { -- code: 'ERR_ACCESS_DENIED' --}); From 23b2c4fb05b8dd61e63b13a9ad8e92b531444229 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 17 Aug 2023 18:16:14 +0200 Subject: [PATCH 82/93] test: enable `parallel/test-debugger-random-port-with-inspect-port` (#39533) test: enable parallel/test-debugger-random-port-with-inspect-port --- ...x_account_for_debugger_agent_race_condition.patch | 12 ++++++++++++ script/node-disabled-tests.json | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/patches/node/fix_account_for_debugger_agent_race_condition.patch b/patches/node/fix_account_for_debugger_agent_race_condition.patch index 460cca2735f27..cd5a3eacd44bc 100644 --- a/patches/node/fix_account_for_debugger_agent_race_condition.patch +++ b/patches/node/fix_account_for_debugger_agent_race_condition.patch @@ -21,6 +21,18 @@ index eab99c9b0e2fb387ef9a716396e41c7fc93e93bc..ef8b20a60df88a0a412c309f597e1b1f await cli.waitForPrompt(); await cli.command('sb("alive.js", 3)'); await cli.waitFor(/break/); +diff --git a/test/parallel/test-debugger-random-port-with-inspect-port.js b/test/parallel/test-debugger-random-port-with-inspect-port.js +index 3acc6bdd733eb002a2592960528bb04eebb2dc60..a9f2d29327464281c10d4c2210277eab47c9a262 100644 +--- a/test/parallel/test-debugger-random-port-with-inspect-port.js ++++ b/test/parallel/test-debugger-random-port-with-inspect-port.js +@@ -13,6 +13,7 @@ const script = fixtures.path('debugger', 'three-lines.js'); + const cli = startCLI(['--inspect-port=0', script]); + + (async () => { ++ await new Promise(resolve => setTimeout(resolve, 1000)); + await cli.waitForInitialBreak(); + await cli.waitForPrompt(); + assert.match(cli.output, /debug>/, 'prints a prompt'); diff --git a/test/sequential/test-debugger-pid.js b/test/sequential/test-debugger-pid.js index 99062149dfe3374b86439850e0655383e2bad662..78c173f5073818fae7d46413842cb7790130c3f5 100644 --- a/test/sequential/test-debugger-pid.js diff --git a/script/node-disabled-tests.json b/script/node-disabled-tests.json index 8ec96fd5634d7..e08f101e47205 100644 --- a/script/node-disabled-tests.json +++ b/script/node-disabled-tests.json @@ -17,7 +17,6 @@ "parallel/test-crypto-modp1-error", "parallel/test-crypto-padding-aes256", "parallel/test-crypto-secure-heap", - "parallel/test-debugger-random-port-with-inspect-port", "parallel/test-dgram-send-cb-quelches-error", "parallel/test-fs-utimes-y2K38", "parallel/test-http2-clean-output", From f77f86b1119f197b8a215b73fc3b1748d1170a77 Mon Sep 17 00:00:00 2001 From: Athul Iddya Date: Thu, 17 Aug 2023 11:26:49 -0700 Subject: [PATCH 83/93] fix: use tiled edges to calculate frame inset sizes in Linux (#39523) Adapt to the window frame size calculation changes in CL 3970920 by setting the inset sizes to 0 for tiled edges. --- shell/browser/ui/views/client_frame_view_linux.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shell/browser/ui/views/client_frame_view_linux.cc b/shell/browser/ui/views/client_frame_view_linux.cc index 9a52533a5af26..04a41383e5922 100644 --- a/shell/browser/ui/views/client_frame_view_linux.cc +++ b/shell/browser/ui/views/client_frame_view_linux.cc @@ -150,7 +150,13 @@ void ClientFrameViewLinux::Init(NativeWindowViews* window, } gfx::Insets ClientFrameViewLinux::GetBorderDecorationInsets() const { - return frame_provider_->GetFrameThicknessDip(); + const auto insets = frame_provider_->GetFrameThicknessDip(); + // We shouldn't draw frame decorations for the tiled edges. + // See https://wayland.app/protocols/xdg-shell#xdg_toplevel:enum:state + return gfx::Insets::TLBR(tiled_edges().top ? 0 : insets.top(), + tiled_edges().left ? 0 : insets.left(), + tiled_edges().bottom ? 0 : insets.bottom(), + tiled_edges().right ? 0 : insets.right()); } gfx::Insets ClientFrameViewLinux::GetInputInsets() const { From 620a7cc02d535e0f0803c60868aef4a365b4630e Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 21 Aug 2023 02:41:00 +0200 Subject: [PATCH 84/93] fix: `chrome://gpu` failing to load (#39556) fix: chrome://gpu failing to load --- electron_paks.gni | 2 ++ spec/chromium-spec.ts | 26 ++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/electron_paks.gni b/electron_paks.gni index c3a257ab0f62f..bc6950bee792a 100644 --- a/electron_paks.gni +++ b/electron_paks.gni @@ -61,6 +61,7 @@ template("electron_extra_paks") { "$root_gen_dir/content/browser/tracing/tracing_resources.pak", "$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak", "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/gpu_resources.pak", "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak", "$root_gen_dir/net/net_resources.pak", "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak", @@ -74,6 +75,7 @@ template("electron_extra_paks") { "//chrome/common:resources", "//components/resources", "//content:content_resources", + "//content/browser/resources/gpu:resources", "//content/browser/resources/media:resources", "//content/browser/tracing:resources", "//content/browser/webrtc/resources", diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index f9ebb1f4efa04..da937aa45485a 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -2050,10 +2050,32 @@ describe('chromium features', () => { }); }); + describe('chrome://accessibility', () => { + it('loads the page successfully', async () => { + const w = new BrowserWindow({ show: false }); + await w.loadURL('chrome://accessibility'); + const pageExists = await w.webContents.executeJavaScript( + "window.hasOwnProperty('chrome') && window.chrome.hasOwnProperty('send')" + ); + expect(pageExists).to.be.true(); + }); + }); + + describe('chrome://gpu', () => { + it('loads the page successfully', async () => { + const w = new BrowserWindow({ show: false }); + await w.loadURL('chrome://gpu'); + const pageExists = await w.webContents.executeJavaScript( + "window.hasOwnProperty('chrome') && window.chrome.hasOwnProperty('send')" + ); + expect(pageExists).to.be.true(); + }); + }); + describe('chrome://media-internals', () => { it('loads the page successfully', async () => { const w = new BrowserWindow({ show: false }); - w.loadURL('chrome://media-internals'); + await w.loadURL('chrome://media-internals'); const pageExists = await w.webContents.executeJavaScript( "window.hasOwnProperty('chrome') && window.chrome.hasOwnProperty('send')" ); @@ -2064,7 +2086,7 @@ describe('chromium features', () => { describe('chrome://webrtc-internals', () => { it('loads the page successfully', async () => { const w = new BrowserWindow({ show: false }); - w.loadURL('chrome://webrtc-internals'); + await w.loadURL('chrome://webrtc-internals'); const pageExists = await w.webContents.executeJavaScript( "window.hasOwnProperty('chrome') && window.chrome.hasOwnProperty('send')" ); From 506721201ecc9b1f7c2eed97318a0921430d835d Mon Sep 17 00:00:00 2001 From: tr2-harada <140588681+tr2-harada@users.noreply.github.com> Date: Mon, 21 Aug 2023 09:43:49 +0900 Subject: [PATCH 85/93] fix: explorer restart does not recreated thumbnail toolbar buttons (#39551) fix: explorer restart does not recreated thumbnail toolbar buttons. --- shell/browser/native_window_views.cc | 4 ++++ shell/browser/native_window_views.h | 4 ++++ shell/browser/native_window_views_win.cc | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 028b35c1ceb1c..0ce17d437ab09 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -254,6 +254,10 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, if (title_bar_style_ != TitleBarStyle::kNormal) set_has_frame(false); + + // If the taskbar is re-created after we start up, we have to rebuild all of + // our buttons. + taskbar_created_message_ = RegisterWindowMessage(TEXT("TaskbarCreated")); #endif if (enable_larger_than_screen()) diff --git a/shell/browser/native_window_views.h b/shell/browser/native_window_views.h index e97d22ace0ab9..e7d4c30b2ae6d 100644 --- a/shell/browser/native_window_views.h +++ b/shell/browser/native_window_views.h @@ -318,6 +318,10 @@ class NativeWindowViews : public NativeWindow, // Controls Overlay if enabled on Windows. SkColor overlay_button_color_; SkColor overlay_symbol_color_; + + // The message ID of the "TaskbarCreated" message, sent to us when we need to + // reset our thumbar buttons. + UINT taskbar_created_message_ = 0; #endif // Handles unhandled keyboard messages coming back from the renderer process. diff --git a/shell/browser/native_window_views_win.cc b/shell/browser/native_window_views_win.cc index e4288d047c304..f782dbbbad310 100644 --- a/shell/browser/native_window_views_win.cc +++ b/shell/browser/native_window_views_win.cc @@ -221,6 +221,12 @@ bool NativeWindowViews::PreHandleMSG(UINT message, return true; } + if (message == taskbar_created_message_) { + // We need to reset all of our buttons because the taskbar went away. + taskbar_host_.RestoreThumbarButtons(GetAcceleratedWidget()); + return true; + } + switch (message) { // Screen readers send WM_GETOBJECT in order to get the accessibility // object, so take this opportunity to push Chromium into accessible From 9df7aaa44a22d1def1c4a65b8d8cce3b672b8ae5 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 21 Aug 2023 03:43:41 +0200 Subject: [PATCH 86/93] refactor: add gin_helper::Dictionary::CreateEmpty() helper (#39547) --- shell/app/node_main.cc | 2 +- shell/browser/api/electron_api_app.cc | 16 ++++++++-------- shell/browser/api/electron_api_base_window.cc | 2 +- shell/browser/api/electron_api_browser_window.cc | 3 +-- .../browser/api/electron_api_desktop_capturer.cc | 2 +- shell/browser/api/electron_api_dialog.cc | 2 +- .../browser/api/electron_api_in_app_purchase.cc | 12 ++++++------ shell/browser/api/electron_api_notification.cc | 2 +- shell/browser/api/electron_api_printing.cc | 2 +- .../api/electron_api_system_preferences.cc | 2 +- shell/browser/api/electron_api_url_loader.cc | 4 ++-- shell/browser/api/electron_api_web_contents.cc | 2 +- shell/browser/browser_mac.mm | 2 +- shell/browser/browser_win.cc | 5 ++--- shell/browser/lib/bluetooth_chooser.cc | 2 +- .../browser/serial/serial_chooser_controller.cc | 2 +- shell/common/api/electron_api_asar.cc | 2 +- shell/common/api/electron_api_native_image.cc | 2 +- shell/common/api/electron_bindings.cc | 12 ++++++------ shell/common/gin_converters/blink_converter.cc | 12 ++++++------ shell/common/gin_converters/content_converter.cc | 4 ++-- .../gin_converters/file_dialog_converter.cc | 4 ++-- shell/common/gin_converters/gfx_converter.cc | 10 +++++----- shell/common/gin_converters/net_converter.cc | 10 +++++----- .../gin_converters/serial_port_info_converter.h | 2 +- shell/common/gin_helper/callback.cc | 2 +- shell/common/gin_helper/dictionary.h | 4 ++++ .../electron_sandboxed_renderer_client.cc | 2 +- shell/renderer/renderer_client_base.cc | 2 +- 29 files changed, 66 insertions(+), 64 deletions(-) diff --git a/shell/app/node_main.cc b/shell/app/node_main.cc index e03d35cf90d2a..93af42efde6c3 100644 --- a/shell/app/node_main.cc +++ b/shell/app/node_main.cc @@ -222,7 +222,7 @@ int NodeMain(int argc, char* argv[]) { process.SetMethod("crash", &ElectronBindings::Crash); // Setup process.crashReporter in child node processes - gin_helper::Dictionary reporter = gin::Dictionary::CreateEmpty(isolate); + auto reporter = gin_helper::Dictionary::CreateEmpty(isolate); reporter.SetMethod("getParameters", &GetParameters); #if IS_MAS_BUILD() reporter.SetMethod("addExtraParameter", &SetCrashKeyStub); diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index 52e7fb8c01d44..415ed4efc61bd 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -202,7 +202,7 @@ struct Converter { static v8::Local ToV8(v8::Isolate* isolate, const JumpListItem& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("type", val.type); switch (val.type) { @@ -338,7 +338,7 @@ struct Converter { static v8::Local ToV8(v8::Isolate* isolate, Browser::LaunchItem val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("name", val.name); dict.Set("path", val.path); dict.Set("args", val.args); @@ -371,7 +371,7 @@ struct Converter { static v8::Local ToV8(v8::Isolate* isolate, Browser::LoginItemSettings val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("openAtLogin", val.open_at_login); dict.Set("openAsHidden", val.open_as_hidden); dict.Set("restoreState", val.restore_state); @@ -1263,7 +1263,7 @@ v8::Local App::GetJumpListSettings() { } v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("minItems", min_items); dict.Set("removedItems", gin::ConvertToV8(isolate, removed_items)); return dict.GetHandle(); @@ -1344,8 +1344,8 @@ std::vector App::GetAppMetrics(v8::Isolate* isolate) { int processor_count = base::SysInfo::NumberOfProcessors(); for (const auto& process_metric : app_metrics_) { - gin_helper::Dictionary pid_dict = gin::Dictionary::CreateEmpty(isolate); - gin_helper::Dictionary cpu_dict = gin::Dictionary::CreateEmpty(isolate); + auto pid_dict = gin_helper::Dictionary::CreateEmpty(isolate); + auto cpu_dict = gin_helper::Dictionary::CreateEmpty(isolate); pid_dict.SetHidden("simple", true); cpu_dict.SetHidden("simple", true); @@ -1382,7 +1382,7 @@ std::vector App::GetAppMetrics(v8::Isolate* isolate) { #if !BUILDFLAG(IS_LINUX) auto memory_info = process_metric.second->GetMemoryInfo(); - gin_helper::Dictionary memory_dict = gin::Dictionary::CreateEmpty(isolate); + auto memory_dict = gin_helper::Dictionary::CreateEmpty(isolate); memory_dict.SetHidden("simple", true); memory_dict.Set("workingSetSize", static_cast(memory_info.working_set_size >> 10)); @@ -1534,7 +1534,7 @@ v8::Local App::GetDockAPI(v8::Isolate* isolate) { // Initialize the Dock API, the methods are bound to "dock" which exists // for the lifetime of "app" auto browser = base::Unretained(Browser::Get()); - gin_helper::Dictionary dock_obj = gin::Dictionary::CreateEmpty(isolate); + auto dock_obj = gin_helper::Dictionary::CreateEmpty(isolate); dock_obj.SetMethod("bounce", &DockBounce); dock_obj.SetMethod( "cancelBounce", diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index 57841dd41d19b..22dbf3825ac39 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -212,7 +212,7 @@ void BaseWindow::OnWindowWillResize(const gfx::Rect& new_bounds, bool* prevent_default) { v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); v8::HandleScope handle_scope(isolate); - gin_helper::Dictionary info = gin::Dictionary::CreateEmpty(isolate); + auto info = gin::Dictionary::CreateEmpty(isolate); info.Set("edge", edge); if (Emit("will-resize", new_bounds, info)) { diff --git a/shell/browser/api/electron_api_browser_window.cc b/shell/browser/api/electron_api_browser_window.cc index 02a3aa0cdd2d4..f699aa82737d1 100644 --- a/shell/browser/api/electron_api_browser_window.cc +++ b/shell/browser/api/electron_api_browser_window.cc @@ -39,8 +39,7 @@ BrowserWindow::BrowserWindow(gin::Arguments* args, : BaseWindow(args->isolate(), options) { // Use options.webPreferences in WebContents. v8::Isolate* isolate = args->isolate(); - gin_helper::Dictionary web_preferences = - gin::Dictionary::CreateEmpty(isolate); + auto web_preferences = gin_helper::Dictionary::CreateEmpty(isolate); options.Get(options::kWebPreferences, &web_preferences); bool transparent = false; diff --git a/shell/browser/api/electron_api_desktop_capturer.cc b/shell/browser/api/electron_api_desktop_capturer.cc index 74530402e906d..43bc87cf67bf9 100644 --- a/shell/browser/api/electron_api_desktop_capturer.cc +++ b/shell/browser/api/electron_api_desktop_capturer.cc @@ -151,7 +151,7 @@ struct Converter { static v8::Local ToV8( v8::Isolate* isolate, const electron::api::DesktopCapturer::Source& source) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); content::DesktopMediaID id = source.media_list_source.id; dict.Set("name", base::UTF16ToUTF8(source.media_list_source.name)); dict.Set("id", id.ToString()); diff --git a/shell/browser/api/electron_api_dialog.cc b/shell/browser/api/electron_api_dialog.cc index 7540834752036..4ce5edca3e4a8 100644 --- a/shell/browser/api/electron_api_dialog.cc +++ b/shell/browser/api/electron_api_dialog.cc @@ -29,7 +29,7 @@ void ResolvePromiseObject(gin_helper::Promise promise, bool checkbox_checked) { v8::Isolate* isolate = promise.isolate(); v8::HandleScope handle_scope(isolate); - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("response", result); dict.Set("checkboxChecked", checkbox_checked); diff --git a/shell/browser/api/electron_api_in_app_purchase.cc b/shell/browser/api/electron_api_in_app_purchase.cc index 52561740457f4..5d93a3564f837 100644 --- a/shell/browser/api/electron_api_in_app_purchase.cc +++ b/shell/browser/api/electron_api_in_app_purchase.cc @@ -20,7 +20,7 @@ struct Converter { static v8::Local ToV8( v8::Isolate* isolate, const in_app_purchase::PaymentDiscount& paymentDiscount) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("identifier", paymentDiscount.identifier); dict.Set("keyIdentifier", paymentDiscount.keyIdentifier); @@ -35,7 +35,7 @@ template <> struct Converter { static v8::Local ToV8(v8::Isolate* isolate, const in_app_purchase::Payment& payment) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("productIdentifier", payment.productIdentifier); dict.Set("quantity", payment.quantity); @@ -51,7 +51,7 @@ template <> struct Converter { static v8::Local ToV8(v8::Isolate* isolate, const in_app_purchase::Transaction& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("transactionIdentifier", val.transactionIdentifier); dict.Set("transactionDate", val.transactionDate); @@ -71,7 +71,7 @@ struct Converter { v8::Isolate* isolate, const in_app_purchase::ProductSubscriptionPeriod& productSubscriptionPeriod) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("numberOfUnits", productSubscriptionPeriod.numberOfUnits); dict.Set("unit", productSubscriptionPeriod.unit); @@ -84,7 +84,7 @@ struct Converter { static v8::Local ToV8( v8::Isolate* isolate, const in_app_purchase::ProductDiscount& productDiscount) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("identifier", productDiscount.identifier); dict.Set("type", productDiscount.type); @@ -104,7 +104,7 @@ template <> struct Converter { static v8::Local ToV8(v8::Isolate* isolate, const in_app_purchase::Product& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("productIdentifier", val.productIdentifier); dict.Set("localizedDescription", val.localizedDescription); diff --git a/shell/browser/api/electron_api_notification.cc b/shell/browser/api/electron_api_notification.cc index 76f4cc3c4e4c6..0b3e574f6e08e 100644 --- a/shell/browser/api/electron_api_notification.cc +++ b/shell/browser/api/electron_api_notification.cc @@ -36,7 +36,7 @@ struct Converter { static v8::Local ToV8(v8::Isolate* isolate, electron::NotificationAction val) { - gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin::Dictionary::CreateEmpty(isolate); dict.Set("text", val.text); dict.Set("type", val.type); return ConvertToV8(isolate, dict); diff --git a/shell/browser/api/electron_api_printing.cc b/shell/browser/api/electron_api_printing.cc index 61101cefcf69c..195ac01bb6e06 100644 --- a/shell/browser/api/electron_api_printing.cc +++ b/shell/browser/api/electron_api_printing.cc @@ -24,7 +24,7 @@ template <> struct Converter { static v8::Local ToV8(v8::Isolate* isolate, const printing::PrinterBasicInfo& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("name", val.printer_name); dict.Set("displayName", val.display_name); dict.Set("description", val.printer_description); diff --git a/shell/browser/api/electron_api_system_preferences.cc b/shell/browser/api/electron_api_system_preferences.cc index e199cf30e8943..ccbe9db8278af 100644 --- a/shell/browser/api/electron_api_system_preferences.cc +++ b/shell/browser/api/electron_api_system_preferences.cc @@ -35,7 +35,7 @@ SystemPreferences::~SystemPreferences() = default; v8::Local SystemPreferences::GetAnimationSettings( v8::Isolate* isolate) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("shouldRenderRichAnimation", gfx::Animation::ShouldRenderRichAnimation()); diff --git a/shell/browser/api/electron_api_url_loader.cc b/shell/browser/api/electron_api_url_loader.cc index 0944a4dfd5957..021909625d6c6 100644 --- a/shell/browser/api/electron_api_url_loader.cc +++ b/shell/browser/api/electron_api_url_loader.cc @@ -50,7 +50,7 @@ struct Converter { static v8::Local ToV8( v8::Isolate* isolate, const network::mojom::HttpRawHeaderPairPtr& pair) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("key", pair->key); dict.Set("value", pair->value); return dict.GetHandle(); @@ -709,7 +709,7 @@ void SimpleURLLoaderWrapper::OnResponseStarted( const network::mojom::URLResponseHead& response_head) { v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); v8::HandleScope scope(isolate); - gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin::Dictionary::CreateEmpty(isolate); dict.Set("statusCode", response_head.headers->response_code()); dict.Set("statusMessage", response_head.headers->GetStatusText()); dict.Set("httpVersion", response_head.headers->GetHttpVersion()); diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 069b777856bde..8e7db50616e22 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -1504,7 +1504,7 @@ void WebContents::FindReply(content::WebContents* web_contents, v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); v8::HandleScope handle_scope(isolate); - gin_helper::Dictionary result = gin::Dictionary::CreateEmpty(isolate); + auto result = gin_helper::Dictionary::CreateEmpty(isolate); result.Set("requestId", request_id); result.Set("matches", number_of_matches); result.Set("selectionArea", selection_rect); diff --git a/shell/browser/browser_mac.mm b/shell/browser/browser_mac.mm index 7fd2fc3ad428b..34c972cf933bc 100644 --- a/shell/browser/browser_mac.mm +++ b/shell/browser/browser_mac.mm @@ -105,7 +105,7 @@ bool CheckLoginItemStatus(bool* is_hidden) { const GURL& url) { gin_helper::Promise promise(isolate); v8::Local handle = promise.GetHandle(); - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); NSString* ns_app_path = GetAppPathForProtocol(url); diff --git a/shell/browser/browser_win.cc b/shell/browser/browser_win.cc index 2a72e070f4f15..8fcb7abab83cb 100644 --- a/shell/browser/browser_win.cc +++ b/shell/browser/browser_win.cc @@ -113,8 +113,7 @@ void OnIconDataAvailable(const base::FilePath& app_path, gfx::Image icon) { if (!icon.IsEmpty()) { v8::HandleScope scope(promise.isolate()); - gin_helper::Dictionary dict = - gin::Dictionary::CreateEmpty(promise.isolate()); + auto dict = gin_helper::Dictionary::CreateEmpty(promise.isolate()); dict.Set("path", app_path); dict.Set("name", app_display_name); @@ -270,7 +269,7 @@ void GetFileIcon(const base::FilePath& path, gfx::Image* icon = icon_manager->LookupIconFromFilepath(normalized_path, icon_size, 1.0f); if (icon) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("icon", *icon); dict.Set("name", app_display_name); dict.Set("path", normalized_path); diff --git a/shell/browser/lib/bluetooth_chooser.cc b/shell/browser/lib/bluetooth_chooser.cc index 2bd9310679f61..0c8708a91a484 100644 --- a/shell/browser/lib/bluetooth_chooser.cc +++ b/shell/browser/lib/bluetooth_chooser.cc @@ -14,7 +14,7 @@ struct Converter { static v8::Local ToV8( v8::Isolate* isolate, const electron::BluetoothChooser::DeviceInfo& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("deviceName", val.device_name); dict.Set("deviceId", val.device_id); return gin::ConvertToV8(isolate, dict); diff --git a/shell/browser/serial/serial_chooser_controller.cc b/shell/browser/serial/serial_chooser_controller.cc index f15722b223361..66a8ea034ee9d 100644 --- a/shell/browser/serial/serial_chooser_controller.cc +++ b/shell/browser/serial/serial_chooser_controller.cc @@ -26,7 +26,7 @@ struct Converter { static v8::Local ToV8( v8::Isolate* isolate, const device::mojom::SerialPortInfoPtr& port) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("portId", port->token.ToString()); dict.Set("portName", port->path.BaseName().LossyDisplayName()); if (port->display_name && !port->display_name->empty()) { diff --git a/shell/common/api/electron_api_asar.cc b/shell/common/api/electron_api_asar.cc index e3932e1eaaab4..f0adf8b53a2df 100644 --- a/shell/common/api/electron_api_asar.cc +++ b/shell/common/api/electron_api_asar.cc @@ -215,7 +215,7 @@ static void SplitPath(const v8::FunctionCallbackInfo& args) { return; } - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); base::FilePath asar_path, file_path; if (asar::GetAsarArchivePath(path, &asar_path, &file_path, true)) { dict.Set("isAsar", true); diff --git a/shell/common/api/electron_api_native_image.cc b/shell/common/api/electron_api_native_image.cc index 9cb7b396ea4b0..d9a4916ee0f62 100644 --- a/shell/common/api/electron_api_native_image.cc +++ b/shell/common/api/electron_api_native_image.cc @@ -643,7 +643,7 @@ void Initialize(v8::Local exports, void* priv) { v8::Isolate* isolate = context->GetIsolate(); gin_helper::Dictionary dict(isolate, exports); - gin_helper::Dictionary native_image = gin::Dictionary::CreateEmpty(isolate); + auto native_image = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("nativeImage", native_image); native_image.SetMethod("createEmpty", &NativeImage::CreateEmpty); diff --git a/shell/common/api/electron_bindings.cc b/shell/common/api/electron_bindings.cc index b1f9ac3f114b2..7651548d3d30e 100644 --- a/shell/common/api/electron_bindings.cc +++ b/shell/common/api/electron_bindings.cc @@ -139,7 +139,7 @@ v8::Local ElectronBindings::GetHeapStatistics(v8::Isolate* isolate) { v8::HeapStatistics v8_heap_stats; isolate->GetHeapStatistics(&v8_heap_stats); - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("totalHeapSize", static_cast(v8_heap_stats.total_heap_size() >> 10)); @@ -184,7 +184,7 @@ v8::Local ElectronBindings::GetSystemMemoryInfo( return v8::Undefined(isolate); } - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("total", mem_info.total); @@ -235,7 +235,7 @@ v8::Local ElectronBindings::GetBlinkMemoryInfo( auto allocated = blink::ProcessHeap::TotalAllocatedObjectSize(); auto total = blink::ProcessHeap::TotalAllocatedSpace(); - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("allocated", static_cast(allocated >> 10)); dict.Set("total", static_cast(total >> 10)); @@ -266,7 +266,7 @@ void ElectronBindings::DidReceiveMemoryDump( for (const memory_instrumentation::GlobalMemoryDump::ProcessDump& dump : global_dump->process_dumps()) { if (target_pid == dump.pid()) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); const auto& osdump = dump.os_dump(); #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) dict.Set("residentSet", osdump.resident_set_kb); @@ -288,7 +288,7 @@ void ElectronBindings::DidReceiveMemoryDump( v8::Local ElectronBindings::GetCPUUsage( base::ProcessMetrics* metrics, v8::Isolate* isolate) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); int processor_count = base::SysInfo::NumberOfProcessors(); dict.Set("percentCPUUsage", @@ -309,7 +309,7 @@ v8::Local ElectronBindings::GetCPUUsage( v8::Local ElectronBindings::GetIOCounters(v8::Isolate* isolate) { auto metrics = base::ProcessMetrics::CreateCurrentProcessMetrics(); base::IoCounters io_counters; - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); if (metrics->GetIOCounters(&io_counters)) { diff --git a/shell/common/gin_converters/blink_converter.cc b/shell/common/gin_converters/blink_converter.cc index 75054b1b55866..0c42a4ae014a1 100644 --- a/shell/common/gin_converters/blink_converter.cc +++ b/shell/common/gin_converters/blink_converter.cc @@ -311,7 +311,7 @@ int GetKeyLocationCode(const blink::WebInputEvent& key) { v8::Local Converter::ToV8( v8::Isolate* isolate, const blink::WebKeyboardEvent& in) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("type", in.GetType()); dict.Set("key", ui::KeycodeConverter::DomKeyToKeyString(in.dom_key)); @@ -468,7 +468,7 @@ Converter::ToV8( } v8::Local EditFlagsToV8(v8::Isolate* isolate, int editFlags) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("canUndo", !!(editFlags & blink::ContextMenuDataEditFlags::kCanUndo)); dict.Set("canRedo", @@ -497,7 +497,7 @@ v8::Local EditFlagsToV8(v8::Isolate* isolate, int editFlags) { } v8::Local MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("inError", !!(mediaFlags & blink::ContextMenuData::kMediaInError)); dict.Set("isPaused", !!(mediaFlags & blink::ContextMenuData::kMediaPaused)); dict.Set("isMuted", !!(mediaFlags & blink::ContextMenuData::kMediaMuted)); @@ -522,7 +522,7 @@ v8::Local MediaFlagsToV8(v8::Isolate* isolate, int mediaFlags) { v8::Local Converter::ToV8( v8::Isolate* isolate, const blink::WebCacheResourceTypeStat& stat) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("count", static_cast(stat.count)); dict.Set("size", static_cast(stat.size)); dict.Set("liveSize", static_cast(stat.decoded_size)); @@ -532,7 +532,7 @@ v8::Local Converter::ToV8( v8::Local Converter::ToV8( v8::Isolate* isolate, const blink::WebCacheResourceTypeStats& stats) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("images", stats.images); dict.Set("scripts", stats.scripts); dict.Set("cssStyleSheets", stats.css_style_sheets); @@ -565,7 +565,7 @@ bool Converter::FromV8( v8::Local Converter::ToV8( v8::Isolate* isolate, const blink::mojom::Referrer& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("url", ConvertToV8(isolate, val.url)); dict.Set("policy", ConvertToV8(isolate, val.policy)); return gin::ConvertToV8(isolate, dict); diff --git a/shell/common/gin_converters/content_converter.cc b/shell/common/gin_converters/content_converter.cc index 3da666f1881cd..5e357a7b42446 100644 --- a/shell/common/gin_converters/content_converter.cc +++ b/shell/common/gin_converters/content_converter.cc @@ -125,7 +125,7 @@ v8::Local Converter::ToV8( const ContextMenuParamsWithRenderFrameHost& val) { const auto& params = val.first; content::RenderFrameHost* render_frame_host = val.second; - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetGetter("frame", render_frame_host, v8::DontEnum); dict.Set("x", params.x); dict.Set("y", params.y); @@ -309,7 +309,7 @@ bool Converter::FromV8(v8::Isolate* isolate, v8::Local Converter::ToV8( v8::Isolate* isolate, const content::Referrer& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("url", ConvertToV8(isolate, val.url)); dict.Set("policy", ConvertToV8(isolate, val.policy)); return gin::ConvertToV8(isolate, dict); diff --git a/shell/common/gin_converters/file_dialog_converter.cc b/shell/common/gin_converters/file_dialog_converter.cc index 2f12c71a18cb2..f1a0d11fffbb9 100644 --- a/shell/common/gin_converters/file_dialog_converter.cc +++ b/shell/common/gin_converters/file_dialog_converter.cc @@ -27,7 +27,7 @@ bool Converter::FromV8(v8::Isolate* isolate, v8::Local Converter::ToV8( v8::Isolate* isolate, const file_dialog::Filter& in) { - gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin::Dictionary::CreateEmpty(isolate); dict.Set("name", in.first); dict.Set("extensions", in.second); @@ -58,7 +58,7 @@ bool Converter::FromV8( v8::Local Converter::ToV8( v8::Isolate* isolate, const file_dialog::DialogSettings& in) { - gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin::Dictionary::CreateEmpty(isolate); dict.Set("window", electron::api::BrowserWindow::From(isolate, in.parent_window)); diff --git a/shell/common/gin_converters/gfx_converter.cc b/shell/common/gin_converters/gfx_converter.cc index a52d90bb8b00d..eff8a735d7390 100644 --- a/shell/common/gin_converters/gfx_converter.cc +++ b/shell/common/gin_converters/gfx_converter.cc @@ -17,7 +17,7 @@ namespace gin { v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Point& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("x", val.x()); dict.Set("y", val.y()); @@ -40,7 +40,7 @@ bool Converter::FromV8(v8::Isolate* isolate, v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::PointF& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("x", val.x()); dict.Set("y", val.y()); @@ -62,7 +62,7 @@ bool Converter::FromV8(v8::Isolate* isolate, v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Size& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("width", val.width()); dict.Set("height", val.height()); @@ -84,7 +84,7 @@ bool Converter::FromV8(v8::Isolate* isolate, v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Rect& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("x", val.x()); dict.Set("y", val.y()); @@ -141,7 +141,7 @@ struct Converter { v8::Local Converter::ToV8( v8::Isolate* isolate, const display::Display& val) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.SetHidden("simple", true); dict.Set("id", val.id()); dict.Set("label", val.label()); diff --git a/shell/common/gin_converters/net_converter.cc b/shell/common/gin_converters/net_converter.cc index be1bc504160ff..c477bff4d3076 100644 --- a/shell/common/gin_converters/net_converter.cc +++ b/shell/common/gin_converters/net_converter.cc @@ -59,7 +59,7 @@ bool CertFromData(const std::string& data, v8::Local Converter::ToV8( v8::Isolate* isolate, const net::AuthChallengeInfo& val) { - gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin::Dictionary::CreateEmpty(isolate); dict.Set("isProxy", val.is_proxy); dict.Set("scheme", val.scheme); dict.Set("host", val.challenger.host()); @@ -610,7 +610,7 @@ bool Converter>::FromV8( v8::Local Converter::ToV8( v8::Isolate* isolate, const network::ResourceRequest& val) { - gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin::Dictionary::CreateEmpty(isolate); dict.Set("method", val.method); dict.Set("url", val.url.spec()); dict.Set("referrer", val.referrer.spec()); @@ -624,7 +624,7 @@ v8::Local Converter::ToV8( v8::Local Converter::ToV8( v8::Isolate* isolate, electron::VerifyRequestParams val) { - gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin::Dictionary::CreateEmpty(isolate); dict.Set("hostname", val.hostname); dict.Set("certificate", val.certificate); dict.Set("validatedCertificate", val.validated_certificate); @@ -638,7 +638,7 @@ v8::Local Converter::ToV8( v8::Local Converter::ToV8( v8::Isolate* isolate, const net::HttpVersion& val) { - gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin::Dictionary::CreateEmpty(isolate); dict.Set("major", static_cast(val.major_value())); dict.Set("minor", static_cast(val.minor_value())); return ConvertToV8(isolate, dict); @@ -648,7 +648,7 @@ v8::Local Converter::ToV8( v8::Local Converter::ToV8( v8::Isolate* isolate, const net::RedirectInfo& val) { - gin::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin::Dictionary::CreateEmpty(isolate); dict.Set("statusCode", val.status_code); dict.Set("newMethod", val.new_method); diff --git a/shell/common/gin_converters/serial_port_info_converter.h b/shell/common/gin_converters/serial_port_info_converter.h index c772967112838..26a4b81190caf 100644 --- a/shell/common/gin_converters/serial_port_info_converter.h +++ b/shell/common/gin_converters/serial_port_info_converter.h @@ -16,7 +16,7 @@ struct Converter { static v8::Local ToV8( v8::Isolate* isolate, const device::mojom::SerialPortInfoPtr& port) { - gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate); + auto dict = gin_helper::Dictionary::CreateEmpty(isolate); dict.Set("portId", port->token.ToString()); dict.Set("portName", port->path.BaseName().LossyDisplayName()); if (port->display_name && !port->display_name->empty()) diff --git a/shell/common/gin_helper/callback.cc b/shell/common/gin_helper/callback.cc index fe2d46bd049c0..94f33493e225c 100644 --- a/shell/common/gin_helper/callback.cc +++ b/shell/common/gin_helper/callback.cc @@ -126,7 +126,7 @@ v8::Local CreateFunctionFromTranslater(v8::Isolate* isolate, v8::Local::New(isolate, g_call_translater); auto* holder = new TranslaterHolder(isolate); holder->translater = translater; - gin::Dictionary state = gin::Dictionary::CreateEmpty(isolate); + auto state = gin::Dictionary::CreateEmpty(isolate); if (one_time) state.Set("oneTime", true); auto context = isolate->GetCurrentContext(); diff --git a/shell/common/gin_helper/dictionary.h b/shell/common/gin_helper/dictionary.h index 9d3fd527c3799..dbf7a9c33e636 100644 --- a/shell/common/gin_helper/dictionary.h +++ b/shell/common/gin_helper/dictionary.h @@ -31,6 +31,10 @@ class Dictionary : public gin::Dictionary { Dictionary(const gin::Dictionary& dict) // NOLINT(runtime/explicit) : gin::Dictionary(dict) {} + static Dictionary CreateEmpty(v8::Isolate* isolate) { + return gin::Dictionary::CreateEmpty(isolate); + } + // Differences from the Get method in gin::Dictionary: // 1. This is a const method; // 2. It checks whether the key exists before reading; diff --git a/shell/renderer/electron_sandboxed_renderer_client.cc b/shell/renderer/electron_sandboxed_renderer_client.cc index 9a6fa489c0057..1cef1205922e1 100644 --- a/shell/renderer/electron_sandboxed_renderer_client.cc +++ b/shell/renderer/electron_sandboxed_renderer_client.cc @@ -137,7 +137,7 @@ void ElectronSandboxedRendererClient::InitializeBindings( b.SetMethod("get", GetBinding); b.SetMethod("createPreloadScript", CreatePreloadScript); - gin_helper::Dictionary process = gin::Dictionary::CreateEmpty(isolate); + auto process = gin_helper::Dictionary::CreateEmpty(isolate); b.Set("process", process); ElectronBindings::BindProcess(isolate, &process, metrics_.get()); diff --git a/shell/renderer/renderer_client_base.cc b/shell/renderer/renderer_client_base.cc index e5309b3989796..b80ba7a487394 100644 --- a/shell/renderer/renderer_client_base.cc +++ b/shell/renderer/renderer_client_base.cc @@ -596,7 +596,7 @@ void RendererClientBase::SetupMainWorldOverrides( v8::HandleScope handle_scope(isolate); v8::Context::Scope context_scope(context); - gin_helper::Dictionary isolated_api = gin::Dictionary::CreateEmpty(isolate); + auto isolated_api = gin_helper::Dictionary::CreateEmpty(isolate); isolated_api.SetMethod("allowGuestViewElementDefinition", &AllowGuestViewElementDefinition); isolated_api.SetMethod("setIsWebView", &SetIsWebView); From 80a6c8aecd43e53b2d4c4a4eed9596edc29a0c4c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 21 Aug 2023 03:29:25 -0500 Subject: [PATCH 87/93] fix: dangling raw_ptr in ElectronBrowserMainParts dtor (#39539) * fix: dangling raw_ptr in ElectronBrowserMainParts dtor * fixup! fix: dangling raw_ptr in ElectronBrowserMainParts dtor Browser::WhenReady() holds a reference to JsEnv isolate so must come after --- shell/browser/electron_browser_main_parts.cc | 10 +++++----- shell/browser/electron_browser_main_parts.h | 13 +++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc index 6995be4069bbb..61c0b3df01069 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -204,11 +204,11 @@ ElectronBrowserMainParts* ElectronBrowserMainParts::self_ = nullptr; ElectronBrowserMainParts::ElectronBrowserMainParts() : fake_browser_process_(std::make_unique()), - browser_(std::make_unique()), - node_bindings_( - NodeBindings::Create(NodeBindings::BrowserEnvironment::kBrowser)), - electron_bindings_( - std::make_unique(node_bindings_->uv_loop())) { + node_bindings_{ + NodeBindings::Create(NodeBindings::BrowserEnvironment::kBrowser)}, + electron_bindings_{ + std::make_unique(node_bindings_->uv_loop())}, + browser_{std::make_unique()} { DCHECK(!self_) << "Cannot have two ElectronBrowserMainParts"; self_ = this; } diff --git a/shell/browser/electron_browser_main_parts.h b/shell/browser/electron_browser_main_parts.h index 917da86260043..69f4c32cd9678 100644 --- a/shell/browser/electron_browser_main_parts.h +++ b/shell/browser/electron_browser_main_parts.h @@ -157,11 +157,20 @@ class ElectronBrowserMainParts : public content::BrowserMainParts { // Before then, we just exit() without any intermediate steps. absl::optional exit_code_; - std::unique_ptr js_env_; - std::unique_ptr browser_; std::unique_ptr node_bindings_; + + // depends-on: node_bindings_ std::unique_ptr electron_bindings_; + + // depends-on: node_bindings_ + std::unique_ptr js_env_; + + // depends-on: js_env_'s isolate std::unique_ptr node_env_; + + // depends-on: js_env_'s isolate + std::unique_ptr browser_; + std::unique_ptr icon_manager_; std::unique_ptr field_trial_list_; From cdf874ee2dd5f34066546f3cc96be40cbe06ba3a Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 21 Aug 2023 15:58:09 +0200 Subject: [PATCH 88/93] chore: remove deprecated `getTrafficLightPosition()` / `setTrafficLightPosition()` (#39479) chore: remove deprecated getTrafficLightPosition() / setTrafficLightPosition() --- docs/api/browser-window.md | 19 ---------------- docs/breaking-changes.md | 40 +++++++++++++++++++++++++++++++++ lib/browser/api/base-window.ts | 20 ----------------- spec/api-browser-window-spec.ts | 40 --------------------------------- 4 files changed, 40 insertions(+), 79 deletions(-) diff --git a/docs/api/browser-window.md b/docs/api/browser-window.md index d5d61e47e963a..6e829db202ed7 100644 --- a/docs/api/browser-window.md +++ b/docs/api/browser-window.md @@ -1595,25 +1595,6 @@ Passing `null` will reset the position to default. Returns `Point | null` - The custom position for the traffic light buttons in frameless window, `null` will be returned when there is no custom position. -#### `win.setTrafficLightPosition(position)` _macOS_ _Deprecated_ - -* `position` [Point](structures/point.md) - -Set a custom position for the traffic light buttons in frameless window. -Passing `{ x: 0, y: 0 }` will reset the position to default. - -> **Note** -> This function is deprecated. Use [setWindowButtonPosition](#winsetwindowbuttonpositionposition-macos) instead. - -#### `win.getTrafficLightPosition()` _macOS_ _Deprecated_ - -Returns `Point` - The custom position for the traffic light buttons in -frameless window, `{ x: 0, y: 0 }` will be returned when there is no custom -position. - -> **Note** -> This function is deprecated. Use [getWindowButtonPosition](#wingetwindowbuttonposition-macos) instead. - #### `win.setTouchBar(touchBar)` _macOS_ * `touchBar` TouchBar | null diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index e71bb5690d76b..7a15b66b1fd40 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -12,6 +12,46 @@ This document uses the following convention to categorize breaking changes: * **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release. * **Removed:** An API or feature was removed, and is no longer supported by Electron. +## Planned Breaking API Changes (28.0) + +### Removed: `BrowserWindow.setTrafficLightPosition(position)` + +`BrowserWindow.setTrafficLightPosition(position)` has been removed, the +`BrowserWindow.setWindowButtonPosition(position)` API should be used instead +which accepts `null` instead of `{ x: 0, y: 0 }` to reset the position to +system default. + +```js +// Removed in Electron 28 +win.setTrafficLightPosition({ x: 10, y: 10 }) +win.setTrafficLightPosition({ x: 0, y: 0 }) + +// Replace with +win.setWindowButtonPosition({ x: 10, y: 10 }) +win.setWindowButtonPosition(null) +``` + +### Removed: `BrowserWindow.getTrafficLightPosition()` + +`BrowserWindow.getTrafficLightPosition()` has been removed, the +`BrowserWindow.getWindowButtonPosition()` API should be used instead +which returns `null` instead of `{ x: 0, y: 0 }` when there is no custom +position. + +```js +// Removed in Electron 28 +const pos = win.getTrafficLightPosition() +if (pos.x === 0 && pos.y === 0) { + // No custom position. +} + +// Replace with +const ret = win.getWindowButtonPosition() +if (ret === null) { + // No custom position. +} +``` + ## Planned Breaking API Changes (27.0) ### Removed: macOS 10.13 / 10.14 support diff --git a/lib/browser/api/base-window.ts b/lib/browser/api/base-window.ts index 45a200e125d67..28671d7c1de7c 100644 --- a/lib/browser/api/base-window.ts +++ b/lib/browser/api/base-window.ts @@ -1,6 +1,5 @@ import { EventEmitter } from 'events'; import type { BaseWindow as TLWT } from 'electron/main'; -import * as deprecate from '@electron/internal/common/deprecate'; const { BaseWindow } = process._linkedBinding('electron_browser_base_window') as { BaseWindow: typeof TLWT }; Object.setPrototypeOf(BaseWindow.prototype, EventEmitter.prototype); @@ -16,25 +15,6 @@ BaseWindow.prototype._init = function () { } }; -// Deprecation. -const setTrafficLightPositionDeprecated = deprecate.warnOnce('setTrafficLightPosition', 'setWindowButtonPosition'); -// Converting to any as the methods are defined under BrowserWindow in our docs. -(BaseWindow as any).prototype.setTrafficLightPosition = function (pos: Electron.Point) { - setTrafficLightPositionDeprecated(); - if (typeof pos === 'object' && pos.x === 0 && pos.y === 0) { - this.setWindowButtonPosition(null); - } else { - this.setWindowButtonPosition(pos); - } -}; - -const getTrafficLightPositionDeprecated = deprecate.warnOnce('getTrafficLightPosition', 'getWindowButtonPosition'); -(BaseWindow as any).prototype.getTrafficLightPosition = function () { - getTrafficLightPositionDeprecated(); - const pos = this.getWindowButtonPosition(); - return pos === null ? { x: 0, y: 0 } : pos; -}; - // Properties Object.defineProperty(BaseWindow.prototype, 'autoHideMenuBar', { diff --git a/spec/api-browser-window-spec.ts b/spec/api-browser-window-spec.ts index c2057bce7b32a..05fff05840651 100644 --- a/spec/api-browser-window-spec.ts +++ b/spec/api-browser-window-spec.ts @@ -2580,46 +2580,6 @@ describe('BrowserWindow module', () => { expect(w.getWindowButtonPosition()).to.deep.equal(newPos); }); }); - - // The set/getTrafficLightPosition APIs are deprecated. - describe('BrowserWindow.getTrafficLightPosition(pos)', () => { - it('returns { x: 0, y: 0 } when there is no custom position', () => { - const w = new BrowserWindow({ show: false }); - expect(w.getTrafficLightPosition()).to.deep.equal({ x: 0, y: 0 }); - }); - - it('gets position property for "hidden" titleBarStyle', () => { - const w = new BrowserWindow({ show: false, titleBarStyle: 'hidden', trafficLightPosition: pos }); - expect(w.getTrafficLightPosition()).to.deep.equal(pos); - }); - - it('gets position property for "customButtonsOnHover" titleBarStyle', () => { - const w = new BrowserWindow({ show: false, titleBarStyle: 'customButtonsOnHover', trafficLightPosition: pos }); - expect(w.getTrafficLightPosition()).to.deep.equal(pos); - }); - }); - - describe('BrowserWindow.setTrafficLightPosition(pos)', () => { - it('resets the position when { x: 0, y: 0 } is passed', () => { - const w = new BrowserWindow({ show: false, titleBarStyle: 'hidden', trafficLightPosition: pos }); - w.setTrafficLightPosition({ x: 0, y: 0 }); - expect(w.getTrafficLightPosition()).to.deep.equal({ x: 0, y: 0 }); - }); - - it('sets position property for "hidden" titleBarStyle', () => { - const w = new BrowserWindow({ show: false, titleBarStyle: 'hidden', trafficLightPosition: pos }); - const newPos = { x: 20, y: 20 }; - w.setTrafficLightPosition(newPos); - expect(w.getTrafficLightPosition()).to.deep.equal(newPos); - }); - - it('sets position property for "customButtonsOnHover" titleBarStyle', () => { - const w = new BrowserWindow({ show: false, titleBarStyle: 'customButtonsOnHover', trafficLightPosition: pos }); - const newPos = { x: 20, y: 20 }; - w.setTrafficLightPosition(newPos); - expect(w.getTrafficLightPosition()).to.deep.equal(newPos); - }); - }); }); ifdescribe(process.platform === 'win32')('BrowserWindow.setAppDetails(options)', () => { From eca316b0b8b6b9cf6f592ccfe32031eb2f416b3c Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 22 Aug 2023 06:43:08 +0200 Subject: [PATCH 89/93] feat: expose dummy module.exports to the sandboxed preload scripts (#39484) --- lib/sandboxed_renderer/init.ts | 5 +++-- spec/chromium-spec.ts | 2 +- spec/fixtures/module/preload.js | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/sandboxed_renderer/init.ts b/lib/sandboxed_renderer/init.ts index cf16e33344fa7..fb3768b62ac51 100644 --- a/lib/sandboxed_renderer/init.ts +++ b/lib/sandboxed_renderer/init.ts @@ -120,15 +120,16 @@ require('@electron/internal/renderer/common-init'); // - `Buffer`: Shim of `Buffer` implementation // - `global`: The window object, which is aliased to `global` by webpack. function runPreloadScript (preloadSrc: string) { - const preloadWrapperSrc = `(function(require, process, Buffer, global, setImmediate, clearImmediate, exports) { + const preloadWrapperSrc = `(function(require, process, Buffer, global, setImmediate, clearImmediate, exports, module) { ${preloadSrc} })`; // eval in window scope const preloadFn = binding.createPreloadScript(preloadWrapperSrc); const { setImmediate, clearImmediate } = require('timers'); + const exports = {}; - preloadFn(preloadRequire, preloadProcess, Buffer, global, setImmediate, clearImmediate, {}); + preloadFn(preloadRequire, preloadProcess, Buffer, global, setImmediate, clearImmediate, exports, { exports }); } for (const { preloadPath, preloadSrc, preloadError } of preloadScripts) { diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index da937aa45485a..fb3907089f2a4 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -1186,7 +1186,7 @@ describe('chromium features', () => { w.webContents.executeJavaScript('window.child = window.open(); child.opener = null'); const [, { webContents }] = await once(app, 'browser-window-created'); const [,, message] = await once(webContents, 'console-message'); - expect(message).to.equal('{"require":"function","module":"undefined","process":"object","Buffer":"function"}'); + expect(message).to.equal('{"require":"function","module":"object","exports":"object","process":"object","Buffer":"function"}'); }); it('disables the tag when it is disabled on the parent window', async () => { diff --git a/spec/fixtures/module/preload.js b/spec/fixtures/module/preload.js index aa7bba4cae8f0..3db67d9bde9b1 100644 --- a/spec/fixtures/module/preload.js +++ b/spec/fixtures/module/preload.js @@ -1,6 +1,7 @@ const types = { require: typeof require, module: typeof module, + exports: typeof exports, process: typeof process, Buffer: typeof Buffer }; From e22a7cfd59192bd086515e726acb69aa6af70b4e Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 22 Aug 2023 06:43:30 +0200 Subject: [PATCH 90/93] chore: remove obsolete "simple" object annotations for the remote module (#39486) --- shell/browser/api/electron_api_app.cc | 3 --- shell/browser/api/electron_api_in_app_purchase.cc | 6 ------ shell/browser/api/electron_api_system_preferences.cc | 1 - shell/common/api/electron_bindings.cc | 5 ----- shell/common/gin_converters/gfx_converter.cc | 5 ----- 5 files changed, 20 deletions(-) diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index 415ed4efc61bd..ac6b1c79d0e5c 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -1347,8 +1347,6 @@ std::vector App::GetAppMetrics(v8::Isolate* isolate) { auto pid_dict = gin_helper::Dictionary::CreateEmpty(isolate); auto cpu_dict = gin_helper::Dictionary::CreateEmpty(isolate); - pid_dict.SetHidden("simple", true); - cpu_dict.SetHidden("simple", true); cpu_dict.Set( "percentCPUUsage", process_metric.second->metrics->GetPlatformIndependentCPUUsage() / @@ -1383,7 +1381,6 @@ std::vector App::GetAppMetrics(v8::Isolate* isolate) { auto memory_info = process_metric.second->GetMemoryInfo(); auto memory_dict = gin_helper::Dictionary::CreateEmpty(isolate); - memory_dict.SetHidden("simple", true); memory_dict.Set("workingSetSize", static_cast(memory_info.working_set_size >> 10)); memory_dict.Set( diff --git a/shell/browser/api/electron_api_in_app_purchase.cc b/shell/browser/api/electron_api_in_app_purchase.cc index 5d93a3564f837..ac78a07f1a54c 100644 --- a/shell/browser/api/electron_api_in_app_purchase.cc +++ b/shell/browser/api/electron_api_in_app_purchase.cc @@ -21,7 +21,6 @@ struct Converter { v8::Isolate* isolate, const in_app_purchase::PaymentDiscount& paymentDiscount) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("identifier", paymentDiscount.identifier); dict.Set("keyIdentifier", paymentDiscount.keyIdentifier); dict.Set("nonce", paymentDiscount.nonce); @@ -36,7 +35,6 @@ struct Converter { static v8::Local ToV8(v8::Isolate* isolate, const in_app_purchase::Payment& payment) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("productIdentifier", payment.productIdentifier); dict.Set("quantity", payment.quantity); dict.Set("applicationUsername", payment.applicationUsername); @@ -52,7 +50,6 @@ struct Converter { static v8::Local ToV8(v8::Isolate* isolate, const in_app_purchase::Transaction& val) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("transactionIdentifier", val.transactionIdentifier); dict.Set("transactionDate", val.transactionDate); dict.Set("originalTransactionIdentifier", @@ -72,7 +69,6 @@ struct Converter { const in_app_purchase::ProductSubscriptionPeriod& productSubscriptionPeriod) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("numberOfUnits", productSubscriptionPeriod.numberOfUnits); dict.Set("unit", productSubscriptionPeriod.unit); return dict.GetHandle(); @@ -85,7 +81,6 @@ struct Converter { v8::Isolate* isolate, const in_app_purchase::ProductDiscount& productDiscount) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("identifier", productDiscount.identifier); dict.Set("type", productDiscount.type); dict.Set("price", productDiscount.price); @@ -105,7 +100,6 @@ struct Converter { static v8::Local ToV8(v8::Isolate* isolate, const in_app_purchase::Product& val) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("productIdentifier", val.productIdentifier); dict.Set("localizedDescription", val.localizedDescription); dict.Set("localizedTitle", val.localizedTitle); diff --git a/shell/browser/api/electron_api_system_preferences.cc b/shell/browser/api/electron_api_system_preferences.cc index ccbe9db8278af..302dc361fe511 100644 --- a/shell/browser/api/electron_api_system_preferences.cc +++ b/shell/browser/api/electron_api_system_preferences.cc @@ -36,7 +36,6 @@ SystemPreferences::~SystemPreferences() = default; v8::Local SystemPreferences::GetAnimationSettings( v8::Isolate* isolate) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("shouldRenderRichAnimation", gfx::Animation::ShouldRenderRichAnimation()); dict.Set("scrollAnimationsEnabledBySystem", diff --git a/shell/common/api/electron_bindings.cc b/shell/common/api/electron_bindings.cc index 7651548d3d30e..a974c775f0c9c 100644 --- a/shell/common/api/electron_bindings.cc +++ b/shell/common/api/electron_bindings.cc @@ -140,7 +140,6 @@ v8::Local ElectronBindings::GetHeapStatistics(v8::Isolate* isolate) { isolate->GetHeapStatistics(&v8_heap_stats); auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("totalHeapSize", static_cast(v8_heap_stats.total_heap_size() >> 10)); dict.Set( @@ -185,7 +184,6 @@ v8::Local ElectronBindings::GetSystemMemoryInfo( } auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("total", mem_info.total); // See Chromium's "base/process/process_metrics.h" for an explanation. @@ -236,7 +234,6 @@ v8::Local ElectronBindings::GetBlinkMemoryInfo( auto total = blink::ProcessHeap::TotalAllocatedSpace(); auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("allocated", static_cast(allocated >> 10)); dict.Set("total", static_cast(total >> 10)); return dict.GetHandle(); @@ -289,7 +286,6 @@ v8::Local ElectronBindings::GetCPUUsage( base::ProcessMetrics* metrics, v8::Isolate* isolate) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); int processor_count = base::SysInfo::NumberOfProcessors(); dict.Set("percentCPUUsage", metrics->GetPlatformIndependentCPUUsage() / processor_count); @@ -310,7 +306,6 @@ v8::Local ElectronBindings::GetIOCounters(v8::Isolate* isolate) { auto metrics = base::ProcessMetrics::CreateCurrentProcessMetrics(); base::IoCounters io_counters; auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); if (metrics->GetIOCounters(&io_counters)) { dict.Set("readOperationCount", io_counters.ReadOperationCount); diff --git a/shell/common/gin_converters/gfx_converter.cc b/shell/common/gin_converters/gfx_converter.cc index eff8a735d7390..4cf81c0f695be 100644 --- a/shell/common/gin_converters/gfx_converter.cc +++ b/shell/common/gin_converters/gfx_converter.cc @@ -18,7 +18,6 @@ namespace gin { v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Point& val) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("x", val.x()); dict.Set("y", val.y()); return dict.GetHandle(); @@ -41,7 +40,6 @@ bool Converter::FromV8(v8::Isolate* isolate, v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::PointF& val) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("x", val.x()); dict.Set("y", val.y()); return dict.GetHandle(); @@ -63,7 +61,6 @@ bool Converter::FromV8(v8::Isolate* isolate, v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Size& val) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("width", val.width()); dict.Set("height", val.height()); return dict.GetHandle(); @@ -85,7 +82,6 @@ bool Converter::FromV8(v8::Isolate* isolate, v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Rect& val) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("x", val.x()); dict.Set("y", val.y()); dict.Set("width", val.width()); @@ -142,7 +138,6 @@ v8::Local Converter::ToV8( v8::Isolate* isolate, const display::Display& val) { auto dict = gin_helper::Dictionary::CreateEmpty(isolate); - dict.SetHidden("simple", true); dict.Set("id", val.id()); dict.Set("label", val.label()); dict.Set("bounds", val.bounds()); From 1057d4144bb8885fb897ac22f7b651b5ac1474c8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 22 Aug 2023 18:13:49 +0900 Subject: [PATCH 91/93] chore: move node headers generation to electron (#39589) --- .circleci/config/base.yml | 4 +- BUILD.gn | 68 +++++++++ appveyor-woa.yml | 4 +- appveyor.yml | 4 +- docs/development/build-instructions-gn.md | 2 +- docs/development/testing.md | 2 +- patches/node/build_add_gn_build_files.patch | 147 ++------------------ script/generate_node_version_header.py | 26 ++++ script/tar.py | 12 ++ 9 files changed, 123 insertions(+), 146 deletions(-) create mode 100755 script/generate_node_version_header.py create mode 100644 script/tar.py diff --git a/.circleci/config/base.yml b/.circleci/config/base.yml index 18a316cda1b05..a4e476ccbc3f6 100644 --- a/.circleci/config/base.yml +++ b/.circleci/config/base.yml @@ -645,7 +645,7 @@ step-nodejs-headers-build: &step-nodejs-headers-build name: Build Node.js headers command: | cd src - ninja -C out/Default third_party/electron_node:headers + ninja -C out/Default electron:node_headers step-electron-publish: &step-electron-publish run: @@ -1072,7 +1072,7 @@ commands: build-type: << parameters.build-type >> - *step-maybe-electron-dist-strip - step-electron-dist-build: - additional-targets: shell_browser_ui_unittests third_party/electron_node:headers third_party/electron_node:overlapped-checker electron:hunspell_dictionaries_zip + additional-targets: shell_browser_ui_unittests electron:node_headers third_party/electron_node:overlapped-checker electron:hunspell_dictionaries_zip - *step-show-goma-stats diff --git a/BUILD.gn b/BUILD.gn index 2577ec5e0abb2..7c1cdff21a4c4 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -9,6 +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/node.gni") import("//third_party/ffmpeg/ffmpeg_options.gni") import("//tools/generate_library_loader/generate_library_loader.gni") import("//tools/grit/grit_rule.gni") @@ -1567,3 +1568,70 @@ action("libcxx_objects_zip") { group("electron") { public_deps = [ ":electron_app" ] } + +##### node_headers + +node_dir = "../third_party/electron_node" +node_files = read_file("$node_dir/filenames.json", "json") +node_headers_dir = "$root_gen_dir/node_headers" + +header_group_index = 0 +header_groups = [] +foreach(header_group, node_files.headers) { + copy("node_headers_${header_group_index}") { + sources = rebase_path(header_group.files, ".", node_dir) + outputs = + [ "$node_headers_dir/${header_group.dest_dir}/{{source_file_part}}" ] + } + header_groups += [ ":node_headers_${header_group_index}" ] + header_group_index += 1 +} + +copy("zlib_headers") { + sources = [ + "$node_dir/deps/zlib/zconf.h", + "$node_dir/deps/zlib/zlib.h", + ] + outputs = [ "$node_headers_dir/include/node/{{source_file_part}}" ] +} + +copy("node_gypi_headers") { + deps = [ ":generate_config_gypi" ] + sources = [ + "$node_dir/common.gypi", + "$root_gen_dir/config.gypi", + ] + outputs = [ "$node_headers_dir/include/node/{{source_file_part}}" ] +} + +action("node_version_header") { + inputs = [ "$node_dir/src/node_version.h" ] + outputs = [ "$node_headers_dir/include/node/node_version.h" ] + script = "script/generate_node_version_header.py" + args = rebase_path(inputs) + rebase_path(outputs) + if (node_module_version != "") { + args += [ "$node_module_version" ] + } +} + +action("tar_node_headers") { + deps = [ ":copy_node_headers" ] + outputs = [ "$root_gen_dir/node_headers.tar.gz" ] + script = "script/tar.py" + args = [ + rebase_path("$root_gen_dir/node_headers"), + rebase_path(outputs[0]), + ] +} + +group("copy_node_headers") { + public_deps = header_groups + [ + ":node_gypi_headers", + ":node_version_header", + ":zlib_headers", + ] +} + +group("node_headers") { + public_deps = [ ":tar_node_headers" ] +} diff --git a/appveyor-woa.yml b/appveyor-woa.yml index 68daad4cf4ff3..bceebd1fb7e7f 100644 --- a/appveyor-woa.yml +++ b/appveyor-woa.yml @@ -167,7 +167,7 @@ for: - cd ..\.. - ninja -C out/Default electron:hunspell_dictionaries_zip - ninja -C out/Default electron:electron_chromedriver_zip - - ninja -C out/Default third_party/electron_node:headers + - ninja -C out/Default electron:node_headers - python %LOCAL_GOMA_DIR%\goma_ctl.py stat - ps: >- Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json @@ -319,4 +319,4 @@ for: on_finish: # Uncomment these lines to enable RDP # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - - if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log ) \ No newline at end of file + - if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log ) diff --git a/appveyor.yml b/appveyor.yml index f9f17eae66491..0830ae40312a6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -165,7 +165,7 @@ for: - cd ..\.. - ninja -C out/Default electron:hunspell_dictionaries_zip - ninja -C out/Default electron:electron_chromedriver_zip - - ninja -C out/Default third_party/electron_node:headers + - ninja -C out/Default electron:node_headers - python %LOCAL_GOMA_DIR%\goma_ctl.py stat - ps: >- Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json @@ -319,4 +319,4 @@ for: on_finish: # Uncomment these lines to enable RDP # - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - - if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log ) \ No newline at end of file + - if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log ) diff --git a/docs/development/build-instructions-gn.md b/docs/development/build-instructions-gn.md index 4532a71ea68eb..acf7cf048ac4c 100644 --- a/docs/development/build-instructions-gn.md +++ b/docs/development/build-instructions-gn.md @@ -225,7 +225,7 @@ generate build headers for the modules to compile against, run the following under `src/` directory. ```sh -$ ninja -C out/Testing third_party/electron_node:headers +$ ninja -C out/Testing electron:node_headers ``` You can now [run the tests](testing.md#unit-tests). diff --git a/docs/development/testing.md b/docs/development/testing.md index f29738f6c7272..cce8ea5eab463 100644 --- a/docs/development/testing.md +++ b/docs/development/testing.md @@ -66,7 +66,7 @@ the Node.js source tree. 2. Node headers have to be compiled for your configuration. ```powershell - ninja -C out\Testing third_party\electron_node:headers + ninja -C out\Testing electron:node_headers ``` 3. The electron.lib has to be copied as node.lib. diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch index 7cd86fd3735f0..90d428a52602b 100644 --- a/patches/node/build_add_gn_build_files.patch +++ b/patches/node/build_add_gn_build_files.patch @@ -7,10 +7,10 @@ This adds GN build files for Node, so we don't have to build with GYP. diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 -index 0000000000000000000000000000000000000000..a3e4599c21f2faa92a0dca47b1e0b4e836bb475d +index 0000000000000000000000000000000000000000..e2b19b7500b4710e3a55e08f662d989c18272b70 --- /dev/null +++ b/BUILD.gn -@@ -0,0 +1,443 @@ +@@ -0,0 +1,358 @@ +import("//v8/gni/v8.gni") +import("node.gni") + @@ -51,9 +51,6 @@ index 0000000000000000000000000000000000000000..a3e4599c21f2faa92a0dca47b1e0b4e8 + # default to https://nodejs.org/download/release/') + node_release_urlbase = "" + -+ # Allows embedders to override the NODE_MODULE_VERSION define -+ node_module_version = "" -+ + # Allows downstream packagers (eg. Linux distributions) to build Electron against system shared libraries. + use_system_cares = false + use_system_nghttp2 = false @@ -372,88 +369,6 @@ index 0000000000000000000000000000000000000000..a3e4599c21f2faa92a0dca47b1e0b4e8 + cflags_cc += [ "-Wno-sign-compare" ] + } +} -+ -+##### node_headers -+ -+node_headers_dir = "$root_gen_dir/node_headers" -+ -+header_group_index = 0 -+header_groups = [] -+foreach(header_group, node_files.headers) { -+ copy("node_headers_${header_group_index}") { -+ sources = header_group.files -+ outputs = [ -+ "$node_headers_dir/${header_group.dest_dir}/{{source_file_part}}", -+ ] -+ } -+ header_groups += [ ":node_headers_${header_group_index}" ] -+ header_group_index += 1 -+} -+ -+copy("zlib_headers") { -+ sources = [ -+ "deps/zlib/zconf.h", -+ "deps/zlib/zlib.h", -+ ] -+ outputs = [ -+ "$node_headers_dir/include/node/{{source_file_part}}", -+ ] -+} -+ -+copy("node_gypi_headers") { -+ deps = [ -+ "//electron:generate_config_gypi", -+ ] -+ sources = [ -+ "$root_gen_dir/config.gypi", -+ "common.gypi", -+ ] -+ outputs = [ -+ "$node_headers_dir/include/node/{{source_file_part}}", -+ ] -+} -+ -+action("node_version_header") { -+ inputs = [ -+ "src/node_version.h", -+ ] -+ outputs = [ -+ "$node_headers_dir/include/node/node_version.h", -+ ] -+ script = "tools/generate_node_version_header.py" -+ args = [ rebase_path("src/node_version.h"), rebase_path(outputs[0]) ] -+ if (node_module_version != "") { -+ args += [ "$node_module_version" ] -+ } -+} -+ -+action("tar_headers") { -+ deps = [ -+ ":copy_headers", -+ ] -+ outputs = [ -+ "$root_gen_dir/node_headers.tar.gz", -+ ] -+ script = "tools/tar.py" -+ args = [ -+ rebase_path("$root_gen_dir/node_headers"), -+ rebase_path(outputs[0]), -+ ] -+} -+ -+group("copy_headers") { -+ public_deps = header_groups + [ -+ ":zlib_headers", -+ ":node_gypi_headers", -+ ":node_version_header", -+ ] -+} -+ -+group("headers") { -+ public_deps = [ -+ ":tar_headers", -+ ] -+} diff --git a/deps/ada/BUILD.gn b/deps/ada/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..a564653c3f05608d59fed5aa071d63b81f4e0e42 @@ -1932,10 +1847,15 @@ index 0000000000000000000000000000000000000000..7d86765bf229275ba55d37a452ef2483 +} diff --git a/node.gni b/node.gni new file mode 100644 -index 0000000000000000000000000000000000000000..9b1a4048a4a64c36d88de0bbe1a548c906aaa22c +index 0000000000000000000000000000000000000000..345327e89d71585c558fabcf11970d7c5363cd3a --- /dev/null +++ b/node.gni -@@ -0,0 +1,29 @@ +@@ -0,0 +1,34 @@ ++declare_args() { ++ # Allows embedders to override the NODE_MODULE_VERSION define ++ node_module_version = "" ++} ++ +# Run an action with a given working directory. Behaves identically to the +# action() target type, with the exception that it changes directory before +# running the script. @@ -2286,37 +2206,6 @@ index 0000000000000000000000000000000000000000..616dc0c61ed4ea1bf2fb9e4768ba2ec5 + f.write(FILENAMES_JSON_HEADER) + f.write(json.dumps(out, sort_keys=True, indent=2, separators=(',', ': '))) + f.write('\n') -diff --git a/tools/generate_node_version_header.py b/tools/generate_node_version_header.py -new file mode 100755 -index 0000000000000000000000000000000000000000..2a92eccfa582df361f2a889c0d9b32c1059baa7d ---- /dev/null -+++ b/tools/generate_node_version_header.py -@@ -0,0 +1,25 @@ -+#!/usr/bin/env python3 -+import re -+import sys -+ -+node_version_file = sys.argv[1] -+out_file = sys.argv[2] -+NMV = None -+if len(sys.argv) > 3: -+ NMV = sys.argv[3] -+ -+with open(node_version_file, 'r') as in_file, open(out_file, 'w') as out_file: -+ changed = False -+ contents = in_file.read() -+ new_contents = re.sub( -+ r'^#define NODE_MODULE_VERSION [0-9]+$', -+ '#define NODE_MODULE_VERSION ' + NMV, -+ contents, -+ flags=re.MULTILINE) -+ -+ changed = contents != new_contents -+ -+ if not changed and NMV is not None: -+ raise Exception("Did not modify the NMV from nodes value, this value MUST differ from node") -+ -+ out_file.writelines(new_contents) diff --git a/tools/install.py b/tools/install.py index f13f2ecd662a5fb985839b394b45319c091b56d4..21bc48324946d52ed2b1c9eec35c1fcd4c536570 100755 --- a/tools/install.py @@ -2477,21 +2366,3 @@ index 54c7dfce3631001e108570b19d34966edafd624f..077bba1572f05f1aa16553894703b12a return os.path.splitext(filename)[0] -diff --git a/tools/tar.py b/tools/tar.py -new file mode 100644 -index 0000000000000000000000000000000000000000..eb697be25779db62c829aac45a509804e9fff331 ---- /dev/null -+++ b/tools/tar.py -@@ -0,0 +1,12 @@ -+import os -+import sys -+import tarfile -+ -+source = sys.argv[1] -+target = sys.argv[2] -+ -+os.chdir(os.path.dirname(source)) -+ -+tarball = tarfile.open(name=os.path.basename(target), mode='w:gz') -+tarball.add(os.path.relpath(source)) -+tarball.close() diff --git a/script/generate_node_version_header.py b/script/generate_node_version_header.py new file mode 100755 index 0000000000000..60f1e54720d0c --- /dev/null +++ b/script/generate_node_version_header.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +import re +import sys + +node_version_file = sys.argv[1] +out_file = sys.argv[2] +NMV = None +if len(sys.argv) > 3: + NMV = sys.argv[3] + +with open(node_version_file, 'r') as in_file, open(out_file, 'w') as out_file: + changed = False + contents = in_file.read() + new_contents = re.sub( + r'^#define NODE_MODULE_VERSION [0-9]+$', + '#define NODE_MODULE_VERSION ' + NMV, + contents, + flags=re.MULTILINE) + + changed = contents != new_contents + + if not changed and NMV is not None: + raise Exception("Did not modify the NMV from nodes value, this value MUST " + "differ from node") + + out_file.writelines(new_contents) diff --git a/script/tar.py b/script/tar.py new file mode 100644 index 0000000000000..eb697be25779d --- /dev/null +++ b/script/tar.py @@ -0,0 +1,12 @@ +import os +import sys +import tarfile + +source = sys.argv[1] +target = sys.argv[2] + +os.chdir(os.path.dirname(source)) + +tarball = tarfile.open(name=os.path.basename(target), mode='w:gz') +tarball.add(os.path.relpath(source)) +tarball.close() From 743b520ae4a83668f273f0a2d6611ac050b0698d Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 22 Aug 2023 14:56:58 +0200 Subject: [PATCH 92/93] fix: `chrome.tabs` 'url' and 'title' are privileged information (#39595) fix: tabs url and title are privileged information --- shell/browser/extensions/api/tabs/tabs_api.cc | 31 +++++-- .../extensions/api/_permission_features.json | 6 ++ .../electron_extensions_api_provider.cc | 2 + spec/extensions-spec.ts | 82 ++++++++++++++----- .../api-async}/background.js | 0 .../api-async}/main.js | 0 .../api-async}/manifest.json | 3 +- .../chrome-tabs/no-privileges/background.js | 6 ++ .../chrome-tabs/no-privileges/main.js | 11 +++ .../chrome-tabs/no-privileges/manifest.json | 19 +++++ 10 files changed, 129 insertions(+), 31 deletions(-) rename spec/fixtures/extensions/{tabs-api-async => chrome-tabs/api-async}/background.js (100%) rename spec/fixtures/extensions/{tabs-api-async => chrome-tabs/api-async}/main.js (100%) rename spec/fixtures/extensions/{tabs-api-async => chrome-tabs/api-async}/manifest.json (82%) create mode 100644 spec/fixtures/extensions/chrome-tabs/no-privileges/background.js create mode 100644 spec/fixtures/extensions/chrome-tabs/no-privileges/main.js create mode 100644 spec/fixtures/extensions/chrome-tabs/no-privileges/manifest.json diff --git a/shell/browser/extensions/api/tabs/tabs_api.cc b/shell/browser/extensions/api/tabs/tabs_api.cc index 0cdc96819f70b..59a019bf99c4a 100644 --- a/shell/browser/extensions/api/tabs/tabs_api.cc +++ b/shell/browser/extensions/api/tabs/tabs_api.cc @@ -301,6 +301,7 @@ ExtensionFunction::ResponseAction TabsQueryFunction::Run() { tabs::Tab tab; tab.id = contents->ID(); + tab.title = base::UTF16ToUTF8(wc->GetTitle()); tab.url = wc->GetLastCommittedURL().spec(); tab.active = contents->IsFocused(); tab.audible = contents->IsCurrentlyAudible(); @@ -322,12 +323,18 @@ ExtensionFunction::ResponseAction TabsGetFunction::Run() { return RespondNow(Error("No such tab")); tabs::Tab tab; - tab.id = tab_id; - // TODO(nornagon): in Chrome, the tab URL is only available to extensions - // that have the "tabs" (or "activeTab") permission. We should do the same - // permission check here. - tab.url = contents->web_contents()->GetLastCommittedURL().spec(); + + // "title" and "url" properties are considered privileged data and can + // only be checked if the extension has the "tabs" permission or it has + // access to the WebContents's origin. + auto* wc = contents->web_contents(); + if (extension()->permissions_data()->HasAPIPermissionForTab( + contents->ID(), mojom::APIPermissionID::kTab) || + extension()->permissions_data()->HasHostPermission(wc->GetURL())) { + tab.url = wc->GetLastCommittedURL().spec(); + tab.title = base::UTF16ToUTF8(wc->GetTitle()); + } tab.active = contents->IsFocused(); @@ -609,10 +616,16 @@ ExtensionFunction::ResponseValue TabsUpdateFunction::GetResult() { auto* api_web_contents = electron::api::WebContents::From(web_contents_); tab.id = (api_web_contents ? api_web_contents->ID() : -1); - // TODO(nornagon): in Chrome, the tab URL is only available to extensions - // that have the "tabs" (or "activeTab") permission. We should do the same - // permission check here. - tab.url = web_contents_->GetLastCommittedURL().spec(); + // "title" and "url" properties are considered privileged data and can + // only be checked if the extension has the "tabs" permission or it has + // access to the WebContents's origin. + if (extension()->permissions_data()->HasAPIPermissionForTab( + api_web_contents->ID(), mojom::APIPermissionID::kTab) || + extension()->permissions_data()->HasHostPermission( + web_contents_->GetURL())) { + tab.url = web_contents_->GetLastCommittedURL().spec(); + tab.title = base::UTF16ToUTF8(web_contents_->GetTitle()); + } if (api_web_contents) tab.active = api_web_contents->IsFocused(); diff --git a/shell/common/extensions/api/_permission_features.json b/shell/common/extensions/api/_permission_features.json index 01bf003ec9020..6f54beac04326 100644 --- a/shell/common/extensions/api/_permission_features.json +++ b/shell/common/extensions/api/_permission_features.json @@ -20,5 +20,11 @@ "extension_types": [ "extension" ] + }, + "tabs": { + "channel": "stable", + "extension_types": [ + "extension" + ] } } \ No newline at end of file diff --git a/shell/common/extensions/electron_extensions_api_provider.cc b/shell/common/extensions/electron_extensions_api_provider.cc index 36cf3f8957f26..242e462f6cbf9 100644 --- a/shell/common/extensions/electron_extensions_api_provider.cc +++ b/shell/common/extensions/electron_extensions_api_provider.cc @@ -39,6 +39,8 @@ constexpr APIPermissionInfo::InitInfo permissions_to_register[] = { {mojom::APIPermissionID::kPdfViewerPrivate, "pdfViewerPrivate"}, #endif {mojom::APIPermissionID::kManagement, "management"}, + {mojom::APIPermissionID::kTab, "tabs", + APIPermissionInfo::kFlagRequiresManagementUIWarning}, }; base::span GetPermissionInfos() { return base::make_span(permissions_to_register); diff --git a/spec/extensions-spec.ts b/spec/extensions-spec.ts index 03da89c715839..cf792d97b76b2 100644 --- a/spec/extensions-spec.ts +++ b/spec/extensions-spec.ts @@ -842,15 +842,14 @@ describe('chrome extensions', () => { before(async () => { customSession = session.fromPartition(`persist:${uuid.v4()}`); - await customSession.loadExtension(path.join(fixtures, 'extensions', 'tabs-api-async')); + await customSession.loadExtension(path.join(fixtures, 'extensions', 'chrome-tabs', 'api-async')); }); beforeEach(() => { w = new BrowserWindow({ show: false, webPreferences: { - session: customSession, - nodeIntegration: true + session: customSession } }); }); @@ -913,27 +912,55 @@ describe('chrome extensions', () => { }); }); - it('get', async () => { - await w.loadURL(url); + describe('get', () => { + it('returns tab properties', async () => { + await w.loadURL(url); - const message = { method: 'get' }; - w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); + const message = { method: 'get' }; + w.webContents.executeJavaScript(`window.postMessage('${JSON.stringify(message)}', '*')`); - const [,, responseString] = await once(w.webContents, 'console-message'); + const [,, responseString] = await once(w.webContents, 'console-message'); - const response = JSON.parse(responseString); - expect(response).to.have.property('active').that.is.a('boolean'); - expect(response).to.have.property('autoDiscardable').that.is.a('boolean'); - expect(response).to.have.property('discarded').that.is.a('boolean'); - expect(response).to.have.property('groupId').that.is.a('number'); - expect(response).to.have.property('highlighted').that.is.a('boolean'); - expect(response).to.have.property('id').that.is.a('number'); - expect(response).to.have.property('incognito').that.is.a('boolean'); - expect(response).to.have.property('index').that.is.a('number'); - expect(response).to.have.property('pinned').that.is.a('boolean'); - expect(response).to.have.property('selected').that.is.a('boolean'); - expect(response).to.have.property('url').that.is.a('string'); - expect(response).to.have.property('windowId').that.is.a('number'); + const response = JSON.parse(responseString); + expect(response).to.have.property('url').that.is.a('string'); + expect(response).to.have.property('title').that.is.a('string'); + expect(response).to.have.property('active').that.is.a('boolean'); + expect(response).to.have.property('autoDiscardable').that.is.a('boolean'); + expect(response).to.have.property('discarded').that.is.a('boolean'); + expect(response).to.have.property('groupId').that.is.a('number'); + expect(response).to.have.property('highlighted').that.is.a('boolean'); + expect(response).to.have.property('id').that.is.a('number'); + expect(response).to.have.property('incognito').that.is.a('boolean'); + expect(response).to.have.property('index').that.is.a('number'); + expect(response).to.have.property('pinned').that.is.a('boolean'); + expect(response).to.have.property('selected').that.is.a('boolean'); + expect(response).to.have.property('windowId').that.is.a('number'); + }); + + it('does not return privileged properties without tabs permission', async () => { + const noPrivilegeSes = session.fromPartition(`persist:${uuid.v4()}`); + await noPrivilegeSes.loadExtension(path.join(fixtures, 'extensions', 'chrome-tabs', 'no-privileges')); + + w = new BrowserWindow({ show: false, webPreferences: { session: noPrivilegeSes } }); + await w.loadURL(url); + + w.webContents.executeJavaScript('window.postMessage(\'{}\', \'*\')'); + const [,, responseString] = await once(w.webContents, 'console-message'); + const response = JSON.parse(responseString); + expect(response).not.to.have.property('url'); + expect(response).not.to.have.property('title'); + expect(response).to.have.property('active').that.is.a('boolean'); + expect(response).to.have.property('autoDiscardable').that.is.a('boolean'); + expect(response).to.have.property('discarded').that.is.a('boolean'); + expect(response).to.have.property('groupId').that.is.a('number'); + expect(response).to.have.property('highlighted').that.is.a('boolean'); + expect(response).to.have.property('id').that.is.a('number'); + expect(response).to.have.property('incognito').that.is.a('boolean'); + expect(response).to.have.property('index').that.is.a('number'); + expect(response).to.have.property('pinned').that.is.a('boolean'); + expect(response).to.have.property('selected').that.is.a('boolean'); + expect(response).to.have.property('windowId').that.is.a('number'); + }); }); it('reload', async () => { @@ -960,6 +987,19 @@ describe('chrome extensions', () => { const [,, responseString] = await once(w.webContents, 'console-message'); const response = JSON.parse(responseString); + expect(response).to.have.property('url').that.is.a('string'); + expect(response).to.have.property('title').that.is.a('string'); + expect(response).to.have.property('active').that.is.a('boolean'); + expect(response).to.have.property('autoDiscardable').that.is.a('boolean'); + expect(response).to.have.property('discarded').that.is.a('boolean'); + expect(response).to.have.property('groupId').that.is.a('number'); + expect(response).to.have.property('highlighted').that.is.a('boolean'); + expect(response).to.have.property('id').that.is.a('number'); + expect(response).to.have.property('incognito').that.is.a('boolean'); + expect(response).to.have.property('index').that.is.a('number'); + expect(response).to.have.property('pinned').that.is.a('boolean'); + expect(response).to.have.property('selected').that.is.a('boolean'); + expect(response).to.have.property('windowId').that.is.a('number'); expect(response).to.have.property('mutedInfo').that.is.a('object'); const { mutedInfo } = response; expect(mutedInfo).to.deep.eq({ diff --git a/spec/fixtures/extensions/tabs-api-async/background.js b/spec/fixtures/extensions/chrome-tabs/api-async/background.js similarity index 100% rename from spec/fixtures/extensions/tabs-api-async/background.js rename to spec/fixtures/extensions/chrome-tabs/api-async/background.js diff --git a/spec/fixtures/extensions/tabs-api-async/main.js b/spec/fixtures/extensions/chrome-tabs/api-async/main.js similarity index 100% rename from spec/fixtures/extensions/tabs-api-async/main.js rename to spec/fixtures/extensions/chrome-tabs/api-async/main.js diff --git a/spec/fixtures/extensions/tabs-api-async/manifest.json b/spec/fixtures/extensions/chrome-tabs/api-async/manifest.json similarity index 82% rename from spec/fixtures/extensions/tabs-api-async/manifest.json rename to spec/fixtures/extensions/chrome-tabs/api-async/manifest.json index 58081152decfd..d0a208cd06fcf 100644 --- a/spec/fixtures/extensions/tabs-api-async/manifest.json +++ b/spec/fixtures/extensions/chrome-tabs/api-async/manifest.json @@ -1,5 +1,5 @@ { - "name": "tabs-api-async", + "name": "api-async", "version": "1.0", "content_scripts": [ { @@ -8,6 +8,7 @@ "run_at": "document_start" } ], + "permissions": ["tabs"], "background": { "service_worker": "background.js" }, diff --git a/spec/fixtures/extensions/chrome-tabs/no-privileges/background.js b/spec/fixtures/extensions/chrome-tabs/no-privileges/background.js new file mode 100644 index 0000000000000..d586b455a1cc1 --- /dev/null +++ b/spec/fixtures/extensions/chrome-tabs/no-privileges/background.js @@ -0,0 +1,6 @@ +/* global chrome */ + +chrome.runtime.onMessage.addListener((_request, sender, sendResponse) => { + chrome.tabs.get(sender.tab.id).then(sendResponse); + return true; +}); diff --git a/spec/fixtures/extensions/chrome-tabs/no-privileges/main.js b/spec/fixtures/extensions/chrome-tabs/no-privileges/main.js new file mode 100644 index 0000000000000..cc121154876ff --- /dev/null +++ b/spec/fixtures/extensions/chrome-tabs/no-privileges/main.js @@ -0,0 +1,11 @@ +/* global chrome */ + +chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { + sendResponse(request); +}); + +window.addEventListener('message', () => { + chrome.runtime.sendMessage({}, response => { + console.log(JSON.stringify(response)); + }); +}, false); diff --git a/spec/fixtures/extensions/chrome-tabs/no-privileges/manifest.json b/spec/fixtures/extensions/chrome-tabs/no-privileges/manifest.json new file mode 100644 index 0000000000000..f920c8bc0e20a --- /dev/null +++ b/spec/fixtures/extensions/chrome-tabs/no-privileges/manifest.json @@ -0,0 +1,19 @@ +{ + "name": "no-privileges", + "version": "1.0", + "content_scripts": [ + { + "matches": [ + "" + ], + "js": [ + "main.js" + ], + "run_at": "document_start" + } + ], + "background": { + "service_worker": "background.js" + }, + "manifest_version": 3 +} \ No newline at end of file From 401fc1d9db3e29068eb6975c82ee37b00438a289 Mon Sep 17 00:00:00 2001 From: win32ss Date: Sun, 24 Sep 2023 00:20:53 -0400 Subject: [PATCH 93/93] Updates to patches and restoration of Windows 7 support --- README.md | 4 +- docs/breaking-changes.md | 6 - docs/tutorial/notifications.md | 23 +- filenames.gni | 11 + patches/chromium/.patches | 9 +- ...dle_synthetic_mouse_events_for_touch.patch | 12 +- patches/chromium/disable-redraw-lock.patch | 78 ++ .../chromium/enable_reset_aspect_ratio.patch | 5 +- .../fix_aspect_ratio_with_max_size.patch | 4 +- ...x_remove_caption-removing_style_call.patch | 4 +- patches/node/.patches | 1 + ..._caused_by_gethostnamew_on_windows_7.patch | 182 ++++ ...g_-wdeprecated-declarations_in_libuv.patch | 4 +- .../api/electron_api_power_monitor_win.cc | 11 +- shell/browser/browser_win.cc | 88 +- .../win/notification_presenter_win.cc | 4 + .../win/notification_presenter_win7.cc | 54 ++ .../win/notification_presenter_win7.h | 37 + .../win/win32_desktop_notifications/common.h | 70 ++ .../desktop_notification_controller.cc | 436 +++++++++ .../desktop_notification_controller.h | 100 ++ .../win/win32_desktop_notifications/toast.cc | 867 ++++++++++++++++++ .../win/win32_desktop_notifications/toast.h | 109 +++ .../win32_desktop_notifications/toast_uia.cc | 258 ++++++ .../win32_desktop_notifications/toast_uia.h | 84 ++ .../notifications/win/win32_notification.cc | 70 ++ .../notifications/win/win32_notification.h | 36 + shell/browser/ui/views/win_frame_view.cc | 60 +- .../electron_desktop_window_tree_host_win.cc | 8 + .../electron_desktop_window_tree_host_win.h | 1 + shell/common/application_info_win.cc | 40 +- shell/common/language_util_win.cc | 6 + shell/common/platform_util_win.cc | 22 +- .../version-bumper/fixture_support.md | 122 +++ 34 files changed, 2749 insertions(+), 77 deletions(-) create mode 100644 patches/chromium/disable-redraw-lock.patch create mode 100644 patches/node/fix_crash_caused_by_gethostnamew_on_windows_7.patch create mode 100644 shell/browser/notifications/win/notification_presenter_win7.cc create mode 100644 shell/browser/notifications/win/notification_presenter_win7.h create mode 100644 shell/browser/notifications/win/win32_desktop_notifications/common.h create mode 100644 shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc create mode 100644 shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h create mode 100644 shell/browser/notifications/win/win32_desktop_notifications/toast.cc create mode 100644 shell/browser/notifications/win/win32_desktop_notifications/toast.h create mode 100644 shell/browser/notifications/win/win32_desktop_notifications/toast_uia.cc create mode 100644 shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h create mode 100644 shell/browser/notifications/win/win32_notification.cc create mode 100644 shell/browser/notifications/win/win32_notification.h create mode 100644 spec/fixtures/version-bumper/fixture_support.md diff --git a/README.md b/README.md index d30c8483bccac..d81c9b6e68a6c 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,9 @@ For more installation options and troubleshooting tips, see Each Electron release provides binaries for macOS, Windows, and Linux. * macOS (High Sierra and up): Electron provides 64-bit Intel and ARM binaries for macOS. Apple Silicon support was added in Electron 11. -* Windows (Windows 10 and up): Electron provides `ia32` (`x86`), `x64` (`amd64`), and `arm64` binaries for Windows. Windows on ARM support was added in Electron 5.0.8. Support for Windows 7, 8 and 8.1 was [removed in Electron 23, in line with Chromium's Windows deprecation policy](https://www.electronjs.org/blog/windows-7-to-8-1-deprecation-notice). + +* Windows (Windows 7 and up): Electron provides `ia32` (`x86`), `x64` (`amd64`), and `arm64` binaries for Windows. Windows on ARM support was added in Electron 5.0.8. + * Linux: The prebuilt binaries of Electron are built on Ubuntu 20.04. They have also been verified to work on: * Ubuntu 14.04 and newer * Fedora 24 and newer diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 7a15b66b1fd40..735828f2d8bf4 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -272,12 +272,6 @@ Additionally, the `customButtonsOnHover` BrowserWindow property previously creat As a result, if your app uses a frameless window with draggable regions on macOS, the regions which are draggable in your app may change in Electron 23. -### Removed: Windows 7 / 8 / 8.1 support - -[Windows 7, Windows 8, and Windows 8.1 are no longer supported](https://www.electronjs.org/blog/windows-7-to-8-1-deprecation-notice). Electron follows the planned Chromium deprecation policy, which will [deprecate Windows 7 support beginning in Chromium 109](https://support.google.com/chrome/thread/185534985/sunsetting-support-for-windows-7-8-8-1-in-early-2023?hl=en). - -Older versions of Electron will continue to run on these operating systems, but Windows 10 or later will be required to run Electron v23.0.0 and higher. - ### Removed: BrowserWindow `scroll-touch-*` events The deprecated `scroll-touch-begin`, `scroll-touch-end` and `scroll-touch-edge` diff --git a/docs/tutorial/notifications.md b/docs/tutorial/notifications.md index 2625cedcf28ed..606467e15a4ca 100644 --- a/docs/tutorial/notifications.md +++ b/docs/tutorial/notifications.md @@ -76,8 +76,18 @@ are subtle differences. ### Windows -For notifications on Windows, your Electron app needs to have a Start Menu shortcut with an -[AppUserModelID][app-user-model-id] and a corresponding [ToastActivatorCLSID][toast-activator-clsid]. +* On Windows 10, a shortcut to your app with an +[Application User Model ID][app-user-model-id] must be installed to the +Start Menu. This can be overkill during development, so adding +`node_modules\electron\dist\electron.exe` to your Start Menu also does the +trick. Navigate to the file in Explorer, right-click and 'Pin to Start Menu'. +You will then need to add the line `app.setAppUserModelId(process.execPath)` to +your main process to see notifications. +* On Windows 8.1 and Windows 8, a shortcut to your app with an [Application User +Model ID][app-user-model-id] must be installed to the Start screen. Note, +however, that it does not need to be pinned to the Start screen. +* On Windows 7, notifications work via a custom implementation which visually +resembles the native one on newer systems. Electron attempts to automate the work around the AppUserModelID and ToastActivatorCLSID. When Electron is used together with Squirrel.Windows (e.g. if you're using electron-winstaller), @@ -87,7 +97,13 @@ In production, Electron will also detect that Squirrel was used and will automat `app.setAppUserModelId()` with the correct value. During development, you may have to call [`app.setAppUserModelId()`][set-app-user-model-id] yourself. -:::info Notifications in development +Furthermore, in Windows 8, the maximum length for the notification body is 250 +characters, with the Windows team recommending that notifications should be kept +to 200 characters. That said, that limitation has been removed in Windows 10, with +the Windows team asking developers to be reasonable. Attempting to send gigantic +amounts of text to the API (thousands of characters) might result in instability. + +#### Advanced Notifications To quickly bootstrap notifications during development, adding `node_modules\electron\dist\electron.exe` to your Start Menu also does the @@ -145,7 +161,6 @@ GNOME, and KDE. [app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids [set-app-user-model-id]: ../api/app.md#appsetappusermodelidid-windows [squirrel-events]: https://github.com/electron/windows-installer/blob/main/README.md#handling-squirrel-events -[toast-activator-clsid]: https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-toastactivatorclsid [apple-notification-guidelines]: https://developer.apple.com/design/human-interface-guidelines/notifications [windows-notification-state]: https://github.com/felixrieseberg/windows-notification-state [macos-notification-state]: https://github.com/felixrieseberg/macos-notification-state diff --git a/filenames.gni b/filenames.gni index c06f6ba484bab..f2b91ffcb3d19 100644 --- a/filenames.gni +++ b/filenames.gni @@ -73,6 +73,17 @@ filenames = { "shell/browser/native_window_views_win.cc", "shell/browser/notifications/win/notification_presenter_win.cc", "shell/browser/notifications/win/notification_presenter_win.h", + "shell/browser/notifications/win/notification_presenter_win7.cc", + "shell/browser/notifications/win/notification_presenter_win7.h", + "shell/browser/notifications/win/win32_desktop_notifications/common.h", + "shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc", + "shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h", + "shell/browser/notifications/win/win32_desktop_notifications/toast_uia.cc", + "shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h", + "shell/browser/notifications/win/win32_desktop_notifications/toast.cc", + "shell/browser/notifications/win/win32_desktop_notifications/toast.h", + "shell/browser/notifications/win/win32_notification.cc", + "shell/browser/notifications/win/win32_notification.h", "shell/browser/notifications/win/windows_toast_notification.cc", "shell/browser/notifications/win/windows_toast_notification.h", "shell/browser/relauncher_win.cc", diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 74222f67cf1e3..d6d9f0f7538bd 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -10,7 +10,6 @@ render_widget_host_view_base.patch render_widget_host_view_mac.patch webview_cross_drag.patch gin_enable_disable_v8_platform.patch -enable_reset_aspect_ratio.patch boringssl_build_gn.patch pepper_plugin_support.patch gtk_visibility.patch @@ -36,7 +35,6 @@ printing.patch support_mixed_sandbox_with_zygote.patch unsandboxed_ppapi_processes_skip_zygote.patch build_add_electron_tracing_category.patch -worker_context_will_destroy.patch frame_host_manager.patch crashpad_pid_check.patch network_service_allow_remote_certificate_verification_logic.patch @@ -44,7 +42,6 @@ disable_color_correct_rendering.patch add_contentgpuclient_precreatemessageloop_callback.patch picture-in-picture.patch disable_compositor_recycling.patch -allow_new_privileges_in_unsandboxed_child_processes.patch expose_setuseragent_on_networkcontext.patch feat_add_set_theme_source_to_allow_apps_to.patch add_webmessageportconverter_entangleandinjectmessageportchannel.patch @@ -82,12 +79,10 @@ hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch logging_win32_only_create_a_console_if_logging_to_stderr.patch fix_media_key_usage_with_globalshortcuts.patch feat_expose_raw_response_headers_from_urlloader.patch -process_singleton.patch add_ui_scopedcliboardwriter_writeunsaferawdata.patch feat_add_data_parameter_to_processsingleton.patch load_v8_snapshot_in_browser_process.patch fix_adapt_exclusive_access_for_electron_needs.patch -fix_aspect_ratio_with_max_size.patch fix_crash_when_saving_edited_pdf_files.patch port_autofill_colors_to_the_color_pipeline.patch build_disable_partition_alloc_on_mac.patch @@ -102,7 +97,6 @@ fix_allow_guest_webcontents_to_enter_fullscreen.patch disable_freezing_flags_after_init_in_node.patch short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch chore_add_electron_deps_to_gitignores.patch -chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch add_maximized_parameter_to_linuxui_getwindowframeprovider.patch add_electron_deps_to_license_credits_file.patch fix_crash_loading_non-standard_schemes_in_iframes.patch @@ -111,7 +105,6 @@ feat_configure_launch_options_for_service_process.patch feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch preconnect_manager.patch -fix_remove_caption-removing_style_call.patch build_allow_electron_to_use_exec_script.patch build_only_use_the_mas_build_config_in_the_required_components.patch chore_introduce_blocking_api_for_electron.patch @@ -128,4 +121,4 @@ fix_return_v8_value_from_localframe_requestexecutescript.patch fix_harden_blink_scriptstate_maybefrom.patch chore_add_buildflag_guard_around_new_include.patch fix_use_delegated_generic_capturer_when_available.patch -build_remove_ent_content_analysis_assert.patch +build_remove_ent_content_analysis_assert.patch \ No newline at end of file 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 029c6978da26d..cbac73c042d19 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 2e4bacce52a45b5d9d7829c1f88f82aa0bb1b4bb..f3537e89191bd2c6d9b06c9b741a1680 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 7a913d4714ae571505111d5fdf8303793bde629b..ec7a05ac5c261c0292684b47db275f7b1ef5daa4 100644 +index aacb580a7506f2c86769251ad00d8679870a454a..400278ab26a4e095fd837fcf84c952a1297b173d 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -3253,15 +3253,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, +@@ -3140,15 +3140,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. @@ -60,12 +60,12 @@ index 7a913d4714ae571505111d5fdf8303793bde629b..ec7a05ac5c261c0292684b47db275f7b } diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h -index fde18715e33ee67f64740ebda7c641954360483c..cf1ea75f8e9dd1d95045736959c4f3ca1a27a1ab 100644 +index 233dd12f86c20a7f5169caab998993f614e8bc7e..3bf6fc95a653f1783510378ffeef5b18da42e559 100644 --- a/ui/views/win/hwnd_message_handler_delegate.h +++ b/ui/views/win/hwnd_message_handler_delegate.h -@@ -255,6 +255,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate { - // Called when the headless window bounds has changed. - virtual void HandleHeadlessWindowBoundsChanged(const gfx::Rect& bounds) = 0; +@@ -258,6 +258,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate { + // Called when the window scale factor has changed. + virtual void HandleWindowScaleFactorChanged(float window_scale_factor) = 0; + // Called when synthetic mouse event is generated for touch event on + // caption buttons. diff --git a/patches/chromium/disable-redraw-lock.patch b/patches/chromium/disable-redraw-lock.patch new file mode 100644 index 0000000000000..48da063218273 --- /dev/null +++ b/patches/chromium/disable-redraw-lock.patch @@ -0,0 +1,78 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Heilig Benedek +Date: Thu, 20 Sep 2018 17:47:54 -0700 +Subject: disable-redraw-lock.patch + +Chromium uses a custom window titlebar implementation on Windows when DWM +is disabled (Windows 7 and earlier, non Aero theme). The native titlebar +sometimes painted over this custom titlebar, so a workaround was put in +place to lock redraws in reaction to certain events if DWM is disabled, +since the code assumes that in that case, the custom titlebar is painted. +Electron forces the use of the native titlebar, which the workaround doesn't +take into account, and still locks redraws, causing weird repainting issues +in electron (and other applications). This patch provides a way to disable +the redraw locking mechanism, which fixes these issues. The electron issue +can be found at https://github.com/electron/electron/issues/1821 + +diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc +index ec39cb0d15c80f051e89bf4d0f05368dff897fa7..472090adb19411366c50ed8e5a2f1276bc0a47eb 100644 +--- a/ui/views/win/hwnd_message_handler.cc ++++ b/ui/views/win/hwnd_message_handler.cc +@@ -311,6 +311,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500; + + } // namespace + ++bool HWNDMessageHandlerDelegate::HasNativeFrame() const { ++ return false; ++} ++ + // A scoping class that prevents a window from being able to redraw in response + // to invalidations that may occur within it for the lifetime of the object. + // +@@ -361,7 +365,8 @@ class HWNDMessageHandler::ScopedRedrawLock { + hwnd_(owner_->hwnd()), + cancel_unlock_(false), + should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() && +- ::IsWindow(hwnd_) && !owner_->IsHeadless() && ++ ::IsWindow(hwnd_) && !owner_->HasNativeFrame() && ++ !owner_->IsHeadless() && + (!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) || + !ui::win::IsAeroGlassEnabled())) { + if (should_lock_) +@@ -1057,6 +1062,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() { + return scoped_enable; + } + ++bool HWNDMessageHandler::HasNativeFrame() { ++ return delegate_->HasNativeFrame(); ++} ++ + //////////////////////////////////////////////////////////////////////////////// + // HWNDMessageHandler, gfx::WindowImpl overrides: + +diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h +index e93d1727cbd8263d3b68e539856a577585a6092c..6d0adb7b5febc5625073312e7f1d557f89927ac8 100644 +--- a/ui/views/win/hwnd_message_handler.h ++++ b/ui/views/win/hwnd_message_handler.h +@@ -210,6 +210,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl, + using TouchIDs = std::set; + enum class DwmFrameState { kOff, kOn }; + ++ bool HasNativeFrame(); ++ + // Overridden from WindowImpl: + HICON GetDefaultWindowIcon() const override; + HICON GetSmallWindowIcon() const override; +diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h +index 08e46c7b92f6cbe95c9cb524d09a6ed9e89ecf00..233dd12f86c20a7f5169caab998993f614e8bc7e 100644 +--- a/ui/views/win/hwnd_message_handler_delegate.h ++++ b/ui/views/win/hwnd_message_handler_delegate.h +@@ -46,6 +46,8 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate { + // True if the widget associated with this window has a non-client view. + virtual bool HasNonClientView() const = 0; + ++ virtual bool HasNativeFrame() const; ++ + // Returns who we want to be drawing the frame. Either the system (Windows) + // will handle it or Chrome will custom draw it. + virtual FrameMode GetFrameMode() const = 0; diff --git a/patches/chromium/enable_reset_aspect_ratio.patch b/patches/chromium/enable_reset_aspect_ratio.patch index d581528e4b5eb..9f206f1cfb786 100644 --- a/patches/chromium/enable_reset_aspect_ratio.patch +++ b/patches/chromium/enable_reset_aspect_ratio.patch @@ -19,10 +19,11 @@ index 53c1d25e3f56daa9d7929089620c9df7971ceda6..d90c652d7c572686bf54c4d282960ea4 excluded_margin); } diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index a386fb0594530afb6d842551c487fda7ae565085..825ee88f8375d726466d9967393b77065723fabd 100644 +index 472090adb19411366c50ed8e5a2f1276bc0a47eb..9f2b240b0c053a10d4543f0ffb9809fd735d7b6d 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -1154,8 +1154,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen, +@@ -1007,8 +1007,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen, + } void HWNDMessageHandler::SetAspectRatio(float aspect_ratio, const gfx::Size& excluded_margin) { diff --git a/patches/chromium/fix_aspect_ratio_with_max_size.patch b/patches/chromium/fix_aspect_ratio_with_max_size.patch index dd14e3ea75a71..6afb366ac3737 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 825ee88f8375d726466d9967393b77065723fabd..7a913d4714ae571505111d5fdf8303793bde629b 100644 +index 9f2b240b0c053a10d4543f0ffb9809fd735d7b6d..aacb580a7506f2c86769251ad00d8679870a454a 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -3805,14 +3805,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param, +@@ -3707,6 +3707,21 @@ 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_remove_caption-removing_style_call.patch b/patches/chromium/fix_remove_caption-removing_style_call.patch index ebf6939487109..b7923a81dde7a 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 ec7a05ac5c261c0292684b47db275f7b1ef5daa4..13268bd89c710690eed5296f4b2157e9476f195e 100644 +index 400278ab26a4e095fd837fcf84c952a1297b173d..55afa69870f27b877826ea8a442ab20a8b336d74 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -1873,7 +1873,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { +@@ -1731,7 +1731,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) { SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0); diff --git a/patches/node/.patches b/patches/node/.patches index f419622b86399..0030c8fd08231 100644 --- a/patches/node/.patches +++ b/patches/node/.patches @@ -13,6 +13,7 @@ fix_handle_boringssl_and_openssl_incompatibilities.patch fix_crypto_tests_to_run_with_bssl.patch fix_account_for_debugger_agent_race_condition.patch fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch +fix_crash_caused_by_gethostnamew_on_windows_7.patch fix_suppress_clang_-wdeprecated-declarations_in_libuv.patch fix_serdes_test.patch feat_add_knostartdebugsignalhandler_to_environment_to_prevent.patch diff --git a/patches/node/fix_crash_caused_by_gethostnamew_on_windows_7.patch b/patches/node/fix_crash_caused_by_gethostnamew_on_windows_7.patch new file mode 100644 index 0000000000000..8d1899062c761 --- /dev/null +++ b/patches/node/fix_crash_caused_by_gethostnamew_on_windows_7.patch @@ -0,0 +1,182 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Cheng Zhao +Date: Fri, 12 Nov 2021 17:25:37 +0900 +Subject: fix: crash caused by GetHostNameW on Windows 7 + +Backported from https://github.com/libuv/libuv/pull/3285. + +diff --git a/deps/uv/src/win/util.c b/deps/uv/src/win/util.c +index 33e874ac442f88b58d2b68c8ec9764f6f664552e..37ece5e2867ab836492a8b7faa0aa5e1b8e562f0 100644 +--- a/deps/uv/src/win/util.c ++++ b/deps/uv/src/win/util.c +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + /* clang-format on */ + #include + #include +@@ -56,6 +57,10 @@ + /* The number of nanoseconds in one second. */ + #define UV__NANOSEC 1000000000 + ++/* Local buffer size for WSAQUERYSETW data inside uv__gethostnamew_nt60 ++ sizeof(WSAQUERYSETW) + 512 = 632 bytes to match GetHostNameW behavior */ ++#define WSAQ_LOCAL_BUF_LEN (sizeof(WSAQUERYSETW) + 512) ++ + /* Max user name length, from iphlpapi.h */ + #ifndef UNLEN + # define UNLEN 256 +@@ -72,6 +77,11 @@ static CRITICAL_SECTION process_title_lock; + /* Frequency of the high-resolution clock. */ + static uint64_t hrtime_frequency_ = 0; + ++/* Parameters for WSAQUERYSETW inside uv__gethostnamew_nt60 */ ++static GUID guid_host_name = SVCID_HOSTNAME; ++static AFPROTOCOLS af_protocols[2] = { {AF_INET, IPPROTO_UDP}, ++ {AF_INET, IPPROTO_TCP} }; ++ + + /* + * One-time initialization code for functionality defined in util.c. +@@ -1663,6 +1673,125 @@ int uv_os_unsetenv(const char* name) { + } + + ++static int WSAAPI uv__gethostnamew_nt60(PWSTR name, int name_len) { ++ int result_len; ++ int error_code = NO_ERROR; ++ ++ /* WSALookupService stuff ++ * Avoid dynamic memory allocation if possible */ ++ CHAR local_buf[WSAQ_LOCAL_BUF_LEN]; ++ DWORD dwlen = WSAQ_LOCAL_BUF_LEN; ++ WSAQUERYSETW* pwsaq; ++ /* hostname returned from WSALookupService stage */ ++ WCHAR* result_name = NULL; ++ /* WSALookupService handle */ ++ HANDLE hlookup; ++ /* Fallback to heap allocation if stack buffer is too small */ ++ WSAQUERYSETW* heap_data = NULL; ++ ++ /* check input */ ++ if (name == NULL) { ++ error_code = WSAEFAULT; ++ goto cleanup; ++ } ++ ++ /* ++ * Stage 1: Check environment variable ++ * _CLUSTER_NETWORK_NAME_ len == ComputeName(NETBIOS) len. ++ * i.e 15 characters + null. ++ * It overrides the actual hostname, so application can ++ * work when network name and computer name are different ++ */ ++ result_len = GetEnvironmentVariableW(L"_CLUSTER_NETWORK_NAME_", ++ name, ++ name_len); ++ if (result_len != 0) { ++ if (result_len > name_len) { ++ error_code = WSAEFAULT; ++ } ++ goto cleanup; ++ } ++ ++ /* Stage 2: Do normal lookup through WSALookupServiceLookup */ ++ pwsaq = (WSAQUERYSETW*) local_buf; ++ memset(pwsaq, 0, sizeof(*pwsaq)); ++ pwsaq->dwSize = sizeof(*pwsaq); ++ pwsaq->lpszServiceInstanceName = NULL; ++ pwsaq->lpServiceClassId = &guid_host_name; ++ pwsaq->dwNameSpace = NS_ALL; ++ pwsaq->lpafpProtocols = &af_protocols[0]; ++ pwsaq->dwNumberOfProtocols = 2; ++ ++ error_code = WSALookupServiceBeginW(pwsaq, LUP_RETURN_NAME, &hlookup); ++ if (error_code == NO_ERROR) { ++ /* Try stack allocation first */ ++ error_code = WSALookupServiceNextW(hlookup, 0, &dwlen, pwsaq); ++ if (error_code == NO_ERROR) { ++ result_name = pwsaq->lpszServiceInstanceName; ++ } else { ++ error_code = WSAGetLastError(); ++ ++ if (error_code == WSAEFAULT) { ++ /* Should never happen */ ++ assert(sizeof(CHAR) * dwlen >= sizeof(WSAQUERYSETW)); ++ ++ /* Fallback to the heap allocation */ ++ heap_data = uv__malloc(sizeof(CHAR) * (size_t) dwlen); ++ if (heap_data != NULL) { ++ error_code = WSALookupServiceNextW(hlookup, 0, &dwlen, heap_data); ++ if (error_code == NO_ERROR) { ++ result_name = heap_data->lpszServiceInstanceName; ++ } else { ++ error_code = WSAGetLastError(); ++ } ++ } else { ++ error_code = WSA_NOT_ENOUGH_MEMORY; ++ } ++ } ++ } ++ ++ WSALookupServiceEnd(hlookup); ++ ++ if (error_code != NO_ERROR) { ++ WSASetLastError(error_code); ++ } ++ } ++ ++ if (result_name != NULL) { ++ size_t wlen = wcslen(result_name) + 1; ++ ++ if (wlen <= (size_t) name_len) { ++ wmemcpy(name, result_name, wlen); ++ } else { ++ error_code = WSAEFAULT; ++ } ++ goto cleanup; ++ } ++ ++ /* Stage 3: If WSALookupServiceLookup fails, fallback to GetComputerName */ ++ result_len = name_len; ++ /* Reset error code */ ++ error_code = NO_ERROR; ++ ++ if (GetComputerNameW(name, (PDWORD)&result_len) == FALSE) { ++ error_code = WSAENETDOWN; ++ if (result_len >= name_len) { ++ error_code = WSAEFAULT; ++ } ++ } ++ ++cleanup: ++ uv__free(heap_data); ++ ++ if (error_code == NO_ERROR) { ++ return NO_ERROR; ++ } else { ++ WSASetLastError(error_code); ++ return SOCKET_ERROR; ++ } ++} ++ ++ + int uv_os_gethostname(char* buffer, size_t* size) { + WCHAR buf[UV_MAXHOSTNAMESIZE]; + size_t len; +@@ -1674,10 +1803,10 @@ int uv_os_gethostname(char* buffer, size_t* size) { + + uv__once_init(); /* Initialize winsock */ + +- if (pGetHostNameW == NULL) +- return UV_ENOSYS; ++ uv_sGetHostNameW gethostnamew = ++ pGetHostNameW == NULL ? uv__gethostnamew_nt60 : pGetHostNameW; + +- if (pGetHostNameW(buf, UV_MAXHOSTNAMESIZE) != 0) ++ if (gethostnamew(buf, UV_MAXHOSTNAMESIZE) != 0) + return uv_translate_sys_error(WSAGetLastError()); + + convert_result = uv__convert_utf16_to_utf8(buf, -1, &utf8_str); 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 0c287b3ad3d55..a6ae0650793b4 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 99432053cc3b242e514268b7aba2e2d83a9e64f2..750a5424953aad104ba1e865fefd55d316485917 100644 +index 37ece5e2867ab836492a8b7faa0aa5e1b8e562f0..d50296728f7e0810064647125a469f3ed714f8ea 100644 --- a/deps/uv/src/win/util.c +++ b/deps/uv/src/win/util.c -@@ -1743,10 +1743,17 @@ int uv_os_uname(uv_utsname_t* buffer) { +@@ -1950,10 +1950,17 @@ int uv_os_uname(uv_utsname_t* buffer) { #ifdef _MSC_VER #pragma warning(suppress : 4996) #endif diff --git a/shell/browser/api/electron_api_power_monitor_win.cc b/shell/browser/api/electron_api_power_monitor_win.cc index 0e400dc44e6d8..90f2cf97dfe26 100644 --- a/shell/browser/api/electron_api_power_monitor_win.cc +++ b/shell/browser/api/electron_api_power_monitor_win.cc @@ -44,8 +44,15 @@ void PowerMonitor::InitPlatformSpecificMonitors() { // For Windows 8 and later, a new "connected standby" mode has been added and // we must explicitly register for its notifications. - RegisterSuspendResumeNotification(static_cast(window_), - DEVICE_NOTIFY_WINDOW_HANDLE); + auto RegisterSuspendResumeNotification = + reinterpret_cast( + GetProcAddress(GetModuleHandle(L"user32.dll"), + "RegisterSuspendResumeNotification")); + + if (RegisterSuspendResumeNotification) { + RegisterSuspendResumeNotification(static_cast(window_), + DEVICE_NOTIFY_WINDOW_HANDLE); + } } LRESULT CALLBACK PowerMonitor::WndProcStatic(HWND hwnd, diff --git a/shell/browser/browser_win.cc b/shell/browser/browser_win.cc index 8fcb7abab83cb..8dda6528c51de 100644 --- a/shell/browser/browser_win.cc +++ b/shell/browser/browser_win.cc @@ -90,6 +90,10 @@ bool IsValidCustomProtocol(const std::wstring& scheme) { // takes in an assoc_str // (https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/ne-shlwapi-assocstr) // and returns the application name, icon and path that handles the protocol. +// +// Windows 8 introduced a new protocol->executable binding system which cannot +// be retrieved in the HKCR registry subkey method implemented below. We call +// AssocQueryString with the new Win8-only flag ASSOCF_IS_PROTOCOL instead. std::wstring GetAppInfoHelperForProtocol(ASSOCSTR assoc_str, const GURL& url) { const std::wstring url_scheme = base::ASCIIToWide(url.scheme()); if (!IsValidCustomProtocol(url_scheme)) @@ -132,6 +136,34 @@ std::wstring GetAppPathForProtocol(const GURL& url) { return GetAppInfoHelperForProtocol(ASSOCSTR_EXECUTABLE, url); } +std::wstring GetAppForProtocolUsingRegistry(const GURL& url) { + const std::wstring url_scheme = base::ASCIIToWide(url.scheme()); + if (!IsValidCustomProtocol(url_scheme)) + return std::wstring(); + + // First, try and extract the application's display name. + std::wstring command_to_launch; + base::win::RegKey cmd_key_name(HKEY_CLASSES_ROOT, url_scheme.c_str(), + KEY_READ); + if (cmd_key_name.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS && + !command_to_launch.empty()) { + return command_to_launch; + } + + // Otherwise, parse the command line in the registry, and return the basename + // of the program path if it exists. + const std::wstring cmd_key_path = url_scheme + L"\\shell\\open\\command"; + base::win::RegKey cmd_key_exe(HKEY_CLASSES_ROOT, cmd_key_path.c_str(), + KEY_READ); + if (cmd_key_exe.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS) { + base::CommandLine command_line( + base::CommandLine::FromString(command_to_launch)); + return command_line.GetProgram().BaseName().value(); + } + + return std::wstring(); +} + bool FormatCommandLineString(std::wstring* exe, const std::vector& launch_args) { if (exe->empty() && !GetProcessExecPath(exe)) { @@ -282,6 +314,42 @@ void GetFileIcon(const base::FilePath& path, } } +void GetApplicationInfoForProtocolUsingRegistry( + v8::Isolate* isolate, + const GURL& url, + gin_helper::Promise promise, + base::CancelableTaskTracker* cancelable_task_tracker_) { + base::FilePath app_path; + + const std::wstring url_scheme = base::ASCIIToWide(url.scheme()); + if (!IsValidCustomProtocol(url_scheme)) { + promise.RejectWithErrorMessage("invalid url_scheme"); + return; + } + std::wstring command_to_launch; + const std::wstring cmd_key_path = url_scheme + L"\\shell\\open\\command"; + base::win::RegKey cmd_key_exe(HKEY_CLASSES_ROOT, cmd_key_path.c_str(), + KEY_READ); + if (cmd_key_exe.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS) { + base::CommandLine command_line( + base::CommandLine::FromString(command_to_launch)); + app_path = command_line.GetProgram(); + } else { + promise.RejectWithErrorMessage( + "Unable to retrieve installation path to app"); + return; + } + const std::wstring app_display_name = GetAppForProtocolUsingRegistry(url); + + if (app_display_name.empty()) { + promise.RejectWithErrorMessage( + "Unable to retrieve application display name"); + return; + } + GetFileIcon(app_path, isolate, cancelable_task_tracker_, app_display_name, + std::move(promise)); +} + // resolves `Promise` - Resolve with an object containing the following: // * `icon` NativeImage - the display icon of the app handling the protocol. // * `path` String - installation path of the app handling the protocol. @@ -498,7 +566,14 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol, } std::u16string Browser::GetApplicationNameForProtocol(const GURL& url) { - return base::WideToUTF16(GetAppDisplayNameForProtocol(url)); + // Windows 8 or above has a new protocol association query. + if (base::win::GetVersion() >= base::win::Version::WIN8) { + std::wstring application_name = GetAppDisplayNameForProtocol(url); + if (!application_name.empty()) + return base::WideToUTF16(application_name); + } + + return base::WideToUTF16(GetAppForProtocolUsingRegistry(url)); } v8::Local Browser::GetApplicationInfoForProtocol( @@ -507,8 +582,15 @@ v8::Local Browser::GetApplicationInfoForProtocol( gin_helper::Promise promise(isolate); v8::Local handle = promise.GetHandle(); - GetApplicationInfoForProtocolUsingAssocQuery(isolate, url, std::move(promise), - &cancelable_task_tracker_); + // Windows 8 or above has a new protocol association query. + if (base::win::GetVersion() >= base::win::Version::WIN8) { + GetApplicationInfoForProtocolUsingAssocQuery( + isolate, url, std::move(promise), &cancelable_task_tracker_); + return handle; + } + + GetApplicationInfoForProtocolUsingRegistry(isolate, url, std::move(promise), + &cancelable_task_tracker_); return handle; } diff --git a/shell/browser/notifications/win/notification_presenter_win.cc b/shell/browser/notifications/win/notification_presenter_win.cc index e116ed9406cfa..427df800c38c3 100644 --- a/shell/browser/notifications/win/notification_presenter_win.cc +++ b/shell/browser/notifications/win/notification_presenter_win.cc @@ -17,6 +17,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" #include "base/win/windows_version.h" +#include "shell/browser/notifications/win/notification_presenter_win7.h" #include "shell/browser/notifications/win/windows_toast_notification.h" #include "shell/common/thread_restrictions.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -46,6 +47,9 @@ bool SaveIconToPath(const SkBitmap& bitmap, const base::FilePath& path) { // static NotificationPresenter* NotificationPresenter::Create() { + auto version = base::win::GetVersion(); + if (version < base::win::Version::WIN8) + return new NotificationPresenterWin7; if (!WindowsToastNotification::Initialize()) return nullptr; auto presenter = std::make_unique(); diff --git a/shell/browser/notifications/win/notification_presenter_win7.cc b/shell/browser/notifications/win/notification_presenter_win7.cc new file mode 100644 index 0000000000000..721d96e24b8f8 --- /dev/null +++ b/shell/browser/notifications/win/notification_presenter_win7.cc @@ -0,0 +1,54 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "shell/browser/notifications/win/notification_presenter_win7.h" + +#include + +#include "shell/browser/notifications/win/win32_notification.h" + +namespace electron { + +electron::Notification* NotificationPresenterWin7::CreateNotificationObject( + NotificationDelegate* delegate) { + return new Win32Notification(delegate, this); +} + +Win32Notification* NotificationPresenterWin7::GetNotificationObjectByRef( + const DesktopNotificationController::Notification& ref) { + for (auto* n : this->notifications()) { + auto* w32n = static_cast(n); + if (w32n->GetRef() == ref) + return w32n; + } + + return nullptr; +} + +Win32Notification* NotificationPresenterWin7::GetNotificationObjectByTag( + const std::string& tag) { + for (auto* n : this->notifications()) { + auto* w32n = static_cast(n); + if (w32n->GetTag() == tag) + return w32n; + } + + return nullptr; +} + +void NotificationPresenterWin7::OnNotificationClicked( + const Notification& notification) { + auto* n = GetNotificationObjectByRef(notification); + if (n) + n->NotificationClicked(); +} + +void NotificationPresenterWin7::OnNotificationDismissed( + const Notification& notification) { + auto* n = GetNotificationObjectByRef(notification); + if (n) + n->NotificationDismissed(); +} + +} // namespace electron diff --git a/shell/browser/notifications/win/notification_presenter_win7.h b/shell/browser/notifications/win/notification_presenter_win7.h new file mode 100644 index 0000000000000..6c03839e624d0 --- /dev/null +++ b/shell/browser/notifications/win/notification_presenter_win7.h @@ -0,0 +1,37 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_NOTIFICATION_PRESENTER_WIN7_H_ +#define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_NOTIFICATION_PRESENTER_WIN7_H_ + +#include + +#include "shell/browser/notifications/notification_presenter.h" +#include "shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h" + +namespace electron { + +class Win32Notification; + +class NotificationPresenterWin7 : public NotificationPresenter, + public DesktopNotificationController { + public: + NotificationPresenterWin7() = default; + + Win32Notification* GetNotificationObjectByRef( + const DesktopNotificationController::Notification& ref); + + Win32Notification* GetNotificationObjectByTag(const std::string& tag); + + private: + electron::Notification* CreateNotificationObject( + NotificationDelegate* delegate) override; + + void OnNotificationClicked(const Notification& notification) override; + void OnNotificationDismissed(const Notification& notification) override; +}; + +} // namespace electron + +#endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_NOTIFICATION_PRESENTER_WIN7_H_ diff --git a/shell/browser/notifications/win/win32_desktop_notifications/common.h b/shell/browser/notifications/win/win32_desktop_notifications/common.h new file mode 100644 index 0000000000000..cea5e57d13274 --- /dev/null +++ b/shell/browser/notifications/win/win32_desktop_notifications/common.h @@ -0,0 +1,70 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_COMMON_H_ +#define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_COMMON_H_ + +#include + +#include "base/memory/raw_ptr.h" + +namespace electron { + +struct NotificationData { + raw_ptr controller = nullptr; + + std::u16string caption; + std::u16string body_text; + HBITMAP image = NULL; + + NotificationData() = default; + + ~NotificationData() { + if (image) + DeleteObject(image); + } + + NotificationData(const NotificationData& other) = delete; + NotificationData& operator=(const NotificationData& other) = delete; +}; + +template +constexpr T ScaleForDpi(T value, unsigned dpi, unsigned source_dpi = 96) { + return value * dpi / source_dpi; +} + +struct ScreenMetrics { + UINT dpi_x, dpi_y; + + ScreenMetrics() { + typedef HRESULT WINAPI GetDpiForMonitor_t(HMONITOR, int, UINT*, UINT*); + + auto GetDpiForMonitor = reinterpret_cast( + GetProcAddress(GetModuleHandle(TEXT("shcore")), "GetDpiForMonitor")); + + if (GetDpiForMonitor) { + auto* monitor = MonitorFromPoint({}, MONITOR_DEFAULTTOPRIMARY); + if (GetDpiForMonitor(monitor, 0, &dpi_x, &dpi_y) == S_OK) + return; + } + + HDC hdc = GetDC(NULL); + dpi_x = GetDeviceCaps(hdc, LOGPIXELSX); + dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(NULL, hdc); + } + + template + T X(T value) const { + return ScaleForDpi(value, dpi_x); + } + template + T Y(T value) const { + return ScaleForDpi(value, dpi_y); + } +}; + +} // namespace electron + +#endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_COMMON_H_ diff --git a/shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc b/shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc new file mode 100644 index 0000000000000..03e435baee20e --- /dev/null +++ b/shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc @@ -0,0 +1,436 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef NOMINMAX +#define NOMINMAX +#endif + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include "shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h" + +#include +#include +#include + +#include "base/check.h" +#include "shell/browser/notifications/win/win32_desktop_notifications/common.h" +#include "shell/browser/notifications/win/win32_desktop_notifications/toast.h" + +namespace electron { + +HBITMAP CopyBitmap(HBITMAP bitmap) { + HBITMAP ret = NULL; + + BITMAP bm; + if (bitmap && GetObject(bitmap, sizeof(bm), &bm)) { + HDC hdc_screen = GetDC(NULL); + ret = CreateCompatibleBitmap(hdc_screen, bm.bmWidth, bm.bmHeight); + ReleaseDC(NULL, hdc_screen); + + if (ret) { + HDC hdc_src = CreateCompatibleDC(NULL); + HDC hdc_dst = CreateCompatibleDC(NULL); + SelectBitmap(hdc_src, bitmap); + SelectBitmap(hdc_dst, ret); + BitBlt(hdc_dst, 0, 0, bm.bmWidth, bm.bmHeight, hdc_src, 0, 0, SRCCOPY); + DeleteDC(hdc_dst); + DeleteDC(hdc_src); + } + } + + return ret; +} + +const TCHAR DesktopNotificationController::class_name_[] = + TEXT("DesktopNotificationController"); + +HINSTANCE DesktopNotificationController::RegisterWndClasses() { + // We keep a static `module` variable which serves a dual purpose: + // 1. Stores the HINSTANCE where the window classes are registered, + // which can be passed to `CreateWindow` + // 2. Indicates whether we already attempted the registration so that + // we don't do it twice (we don't retry even if registration fails, + // as there is no point). + static HMODULE module = NULL; + + if (!module) { + if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | + GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, + reinterpret_cast(&RegisterWndClasses), + &module)) { + Toast::Register(module); + + WNDCLASSEX wc = {sizeof(wc)}; + wc.lpfnWndProc = &WndProc; + wc.lpszClassName = class_name_; + wc.cbWndExtra = sizeof(DesktopNotificationController*); + wc.hInstance = module; + + RegisterClassEx(&wc); + } + } + + return module; +} + +DesktopNotificationController::DesktopNotificationController( + unsigned maximum_toasts) { + instances_.reserve(maximum_toasts); +} + +DesktopNotificationController::~DesktopNotificationController() { + for (auto&& inst : instances_) + DestroyToast(&inst); + if (hwnd_controller_) + DestroyWindow(hwnd_controller_); + ClearAssets(); +} + +LRESULT CALLBACK DesktopNotificationController::WndProc(HWND hwnd, + UINT message, + WPARAM wparam, + LPARAM lparam) { + switch (message) { + case WM_CREATE: { + auto*& cs = reinterpret_cast(lparam); + SetWindowLongPtr(hwnd, 0, (LONG_PTR)cs->lpCreateParams); + } break; + + case WM_TIMER: + if (wparam == TimerID_Animate) { + Get(hwnd)->AnimateAll(); + } + return 0; + + case WM_DISPLAYCHANGE: { + auto* inst = Get(hwnd); + inst->ClearAssets(); + inst->AnimateAll(); + } break; + + case WM_SETTINGCHANGE: + if (wparam == SPI_SETWORKAREA) { + Get(hwnd)->AnimateAll(); + } + break; + } + + return DefWindowProc(hwnd, message, wparam, lparam); +} + +void DesktopNotificationController::StartAnimation() { + DCHECK(hwnd_controller_); + + if (!is_animating_ && hwnd_controller_) { + // NOTE: 15ms is shorter than what we'd need for 60 fps, but since + // the timer is not accurate we must request a higher frame rate + // to get at least 60 + + SetTimer(hwnd_controller_, TimerID_Animate, 15, nullptr); + is_animating_ = true; + } +} + +HFONT DesktopNotificationController::GetCaptionFont() { + InitializeFonts(); + return caption_font_; +} + +HFONT DesktopNotificationController::GetBodyFont() { + InitializeFonts(); + return body_font_; +} + +void DesktopNotificationController::InitializeFonts() { + if (!body_font_) { + NONCLIENTMETRICS metrics = {sizeof(metrics)}; + if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &metrics, 0)) { + auto base_height = metrics.lfMessageFont.lfHeight; + + HDC hdc = GetDC(NULL); + auto base_dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(NULL, hdc); + + ScreenMetrics scr; + + metrics.lfMessageFont.lfHeight = + (LONG)ScaleForDpi(base_height * 1.1f, scr.dpi_y, base_dpi_y); + body_font_ = CreateFontIndirect(&metrics.lfMessageFont); + + if (caption_font_) + DeleteFont(caption_font_); + metrics.lfMessageFont.lfHeight = + (LONG)ScaleForDpi(base_height * 1.4f, scr.dpi_y, base_dpi_y); + caption_font_ = CreateFontIndirect(&metrics.lfMessageFont); + } + } +} + +void DesktopNotificationController::ClearAssets() { + if (caption_font_) { + DeleteFont(caption_font_); + caption_font_ = NULL; + } + if (body_font_) { + DeleteFont(body_font_); + body_font_ = NULL; + } +} + +void DesktopNotificationController::AnimateAll() { + // NOTE: This function refreshes position and size of all toasts according + // to all current conditions. Animation time is only one of the variables + // influencing them. Screen resolution is another. + + bool keep_animating = false; + + if (!instances_.empty()) { + RECT work_area; + if (SystemParametersInfo(SPI_GETWORKAREA, 0, &work_area, 0)) { + ScreenMetrics metrics; + POINT origin = {work_area.right, + work_area.bottom - metrics.Y(toast_margin_)}; + + auto* hdwp = BeginDeferWindowPos(static_cast(instances_.size())); + + for (auto&& inst : instances_) { + if (!inst.hwnd) + continue; + + auto* notification = Toast::Get(inst.hwnd); + hdwp = notification->Animate(hdwp, origin); + if (!hdwp) + break; + keep_animating |= notification->IsAnimationActive(); + } + + if (hdwp) + EndDeferWindowPos(hdwp); + } + } + + if (!keep_animating) { + DCHECK(hwnd_controller_); + if (hwnd_controller_) + KillTimer(hwnd_controller_, TimerID_Animate); + is_animating_ = false; + } + + // Purge dismissed notifications and collapse the stack between + // items which are highlighted + if (!instances_.empty()) { + auto is_alive = [](ToastInstance& inst) { + return inst.hwnd && IsWindowVisible(inst.hwnd); + }; + + auto is_highlighted = [](ToastInstance& inst) { + return inst.hwnd && Toast::Get(inst.hwnd)->IsHighlighted(); + }; + + for (auto it = instances_.begin();; ++it) { + // find next highlighted item + auto it2 = find_if(it, instances_.end(), is_highlighted); + + // collapse the stack in front of the highlighted item + it = stable_partition(it, it2, is_alive); + + // purge the dead items + std::for_each(it, it2, [this](auto&& inst) { DestroyToast(&inst); }); + + if (it2 == instances_.end()) { + instances_.erase(it, it2); + break; + } + + it = std::move(it2); + } + } + + // Set new toast positions + if (!instances_.empty()) { + ScreenMetrics metrics; + auto margin = metrics.Y(toast_margin_); + + int target_pos = 0; + for (auto&& inst : instances_) { + if (inst.hwnd) { + auto* toast = Toast::Get(inst.hwnd); + + if (toast->IsHighlighted()) + target_pos = toast->GetVerticalPosition(); + else + toast->SetVerticalPosition(target_pos); + + target_pos += toast->GetHeight() + margin; + } + } + } + + // Create new toasts from the queue + CheckQueue(); +} + +DesktopNotificationController::Notification +DesktopNotificationController::AddNotification(std::u16string caption, + std::u16string body_text, + HBITMAP image) { + auto data = std::make_shared(); + data->controller = this; + data->caption = std::move(caption); + data->body_text = std::move(body_text); + data->image = CopyBitmap(image); + + // Enqueue new notification + Notification ret{*queue_.insert(queue_.end(), std::move(data))}; + CheckQueue(); + return ret; +} + +void DesktopNotificationController::CloseNotification( + const Notification& notification) { + // Remove it from the queue + auto it = find(queue_.begin(), queue_.end(), notification.data_); + if (it != queue_.end()) { + (*it)->controller = nullptr; + queue_.erase(it); + this->OnNotificationClosed(notification); + return; + } + + // Dismiss active toast + auto* hwnd = GetToast(notification.data_.get()); + if (hwnd) { + auto* toast = Toast::Get(hwnd); + toast->Dismiss(); + } +} + +void DesktopNotificationController::CheckQueue() { + while (instances_.size() < instances_.capacity() && !queue_.empty()) { + CreateToast(std::move(queue_.front())); + queue_.pop_front(); + } +} + +void DesktopNotificationController::CreateToast( + std::shared_ptr&& data) { + auto* hinstance = RegisterWndClasses(); + auto* hwnd = Toast::Create(hinstance, data); + if (hwnd) { + int toast_pos = 0; + if (!instances_.empty()) { + auto& item = instances_.back(); + DCHECK(item.hwnd); + + ScreenMetrics scr; + auto* toast = Toast::Get(item.hwnd); + toast_pos = toast->GetVerticalPosition() + toast->GetHeight() + + scr.Y(toast_margin_); + } + + instances_.push_back({hwnd, std::move(data)}); + + if (!hwnd_controller_) { + // NOTE: We cannot use a message-only window because we need to + // receive system notifications + hwnd_controller_ = CreateWindow(class_name_, nullptr, 0, 0, 0, 0, 0, NULL, + NULL, hinstance, this); + } + + auto* toast = Toast::Get(hwnd); + toast->PopUp(toast_pos); + } +} + +HWND DesktopNotificationController::GetToast( + const NotificationData* data) const { + auto it = + find_if(instances_.cbegin(), instances_.cend(), [data](auto&& inst) { + if (!inst.hwnd) + return false; + auto toast = Toast::Get(inst.hwnd); + return data == toast->GetNotification().get(); + }); + + return (it != instances_.cend()) ? it->hwnd : NULL; +} + +void DesktopNotificationController::DestroyToast(ToastInstance* inst) { + if (inst->hwnd) { + auto data = Toast::Get(inst->hwnd)->GetNotification(); + + DestroyWindow(inst->hwnd); + inst->hwnd = NULL; + + Notification notification(data); + OnNotificationClosed(notification); + } +} + +DesktopNotificationController::Notification::Notification() = default; +DesktopNotificationController::Notification::Notification( + const DesktopNotificationController::Notification&) = default; + +DesktopNotificationController::Notification::Notification( + const std::shared_ptr& data) + : data_(data) { + DCHECK(data != nullptr); +} + +DesktopNotificationController::Notification::~Notification() = default; + +bool DesktopNotificationController::Notification::operator==( + const Notification& other) const { + return data_ == other.data_; +} + +void DesktopNotificationController::Notification::Close() { + // No business calling this when not pointing to a valid instance + DCHECK(data_); + + if (data_->controller) + data_->controller->CloseNotification(*this); +} + +void DesktopNotificationController::Notification::Set(std::u16string caption, + std::u16string body_text, + HBITMAP image) { + // No business calling this when not pointing to a valid instance + DCHECK(data_); + + // Do nothing when the notification has been closed + if (!data_->controller) + return; + + if (data_->image) + DeleteBitmap(data_->image); + + data_->caption = std::move(caption); + data_->body_text = std::move(body_text); + data_->image = CopyBitmap(image); + + auto* hwnd = data_->controller->GetToast(data_.get()); + if (hwnd) { + auto* toast = Toast::Get(hwnd); + toast->ResetContents(); + } + + // Change of contents can affect size and position of all toasts + data_->controller->StartAnimation(); +} + +DesktopNotificationController::ToastInstance::ToastInstance( + HWND hwnd, + std::shared_ptr data) { + this->hwnd = hwnd; + this->data = std::move(data); +} +DesktopNotificationController::ToastInstance::~ToastInstance() = default; +DesktopNotificationController::ToastInstance::ToastInstance(ToastInstance&&) = + default; + +} // namespace electron diff --git a/shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h b/shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h new file mode 100644 index 0000000000000..d188cbc151a34 --- /dev/null +++ b/shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h @@ -0,0 +1,100 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_DESKTOP_NOTIFICATION_CONTROLLER_H_ +#define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_DESKTOP_NOTIFICATION_CONTROLLER_H_ + +#include +#include +#include +#include +#include + +namespace electron { + +struct NotificationData; + +class DesktopNotificationController { + public: + explicit DesktopNotificationController(unsigned maximum_toasts = 3); + ~DesktopNotificationController(); + + class Notification; + Notification AddNotification(std::u16string caption, + std::u16string body_text, + HBITMAP image); + void CloseNotification(const Notification& notification); + + // Event handlers -- override to receive the events + private: + class Toast; + DesktopNotificationController(const DesktopNotificationController&) = delete; + + struct ToastInstance { + ToastInstance(HWND, std::shared_ptr); + ~ToastInstance(); + ToastInstance(ToastInstance&&); + ToastInstance(const ToastInstance&) = delete; + ToastInstance& operator=(ToastInstance&&) = default; + + HWND hwnd; + std::shared_ptr data; + }; + + virtual void OnNotificationClosed(const Notification& notification) {} + virtual void OnNotificationClicked(const Notification& notification) {} + virtual void OnNotificationDismissed(const Notification& notification) {} + + static HINSTANCE RegisterWndClasses(); + void StartAnimation(); + HFONT GetCaptionFont(); + HFONT GetBodyFont(); + void InitializeFonts(); + void ClearAssets(); + void AnimateAll(); + void CheckQueue(); + void CreateToast(std::shared_ptr&& data); + HWND GetToast(const NotificationData* data) const; + void DestroyToast(ToastInstance* inst); + + static LRESULT CALLBACK WndProc(HWND hwnd, + UINT message, + WPARAM wparam, + LPARAM lparam); + static DesktopNotificationController* Get(HWND hwnd) { + return reinterpret_cast( + GetWindowLongPtr(hwnd, 0)); + } + + static constexpr int toast_margin_ = 20; + static const TCHAR class_name_[]; + enum TimerID { TimerID_Animate = 1 }; + HWND hwnd_controller_ = NULL; + HFONT caption_font_ = NULL, body_font_ = NULL; + std::vector instances_; + std::deque> queue_; + bool is_animating_ = false; +}; + +class DesktopNotificationController::Notification { + public: + Notification(); + explicit Notification(const std::shared_ptr& data); + Notification(const Notification&); + ~Notification(); + + bool operator==(const Notification& other) const; + + void Close(); + void Set(std::u16string caption, std::u16string body_text, HBITMAP image); + + private: + std::shared_ptr data_; + + friend class DesktopNotificationController; +}; + +} // namespace electron + +#endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_DESKTOP_NOTIFICATION_CONTROLLER_H_ diff --git a/shell/browser/notifications/win/win32_desktop_notifications/toast.cc b/shell/browser/notifications/win/win32_desktop_notifications/toast.cc new file mode 100644 index 0000000000000..753baa61c84e5 --- /dev/null +++ b/shell/browser/notifications/win/win32_desktop_notifications/toast.cc @@ -0,0 +1,867 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef NOMINMAX +#define NOMINMAX +#endif +#include "shell/browser/notifications/win/win32_desktop_notifications/toast.h" + +#include + +#include +#include +#include +#include +#include +#include + +#include "base/logging.h" +#include "base/strings/string_util_win.h" +#include "shell/browser/notifications/win/win32_desktop_notifications/common.h" +#include "shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h" + +#pragma comment(lib, "msimg32.lib") +#pragma comment(lib, "uxtheme.lib") + +using std::min; +using std::shared_ptr; + +namespace electron { + +static COLORREF GetAccentColor() { + bool success = false; + if (IsAppThemed()) { + HKEY hkey; + if (RegOpenKeyEx(HKEY_CURRENT_USER, + TEXT("SOFTWARE\\Microsoft\\Windows\\DWM"), 0, + KEY_QUERY_VALUE, &hkey) == ERROR_SUCCESS) { + COLORREF color; + DWORD type, size; + if (RegQueryValueEx(hkey, TEXT("AccentColor"), nullptr, &type, + reinterpret_cast(&color), + &(size = sizeof(color))) == ERROR_SUCCESS && + type == REG_DWORD) { + // convert from RGBA + color = RGB(GetRValue(color), GetGValue(color), GetBValue(color)); + success = true; + } else if (RegQueryValueEx(hkey, TEXT("ColorizationColor"), nullptr, + &type, reinterpret_cast(&color), + &(size = sizeof(color))) == ERROR_SUCCESS && + type == REG_DWORD) { + // convert from BGRA + color = RGB(GetBValue(color), GetGValue(color), GetRValue(color)); + success = true; + } + + RegCloseKey(hkey); + + if (success) + return color; + } + } + + return GetSysColor(COLOR_ACTIVECAPTION); +} + +// Stretches a bitmap to the specified size, preserves alpha channel +static HBITMAP StretchBitmap(HBITMAP bitmap, unsigned width, unsigned height) { + // We use StretchBlt for the scaling, but that discards the alpha channel. + // So we first create a separate grayscale bitmap from the alpha channel, + // scale that separately, and copy it back to the scaled color bitmap. + + BITMAP bm; + if (!GetObject(bitmap, sizeof(bm), &bm)) + return NULL; + + if (width == 0 || height == 0) + return NULL; + + HBITMAP result_bitmap = NULL; + + HDC hdc_screen = GetDC(NULL); + + HBITMAP alpha_src_bitmap; + { + BITMAPINFOHEADER bmi = {sizeof(BITMAPINFOHEADER)}; + bmi.biWidth = bm.bmWidth; + bmi.biHeight = bm.bmHeight; + bmi.biPlanes = bm.bmPlanes; + bmi.biBitCount = bm.bmBitsPixel; + bmi.biCompression = BI_RGB; + + void* alpha_src_bits; + alpha_src_bitmap = + CreateDIBSection(NULL, reinterpret_cast(&bmi), + DIB_RGB_COLORS, &alpha_src_bits, NULL, 0); + + if (alpha_src_bitmap) { + if (GetDIBits(hdc_screen, bitmap, 0, 0, 0, + reinterpret_cast(&bmi), DIB_RGB_COLORS) && + bmi.biSizeImage > 0 && (bmi.biSizeImage % 4) == 0) { + auto* buf = reinterpret_cast( + _aligned_malloc(bmi.biSizeImage, sizeof(DWORD))); + + if (buf) { + GetDIBits(hdc_screen, bitmap, 0, bm.bmHeight, buf, + reinterpret_cast(&bmi), DIB_RGB_COLORS); + + const DWORD* src = reinterpret_cast(buf); + const DWORD* end = reinterpret_cast(buf + bmi.biSizeImage); + + BYTE* dest = reinterpret_cast(alpha_src_bits); + + for (; src != end; ++src, ++dest) { + BYTE a = *src >> 24; + *dest++ = a; + *dest++ = a; + *dest++ = a; + } + + _aligned_free(buf); + } + } + } + } + + if (alpha_src_bitmap) { + BITMAPINFOHEADER bmi = {sizeof(BITMAPINFOHEADER)}; + bmi.biWidth = width; + bmi.biHeight = height; + bmi.biPlanes = 1; + bmi.biBitCount = 32; + bmi.biCompression = BI_RGB; + + void* color_bits; + auto* color_bitmap = + CreateDIBSection(NULL, reinterpret_cast(&bmi), + DIB_RGB_COLORS, &color_bits, NULL, 0); + + void* alpha_bits; + auto* alpha_bitmap = + CreateDIBSection(NULL, reinterpret_cast(&bmi), + DIB_RGB_COLORS, &alpha_bits, NULL, 0); + + HDC hdc = CreateCompatibleDC(NULL); + HDC hdc_src = CreateCompatibleDC(NULL); + + if (color_bitmap && alpha_bitmap && hdc && hdc_src) { + SetStretchBltMode(hdc, HALFTONE); + + // resize color channels + SelectObject(hdc, color_bitmap); + SelectObject(hdc_src, bitmap); + StretchBlt(hdc, 0, 0, width, height, hdc_src, 0, 0, bm.bmWidth, + bm.bmHeight, SRCCOPY); + + // resize alpha channel + SelectObject(hdc, alpha_bitmap); + SelectObject(hdc_src, alpha_src_bitmap); + StretchBlt(hdc, 0, 0, width, height, hdc_src, 0, 0, bm.bmWidth, + bm.bmHeight, SRCCOPY); + + // flush before touching the bits + GdiFlush(); + + // apply the alpha channel + auto* dest = reinterpret_cast(color_bits); + auto* src = reinterpret_cast(alpha_bits); + auto* end = src + (width * height * 4); + while (src != end) { + dest[3] = src[0]; + dest += 4; + src += 4; + } + + // create the resulting bitmap + result_bitmap = + CreateDIBitmap(hdc_screen, &bmi, CBM_INIT, color_bits, + reinterpret_cast(&bmi), DIB_RGB_COLORS); + } + + if (hdc_src) + DeleteDC(hdc_src); + if (hdc) + DeleteDC(hdc); + + if (alpha_bitmap) + DeleteObject(alpha_bitmap); + if (color_bitmap) + DeleteObject(color_bitmap); + + DeleteObject(alpha_src_bitmap); + } + + ReleaseDC(NULL, hdc_screen); + + return result_bitmap; +} + +const TCHAR DesktopNotificationController::Toast::class_name_[] = + TEXT("DesktopNotificationToast"); + +DesktopNotificationController::Toast::Toast(HWND hwnd, + shared_ptr* data) + : hwnd_(hwnd), data_(*data) { + HDC hdc_screen = GetDC(NULL); + hdc_ = CreateCompatibleDC(hdc_screen); + ReleaseDC(NULL, hdc_screen); +} + +DesktopNotificationController::Toast::~Toast() { + if (uia_) { + auto* UiaDisconnectProvider = + reinterpret_cast(GetProcAddress( + GetModuleHandle(L"uiautomationcore.dll"), "UiaDisconnectProvider")); + // first detach from the toast, then call UiaDisconnectProvider; + // UiaDisconnectProvider may call WM_GETOBJECT and we don't want + // it to return the object that we're disconnecting + uia_->DetachToast(); + + if (UiaDisconnectProvider) + UiaDisconnectProvider(uia_); + + uia_->Release(); + uia_ = nullptr; + } + + DeleteDC(hdc_); + if (bitmap_) + DeleteBitmap(bitmap_); + if (scaled_image_) + DeleteBitmap(scaled_image_); +} + +void DesktopNotificationController::Toast::Register(HINSTANCE hinstance) { + WNDCLASSEX wc = {sizeof(wc)}; + wc.lpfnWndProc = &Toast::WndProc; + wc.lpszClassName = class_name_; + wc.cbWndExtra = sizeof(Toast*); + wc.hInstance = hinstance; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + + RegisterClassEx(&wc); +} + +LRESULT DesktopNotificationController::Toast::WndProc(HWND hwnd, + UINT message, + WPARAM wparam, + LPARAM lparam) { + switch (message) { + case WM_CREATE: { + auto*& cs = reinterpret_cast(lparam); + auto* data = + static_cast*>(cs->lpCreateParams); + auto* inst = new Toast(hwnd, data); + SetWindowLongPtr(hwnd, 0, (LONG_PTR)inst); + } break; + + case WM_NCDESTROY: + delete Get(hwnd); + SetWindowLongPtr(hwnd, 0, 0); + return 0; + + case WM_DESTROY: + if (Get(hwnd)->uia_) { + // free UI Automation resources associated with this window + UiaReturnRawElementProvider(hwnd, 0, 0, nullptr); + } + break; + + case WM_MOUSEACTIVATE: + return MA_NOACTIVATE; + + case WM_TIMER: { + if (wparam == TimerID_AutoDismiss) { + auto* inst = Get(hwnd); + + Notification notification(inst->data_); + inst->data_->controller->OnNotificationDismissed(notification); + + inst->AutoDismiss(); + } + } + return 0; + + case WM_LBUTTONDOWN: { + auto* inst = Get(hwnd); + + inst->Dismiss(); + + Notification notification(inst->data_); + if (inst->is_close_hot_) + inst->data_->controller->OnNotificationDismissed(notification); + else + inst->data_->controller->OnNotificationClicked(notification); + } + return 0; + + case WM_MOUSEMOVE: { + auto* inst = Get(hwnd); + if (!inst->is_highlighted_) { + inst->is_highlighted_ = true; + + TRACKMOUSEEVENT tme = {sizeof(tme), TME_LEAVE, hwnd}; + TrackMouseEvent(&tme); + } + + POINT cursor = {GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam)}; + inst->is_close_hot_ = + (PtInRect(&inst->close_button_rect_, cursor) != FALSE); + + if (!inst->is_non_interactive_) + inst->CancelDismiss(); + + inst->UpdateContents(); + } + return 0; + + case WM_MOUSELEAVE: { + auto* inst = Get(hwnd); + inst->is_highlighted_ = false; + inst->is_close_hot_ = false; + inst->UpdateContents(); + + if (!inst->ease_out_active_ && inst->ease_in_pos_ == 1.0f) + inst->ScheduleDismissal(); + + // Make sure stack collapse happens if needed + inst->data_->controller->StartAnimation(); + } + return 0; + + case WM_WINDOWPOSCHANGED: { + auto*& wp = reinterpret_cast(lparam); + if (wp->flags & SWP_HIDEWINDOW) { + if (!IsWindowVisible(hwnd)) + Get(hwnd)->is_highlighted_ = false; + } + } break; + + case WM_GETOBJECT: + if (lparam == UiaRootObjectId) { + auto* inst = Get(hwnd); + if (!inst->uia_) { + inst->uia_ = new UIAutomationInterface(inst); + inst->uia_->AddRef(); + } + // don't return the interface if it's being disconnected + if (!inst->uia_->IsDetached()) { + return UiaReturnRawElementProvider(hwnd, wparam, lparam, inst->uia_); + } + } + break; + } + + return DefWindowProc(hwnd, message, wparam, lparam); +} + +HWND DesktopNotificationController::Toast::Create( + HINSTANCE hinstance, + shared_ptr data) { + return CreateWindowEx(WS_EX_LAYERED | WS_EX_NOACTIVATE | WS_EX_TOPMOST, + class_name_, nullptr, WS_POPUP, 0, 0, 0, 0, NULL, NULL, + hinstance, &data); +} + +void DesktopNotificationController::Toast::Draw() { + const COLORREF accent = GetAccentColor(); + + COLORREF back_color; + { + // base background color is 2/3 of accent + // highlighted adds a bit of intensity to every channel + + int h = is_highlighted_ ? (0xff / 20) : 0; + + back_color = RGB(min(0xff, (GetRValue(accent) * 2 / 3) + h), + min(0xff, (GetGValue(accent) * 2 / 3) + h), + min(0xff, (GetBValue(accent) * 2 / 3) + h)); + } + + const float back_luma = (GetRValue(back_color) * 0.299f / 255) + + (GetGValue(back_color) * 0.587f / 255) + + (GetBValue(back_color) * 0.114f / 255); + + const struct { + float r, g, b; + } back_f = { + GetRValue(back_color) / 255.0f, + GetGValue(back_color) / 255.0f, + GetBValue(back_color) / 255.0f, + }; + + COLORREF fore_color, dimmed_color; + { + // based on the lightness of background, we draw foreground in light + // or dark shades of gray blended onto the background with slight + // transparency to avoid sharp contrast + + constexpr float alpha = 0.9f; + constexpr float intensity_light[] = {(1.0f * alpha), (0.8f * alpha)}; + constexpr float intensity_dark[] = {(0.1f * alpha), (0.3f * alpha)}; + + // select foreground intensity values (light or dark) + auto& i = (back_luma < 0.6f) ? intensity_light : intensity_dark; + + float r, g, b; + + r = i[0] + back_f.r * (1 - alpha); + g = i[0] + back_f.g * (1 - alpha); + b = i[0] + back_f.b * (1 - alpha); + fore_color = RGB(r * 0xff, g * 0xff, b * 0xff); + + r = i[1] + back_f.r * (1 - alpha); + g = i[1] + back_f.g * (1 - alpha); + b = i[1] + back_f.b * (1 - alpha); + dimmed_color = RGB(r * 0xff, g * 0xff, b * 0xff); + } + + // Draw background + { + auto* brush = CreateSolidBrush(back_color); + + RECT rc = {0, 0, toast_size_.cx, toast_size_.cy}; + FillRect(hdc_, &rc, brush); + + DeleteBrush(brush); + } + + SetBkMode(hdc_, TRANSPARENT); + + const auto close = L'\x2715'; + auto* caption_font = data_->controller->GetCaptionFont(); + auto* body_font = data_->controller->GetBodyFont(); + + TEXTMETRIC tm_cap; + SelectFont(hdc_, caption_font); + GetTextMetrics(hdc_, &tm_cap); + + auto text_offset_x = margin_.cx; + + BITMAP image_info = {}; + if (scaled_image_) { + GetObject(scaled_image_, sizeof(image_info), &image_info); + + text_offset_x += margin_.cx + image_info.bmWidth; + } + + // calculate close button rect + POINT close_pos; + { + SIZE extent = {}; + GetTextExtentPoint32W(hdc_, &close, 1, &extent); + + close_button_rect_.right = toast_size_.cx; + close_button_rect_.top = 0; + + close_pos.x = close_button_rect_.right - margin_.cy - extent.cx; + close_pos.y = close_button_rect_.top + margin_.cy; + + close_button_rect_.left = close_pos.x - margin_.cy; + close_button_rect_.bottom = close_pos.y + extent.cy + margin_.cy; + } + + // image + if (scaled_image_) { + HDC hdc_image = CreateCompatibleDC(NULL); + SelectBitmap(hdc_image, scaled_image_); + BLENDFUNCTION blend = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA}; + AlphaBlend(hdc_, margin_.cx, margin_.cy, image_info.bmWidth, + image_info.bmHeight, hdc_image, 0, 0, image_info.bmWidth, + image_info.bmHeight, blend); + DeleteDC(hdc_image); + } + + // caption + { + RECT rc = {text_offset_x, margin_.cy, close_button_rect_.left, + toast_size_.cy}; + + SelectFont(hdc_, caption_font); + SetTextColor(hdc_, fore_color); + DrawText(hdc_, base::as_wcstr(data_->caption), + (UINT)data_->caption.length(), &rc, + DT_SINGLELINE | DT_END_ELLIPSIS | DT_NOPREFIX); + } + + // body text + if (!data_->body_text.empty()) { + RECT rc = {text_offset_x, 2 * margin_.cy + tm_cap.tmAscent, + toast_size_.cx - margin_.cx, toast_size_.cy - margin_.cy}; + + SelectFont(hdc_, body_font); + SetTextColor(hdc_, dimmed_color); + DrawText(hdc_, base::as_wcstr(data_->body_text), + (UINT)data_->body_text.length(), &rc, + DT_LEFT | DT_WORDBREAK | DT_NOPREFIX | DT_END_ELLIPSIS | + DT_EDITCONTROL); + } + + // close button + { + SelectFont(hdc_, caption_font); + SetTextColor(hdc_, is_close_hot_ ? fore_color : dimmed_color); + ExtTextOut(hdc_, close_pos.x, close_pos.y, 0, nullptr, &close, 1, nullptr); + } + + is_content_updated_ = true; +} + +void DesktopNotificationController::Toast::Invalidate() { + is_content_updated_ = false; +} + +bool DesktopNotificationController::Toast::IsRedrawNeeded() const { + return !is_content_updated_; +} + +void DesktopNotificationController::Toast::UpdateBufferSize() { + if (hdc_) { + SIZE new_size; + { + TEXTMETRIC tm_cap = {}; + HFONT font = data_->controller->GetCaptionFont(); + if (font) { + SelectFont(hdc_, font); + if (!GetTextMetrics(hdc_, &tm_cap)) + return; + } + + TEXTMETRIC tm_body = {}; + font = data_->controller->GetBodyFont(); + if (font) { + SelectFont(hdc_, font); + if (!GetTextMetrics(hdc_, &tm_body)) + return; + } + + this->margin_ = {tm_cap.tmAveCharWidth * 2, tm_cap.tmAscent / 2}; + + new_size.cx = margin_.cx + (32 * tm_cap.tmAveCharWidth) + margin_.cx; + new_size.cy = margin_.cy + (tm_cap.tmHeight) + margin_.cy; + + if (!data_->body_text.empty()) + new_size.cy += margin_.cy + (3 * tm_body.tmHeight); + + if (data_->image) { + BITMAP bm; + if (GetObject(data_->image, sizeof(bm), &bm)) { + // cap the image size + const int max_dim_size = 80; + + auto width = bm.bmWidth; + auto height = bm.bmHeight; + if (width < height) { + if (height > max_dim_size) { + width = width * max_dim_size / height; + height = max_dim_size; + } + } else { + if (width > max_dim_size) { + height = height * max_dim_size / width; + width = max_dim_size; + } + } + + ScreenMetrics scr; + SIZE image_draw_size = {scr.X(width), scr.Y(height)}; + + new_size.cx += image_draw_size.cx + margin_.cx; + + auto height_with_image = + margin_.cy + (image_draw_size.cy) + margin_.cy; + + if (new_size.cy < height_with_image) + new_size.cy = height_with_image; + + UpdateScaledImage(image_draw_size); + } + } + } + + if (new_size.cx != this->toast_size_.cx || + new_size.cy != this->toast_size_.cy) { + HDC hdc_screen = GetDC(NULL); + auto* new_bitmap = + CreateCompatibleBitmap(hdc_screen, new_size.cx, new_size.cy); + ReleaseDC(NULL, hdc_screen); + + if (new_bitmap) { + if (SelectBitmap(hdc_, new_bitmap)) { + RECT dirty1 = {}, dirty2 = {}; + if (toast_size_.cx < new_size.cx) { + dirty1 = {toast_size_.cx, 0, new_size.cx, toast_size_.cy}; + } + if (toast_size_.cy < new_size.cy) { + dirty2 = {0, toast_size_.cy, new_size.cx, new_size.cy}; + } + + if (this->bitmap_) + DeleteBitmap(this->bitmap_); + this->bitmap_ = new_bitmap; + this->toast_size_ = new_size; + + Invalidate(); + + // Resize also the DWM buffer to prevent flicker during + // window resizing. Make sure any existing data is not + // overwritten by marking the dirty region. + { + POINT origin = {0, 0}; + + UPDATELAYEREDWINDOWINFO ulw; + ulw.cbSize = sizeof(ulw); + ulw.hdcDst = NULL; + ulw.pptDst = nullptr; + ulw.psize = &toast_size_; + ulw.hdcSrc = hdc_; + ulw.pptSrc = &origin; + ulw.crKey = 0; + ulw.pblend = nullptr; + ulw.dwFlags = 0; + ulw.prcDirty = &dirty1; + auto b1 = UpdateLayeredWindowIndirect(hwnd_, &ulw); + ulw.prcDirty = &dirty2; + auto b2 = UpdateLayeredWindowIndirect(hwnd_, &ulw); + DCHECK(b1 && b2); + } + + return; + } + + DeleteBitmap(new_bitmap); + } + } + } +} + +void DesktopNotificationController::Toast::UpdateScaledImage(const SIZE& size) { + BITMAP bm; + if (!GetObject(scaled_image_, sizeof(bm), &bm) || bm.bmWidth != size.cx || + bm.bmHeight != size.cy) { + if (scaled_image_) + DeleteBitmap(scaled_image_); + scaled_image_ = StretchBitmap(data_->image, size.cx, size.cy); + } +} + +void DesktopNotificationController::Toast::UpdateContents() { + Draw(); + + if (IsWindowVisible(hwnd_)) { + RECT rc; + GetWindowRect(hwnd_, &rc); + POINT origin = {0, 0}; + SIZE size = {rc.right - rc.left, rc.bottom - rc.top}; + UpdateLayeredWindow(hwnd_, NULL, nullptr, &size, hdc_, &origin, 0, nullptr, + 0); + } +} + +void DesktopNotificationController::Toast::Dismiss() { + if (!is_non_interactive_) { + // Set a flag to prevent further interaction. We don't disable the HWND + // because we still want to receive mouse move messages in order to keep + // the toast under the cursor and not collapse it while dismissing. + is_non_interactive_ = true; + + AutoDismiss(); + } +} + +void DesktopNotificationController::Toast::AutoDismiss() { + KillTimer(hwnd_, TimerID_AutoDismiss); + StartEaseOut(); +} + +void DesktopNotificationController::Toast::CancelDismiss() { + KillTimer(hwnd_, TimerID_AutoDismiss); + ease_out_active_ = false; + ease_out_pos_ = 0; +} + +void DesktopNotificationController::Toast::ScheduleDismissal() { + ULONG duration; + if (!SystemParametersInfo(SPI_GETMESSAGEDURATION, 0, &duration, 0)) { + duration = 5; + } + SetTimer(hwnd_, TimerID_AutoDismiss, duration * 1000, nullptr); +} + +void DesktopNotificationController::Toast::ResetContents() { + if (scaled_image_) { + DeleteBitmap(scaled_image_); + scaled_image_ = NULL; + } + + Invalidate(); +} + +void DesktopNotificationController::Toast::PopUp(int y) { + vertical_pos_target_ = vertical_pos_ = y; + StartEaseIn(); +} + +void DesktopNotificationController::Toast::SetVerticalPosition(int y) { + // Don't restart animation if current target is the same + if (y == vertical_pos_target_) + return; + + // Make sure the new animation's origin is at the current position + vertical_pos_ += static_cast((vertical_pos_target_ - vertical_pos_) * + stack_collapse_pos_); + + // Set new target position and start the animation + vertical_pos_target_ = y; + stack_collapse_start_ = GetTickCount(); + data_->controller->StartAnimation(); +} + +HDWP DesktopNotificationController::Toast::Animate(HDWP hdwp, + const POINT& origin) { + UpdateBufferSize(); + + if (IsRedrawNeeded()) + Draw(); + + POINT src_origin = {0, 0}; + + UPDATELAYEREDWINDOWINFO ulw; + ulw.cbSize = sizeof(ulw); + ulw.hdcDst = NULL; + ulw.pptDst = nullptr; + ulw.psize = nullptr; + ulw.hdcSrc = hdc_; + ulw.pptSrc = &src_origin; + ulw.crKey = 0; + ulw.pblend = nullptr; + ulw.dwFlags = 0; + ulw.prcDirty = nullptr; + + POINT pt = {0, 0}; + SIZE size = {0, 0}; + BLENDFUNCTION blend; + UINT dwpFlags = + SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOREDRAW | SWP_NOCOPYBITS; + + auto ease_in_pos = AnimateEaseIn(); + auto ease_out_pos = AnimateEaseOut(); + auto stack_collapse_pos = AnimateStackCollapse(); + + auto y_offset = (vertical_pos_target_ - vertical_pos_) * stack_collapse_pos; + + size.cx = static_cast(toast_size_.cx * ease_in_pos); + size.cy = toast_size_.cy; + + pt.x = origin.x - size.cx; + pt.y = static_cast(origin.y - vertical_pos_ - y_offset - size.cy); + + ulw.pptDst = &pt; + ulw.psize = &size; + + if (ease_in_active_ && ease_in_pos == 1.0f) { + ease_in_active_ = false; + ScheduleDismissal(); + } + + this->ease_in_pos_ = ease_in_pos; + this->stack_collapse_pos_ = stack_collapse_pos; + + if (ease_out_pos != this->ease_out_pos_) { + blend.BlendOp = AC_SRC_OVER; + blend.BlendFlags = 0; + blend.SourceConstantAlpha = (BYTE)(255 * (1.0f - ease_out_pos)); + blend.AlphaFormat = 0; + + ulw.pblend = &blend; + ulw.dwFlags = ULW_ALPHA; + + this->ease_out_pos_ = ease_out_pos; + + if (ease_out_pos == 1.0f) { + ease_out_active_ = false; + + dwpFlags &= ~SWP_SHOWWINDOW; + dwpFlags |= SWP_HIDEWINDOW; + } + } + + if (stack_collapse_pos == 1.0f) { + vertical_pos_ = vertical_pos_target_; + } + + // `UpdateLayeredWindowIndirect` updates position, size, and transparency. + // `DeferWindowPos` updates z-order, and also position and size in case + // ULWI fails, which can happen when one of the dimensions is zero (e.g. + // at the beginning of ease-in). + + UpdateLayeredWindowIndirect(hwnd_, &ulw); + hdwp = DeferWindowPos(hdwp, hwnd_, HWND_TOPMOST, pt.x, pt.y, size.cx, size.cy, + dwpFlags); + return hdwp; +} + +void DesktopNotificationController::Toast::StartEaseIn() { + DCHECK(!ease_in_active_); + ease_in_start_ = GetTickCount(); + ease_in_active_ = true; + data_->controller->StartAnimation(); +} + +void DesktopNotificationController::Toast::StartEaseOut() { + DCHECK(!ease_out_active_); + ease_out_start_ = GetTickCount(); + ease_out_active_ = true; + data_->controller->StartAnimation(); +} + +bool DesktopNotificationController::Toast::IsStackCollapseActive() const { + return (vertical_pos_ != vertical_pos_target_); +} + +float DesktopNotificationController::Toast::AnimateEaseIn() { + if (!ease_in_active_) + return ease_in_pos_; + + constexpr DWORD duration = 500; + auto elapsed = GetTickCount() - ease_in_start_; + float time = std::min(duration, elapsed) / static_cast(duration); + + // decelerating exponential ease + const float a = -8.0f; + auto pos = (std::exp(a * time) - 1.0f) / (std::exp(a) - 1.0f); + + return pos; +} + +float DesktopNotificationController::Toast::AnimateEaseOut() { + if (!ease_out_active_) + return ease_out_pos_; + + constexpr DWORD duration = 120; + auto elapsed = GetTickCount() - ease_out_start_; + float time = std::min(duration, elapsed) / static_cast(duration); + + // accelerating circle ease + auto pos = 1.0f - std::sqrt(1 - time * time); + + return pos; +} + +float DesktopNotificationController::Toast::AnimateStackCollapse() { + if (!IsStackCollapseActive()) + return stack_collapse_pos_; + + constexpr DWORD duration = 500; + auto elapsed = GetTickCount() - stack_collapse_start_; + float time = std::min(duration, elapsed) / static_cast(duration); + + // decelerating exponential ease + const float a = -8.0f; + auto pos = (std::exp(a * time) - 1.0f) / (std::exp(a) - 1.0f); + + return pos; +} + +} // namespace electron diff --git a/shell/browser/notifications/win/win32_desktop_notifications/toast.h b/shell/browser/notifications/win/win32_desktop_notifications/toast.h new file mode 100644 index 0000000000000..62126cd27ee9d --- /dev/null +++ b/shell/browser/notifications/win/win32_desktop_notifications/toast.h @@ -0,0 +1,109 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_TOAST_H_ +#define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_TOAST_H_ + +#include + +#include "shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h" + +#include "base/check.h" + +#include "base/memory/raw_ptr.h" + +namespace electron { + +class DesktopNotificationController::Toast { + public: + static void Register(HINSTANCE hinstance); + static HWND Create(HINSTANCE hinstance, + std::shared_ptr data); + static Toast* Get(HWND hwnd) { + return reinterpret_cast(GetWindowLongPtr(hwnd, 0)); + } + + static LRESULT CALLBACK WndProc(HWND hwnd, + UINT message, + WPARAM wparam, + LPARAM lparam); + + const std::shared_ptr& GetNotification() const { + return data_; + } + + void ResetContents(); + + void Dismiss(); + + void PopUp(int y); + void SetVerticalPosition(int y); + int GetVerticalPosition() const { return vertical_pos_target_; } + int GetHeight() const { return toast_size_.cy; } + HDWP Animate(HDWP hdwp, const POINT& origin); + bool IsAnimationActive() const { + return ease_in_active_ || ease_out_active_ || IsStackCollapseActive(); + } + bool IsHighlighted() const { + DCHECK(!(is_highlighted_ && !IsWindowVisible(hwnd_))); + return is_highlighted_; + } + + private: + enum TimerID { TimerID_AutoDismiss = 1 }; + + Toast(HWND hwnd, std::shared_ptr* data); + ~Toast(); + + void UpdateBufferSize(); + void UpdateScaledImage(const SIZE& size); + void Draw(); + void Invalidate(); + bool IsRedrawNeeded() const; + void UpdateContents(); + + void AutoDismiss(); + void CancelDismiss(); + void ScheduleDismissal(); + + void StartEaseIn(); + void StartEaseOut(); + bool IsStackCollapseActive() const; + + float AnimateEaseIn(); + float AnimateEaseOut(); + float AnimateStackCollapse(); + + private: + static const TCHAR class_name_[]; + + const HWND hwnd_; + HDC hdc_; + HBITMAP bitmap_ = NULL; + + class UIAutomationInterface; + raw_ptr uia_ = nullptr; + + const std::shared_ptr data_; // never null + + SIZE toast_size_ = {}; + SIZE margin_ = {}; + RECT close_button_rect_ = {}; + HBITMAP scaled_image_ = NULL; + + int vertical_pos_ = 0; + int vertical_pos_target_ = 0; + bool is_non_interactive_ = false; + bool ease_in_active_ = false; + bool ease_out_active_ = false; + bool is_content_updated_ = false; + bool is_highlighted_ = false; + bool is_close_hot_ = false; + DWORD ease_in_start_, ease_out_start_, stack_collapse_start_; + float ease_in_pos_ = 0, ease_out_pos_ = 0, stack_collapse_pos_ = 0; +}; + +} // namespace electron + +#endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_TOAST_H_ diff --git a/shell/browser/notifications/win/win32_desktop_notifications/toast_uia.cc b/shell/browser/notifications/win/win32_desktop_notifications/toast_uia.cc new file mode 100644 index 0000000000000..472de5152b063 --- /dev/null +++ b/shell/browser/notifications/win/win32_desktop_notifications/toast_uia.cc @@ -0,0 +1,258 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#include "shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h" + +#include + +#include "base/check_op.h" +#include "base/strings/string_util_win.h" +#include "shell/browser/notifications/win/win32_desktop_notifications/common.h" + +#pragma comment(lib, "uiautomationcore.lib") + +namespace electron { + +DesktopNotificationController::Toast::UIAutomationInterface:: + UIAutomationInterface(Toast* toast) + : hwnd_(toast->hwnd_) { + text_ = toast->data_->caption; + if (!toast->data_->body_text.empty()) { + if (!text_.empty()) + text_.append(u", "); + text_.append(toast->data_->body_text); + } +} + +ULONG DesktopNotificationController::Toast::UIAutomationInterface::AddRef() { + return InterlockedIncrement(&cref_); +} + +ULONG DesktopNotificationController::Toast::UIAutomationInterface::Release() { + LONG ret = InterlockedDecrement(&cref_); + if (ret == 0) { + delete this; + return 0; + } + DCHECK_GT(ret, 0); + return ret; +} + +STDMETHODIMP +DesktopNotificationController::Toast::UIAutomationInterface::QueryInterface( + REFIID riid, + LPVOID* ppv) { + if (!ppv) + return E_INVALIDARG; + + if (riid == IID_IUnknown) { + *ppv = + static_cast(static_cast(this)); + } else if (riid == __uuidof(IRawElementProviderSimple)) { + *ppv = static_cast(this); + } else if (riid == __uuidof(IWindowProvider)) { + *ppv = static_cast(this); + } else if (riid == __uuidof(IInvokeProvider)) { + *ppv = static_cast(this); + } else if (riid == __uuidof(ITextProvider)) { + *ppv = static_cast(this); + } else { + *ppv = nullptr; + return E_NOINTERFACE; + } + + this->AddRef(); + return S_OK; +} + +HRESULT DesktopNotificationController::Toast::UIAutomationInterface:: + get_ProviderOptions(ProviderOptions* retval) { + *retval = ProviderOptions_ServerSideProvider; + return S_OK; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::GetPatternProvider( + PATTERNID pattern_id, + IUnknown** retval) { + switch (pattern_id) { + case UIA_WindowPatternId: + *retval = static_cast(this); + break; + case UIA_InvokePatternId: + *retval = static_cast(this); + break; + case UIA_TextPatternId: + *retval = static_cast(this); + break; + default: + *retval = nullptr; + return S_OK; + } + this->AddRef(); + return S_OK; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::GetPropertyValue( + PROPERTYID property_id, + VARIANT* retval) { + // Note: In order to have the toast read by the NVDA screen reader, we + // pretend that we're a Windows 8 native toast notification by reporting + // these property values: + // ClassName: ToastContentHost + // ControlType: UIA_ToolTipControlTypeId + + retval->vt = VT_EMPTY; + switch (property_id) { + case UIA_NamePropertyId: + retval->vt = VT_BSTR; + retval->bstrVal = SysAllocString(base::as_wcstr(text_)); + break; + + case UIA_ClassNamePropertyId: + retval->vt = VT_BSTR; + retval->bstrVal = SysAllocString(L"ToastContentHost"); + break; + + case UIA_ControlTypePropertyId: + retval->vt = VT_I4; + retval->lVal = UIA_ToolTipControlTypeId; + break; + + case UIA_LiveSettingPropertyId: + retval->vt = VT_I4; + retval->lVal = Assertive; + break; + + case UIA_IsContentElementPropertyId: + case UIA_IsControlElementPropertyId: + case UIA_IsPeripheralPropertyId: + retval->vt = VT_BOOL; + retval->lVal = VARIANT_TRUE; + break; + + case UIA_HasKeyboardFocusPropertyId: + case UIA_IsKeyboardFocusablePropertyId: + case UIA_IsOffscreenPropertyId: + retval->vt = VT_BOOL; + retval->lVal = VARIANT_FALSE; + break; + } + return S_OK; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface:: + get_HostRawElementProvider(IRawElementProviderSimple** retval) { + if (!hwnd_) + return E_FAIL; + return UiaHostProviderFromHwnd(hwnd_, retval); +} + +HRESULT DesktopNotificationController::Toast::UIAutomationInterface::Invoke() { + return E_NOTIMPL; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::SetVisualState( + WindowVisualState state) { + // setting the visual state is not supported + return E_FAIL; +} + +HRESULT DesktopNotificationController::Toast::UIAutomationInterface::Close() { + return E_NOTIMPL; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::WaitForInputIdle( + int milliseconds, + BOOL* retval) { + return E_NOTIMPL; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::get_CanMaximize( + BOOL* retval) { + *retval = FALSE; + return S_OK; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::get_CanMinimize( + BOOL* retval) { + *retval = FALSE; + return S_OK; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::get_IsModal( + BOOL* retval) { + *retval = FALSE; + return S_OK; +} + +HRESULT DesktopNotificationController::Toast::UIAutomationInterface:: + get_WindowVisualState(WindowVisualState* retval) { + *retval = WindowVisualState_Normal; + return S_OK; +} + +HRESULT DesktopNotificationController::Toast::UIAutomationInterface:: + get_WindowInteractionState(WindowInteractionState* retval) { + if (!hwnd_) + *retval = WindowInteractionState_Closing; + else + *retval = WindowInteractionState_ReadyForUserInteraction; + + return S_OK; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::get_IsTopmost( + BOOL* retval) { + *retval = TRUE; + return S_OK; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::GetSelection( + SAFEARRAY** retval) { + return E_NOTIMPL; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::GetVisibleRanges( + SAFEARRAY** retval) { + return E_NOTIMPL; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::RangeFromChild( + IRawElementProviderSimple* child_element, + ITextRangeProvider** retval) { + return E_NOTIMPL; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::RangeFromPoint( + UiaPoint point, + ITextRangeProvider** retval) { + return E_NOTIMPL; +} + +HRESULT +DesktopNotificationController::Toast::UIAutomationInterface::get_DocumentRange( + ITextRangeProvider** retval) { + return E_NOTIMPL; +} + +HRESULT DesktopNotificationController::Toast::UIAutomationInterface:: + get_SupportedTextSelection(SupportedTextSelection* retval) { + *retval = SupportedTextSelection_None; + return S_OK; +} + +} // namespace electron diff --git a/shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h b/shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h new file mode 100644 index 0000000000000..0639357b24e75 --- /dev/null +++ b/shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h @@ -0,0 +1,84 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_TOAST_UIA_H_ +#define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_TOAST_UIA_H_ + +#include "shell/browser/notifications/win/win32_desktop_notifications/toast.h" + +#include + +#include + +namespace electron { + +class DesktopNotificationController::Toast::UIAutomationInterface + : public IRawElementProviderSimple, + public IWindowProvider, + public IInvokeProvider, + public ITextProvider { + public: + explicit UIAutomationInterface(Toast* toast); + + void DetachToast() { hwnd_ = NULL; } + + bool IsDetached() const { return !hwnd_; } + + private: + virtual ~UIAutomationInterface() = default; + + // IUnknown + public: + ULONG STDMETHODCALLTYPE AddRef() override; + ULONG STDMETHODCALLTYPE Release() override; + STDMETHODIMP QueryInterface(REFIID riid, LPVOID* ppv) override; + + // IRawElementProviderSimple + public: + STDMETHODIMP get_ProviderOptions(ProviderOptions* retval) override; + STDMETHODIMP GetPatternProvider(PATTERNID pattern_id, + IUnknown** retval) override; + STDMETHODIMP GetPropertyValue(PROPERTYID property_id, + VARIANT* retval) override; + STDMETHODIMP get_HostRawElementProvider( + IRawElementProviderSimple** retval) override; + + // IWindowProvider + public: + STDMETHODIMP SetVisualState(WindowVisualState state) override; + STDMETHODIMP Close() override; + STDMETHODIMP WaitForInputIdle(int milliseconds, BOOL* retval) override; + STDMETHODIMP get_CanMaximize(BOOL* retval) override; + STDMETHODIMP get_CanMinimize(BOOL* retval) override; + STDMETHODIMP get_IsModal(BOOL* retval) override; + STDMETHODIMP get_WindowVisualState(WindowVisualState* retval) override; + STDMETHODIMP get_WindowInteractionState( + WindowInteractionState* retval) override; + STDMETHODIMP get_IsTopmost(BOOL* retval) override; + + // IInvokeProvider + public: + STDMETHODIMP Invoke() override; + + // ITextProvider + public: + STDMETHODIMP GetSelection(SAFEARRAY** retval) override; + STDMETHODIMP GetVisibleRanges(SAFEARRAY** retval) override; + STDMETHODIMP RangeFromChild(IRawElementProviderSimple* child_element, + ITextRangeProvider** retval) override; + STDMETHODIMP RangeFromPoint(UiaPoint point, + ITextRangeProvider** retval) override; + STDMETHODIMP get_DocumentRange(ITextRangeProvider** retval) override; + STDMETHODIMP get_SupportedTextSelection( + SupportedTextSelection* retval) override; + + private: + volatile LONG cref_ = 0; + HWND hwnd_; + std::u16string text_; +}; + +} // namespace electron + +#endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_DESKTOP_NOTIFICATIONS_TOAST_UIA_H_ diff --git a/shell/browser/notifications/win/win32_notification.cc b/shell/browser/notifications/win/win32_notification.cc new file mode 100644 index 0000000000000..55d2838f7605e --- /dev/null +++ b/shell/browser/notifications/win/win32_notification.cc @@ -0,0 +1,70 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include "shell/browser/notifications/win/win32_notification.h" + +#include +#include + +#include "base/strings/utf_string_conversions.h" +#include "third_party/skia/include/core/SkBitmap.h" + +namespace electron { + +void Win32Notification::Show(const NotificationOptions& options) { + auto* presenter = static_cast(this->presenter()); + if (!presenter) + return; + + HBITMAP image = NULL; + + if (!options.icon.drawsNothing()) { + if (options.icon.colorType() == kBGRA_8888_SkColorType) { + BITMAPINFOHEADER bmi = {sizeof(BITMAPINFOHEADER)}; + bmi.biWidth = options.icon.width(); + bmi.biHeight = -options.icon.height(); + bmi.biPlanes = 1; + bmi.biBitCount = 32; + bmi.biCompression = BI_RGB; + + HDC hdcScreen = GetDC(NULL); + image = + CreateDIBitmap(hdcScreen, &bmi, CBM_INIT, options.icon.getPixels(), + reinterpret_cast(&bmi), DIB_RGB_COLORS); + ReleaseDC(NULL, hdcScreen); + } + } + + Win32Notification* existing = nullptr; + if (!options.tag.empty()) + existing = presenter->GetNotificationObjectByTag(options.tag); + + if (existing) { + existing->tag_.clear(); + + this->notification_ref_ = std::move(existing->notification_ref_); + this->notification_ref_.Set(options.title, options.msg, image); + // Need to remove the entry in the notifications set that + // NotificationPresenter is holding + existing->Destroy(); + } else { + this->notification_ref_ = + presenter->AddNotification(options.title, options.msg, image); + } + + this->tag_ = options.tag; + + if (image) + DeleteObject(image); +} + +void Win32Notification::Dismiss() { + notification_ref_.Close(); +} + +} // namespace electron diff --git a/shell/browser/notifications/win/win32_notification.h b/shell/browser/notifications/win/win32_notification.h new file mode 100644 index 0000000000000..fdb1145cca307 --- /dev/null +++ b/shell/browser/notifications/win/win32_notification.h @@ -0,0 +1,36 @@ +// Copyright (c) 2015 GitHub, Inc. +// Use of this source code is governed by the MIT license that can be +// found in the LICENSE file. + +#ifndef ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_NOTIFICATION_H_ +#define ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_NOTIFICATION_H_ + +#include + +#include "shell/browser/notifications/notification.h" +#include "shell/browser/notifications/win/notification_presenter_win7.h" + +namespace electron { + +class Win32Notification : public electron::Notification { + public: + Win32Notification(NotificationDelegate* delegate, + NotificationPresenterWin7* presenter) + : Notification(delegate, presenter) {} + void Show(const NotificationOptions& options) override; + void Dismiss() override; + + const DesktopNotificationController::Notification& GetRef() const { + return notification_ref_; + } + + const std::string& GetTag() const { return tag_; } + + private: + DesktopNotificationController::Notification notification_ref_; + std::string tag_; +}; + +} // namespace electron + +#endif // ELECTRON_SHELL_BROWSER_NOTIFICATIONS_WIN_WIN32_NOTIFICATION_H_ diff --git a/shell/browser/ui/views/win_frame_view.cc b/shell/browser/ui/views/win_frame_view.cc index 7525a5fd1c5e0..d085028805988 100644 --- a/shell/browser/ui/views/win_frame_view.cc +++ b/shell/browser/ui/views/win_frame_view.cc @@ -118,35 +118,37 @@ int WinFrameView::NonClientHitTest(const gfx::Point& point) { // corner of the window. This code ensures the mouse isn't set to a size // cursor while hovering over the caption buttons, thus giving the incorrect // impression that the user can resize the window. - RECT button_bounds = {0}; - if (SUCCEEDED(DwmGetWindowAttribute( - views::HWNDForWidget(frame()), DWMWA_CAPTION_BUTTON_BOUNDS, - &button_bounds, sizeof(button_bounds)))) { - gfx::RectF button_bounds_in_dips = gfx::ConvertRectToDips( - gfx::Rect(button_bounds), display::win::GetDPIScale()); - // TODO(crbug.com/1131681): GetMirroredRect() requires an integer rect, - // but the size in DIPs may not be an integer with a fractional device - // scale factor. If we want to keep using integers, the choice to use - // ToFlooredRectDeprecated() seems to be doing the wrong thing given the - // comment below about insetting 1 DIP instead of 1 physical pixel. We - // should probably use ToEnclosedRect() and then we could have inset 1 - // physical pixel here. - gfx::Rect buttons = - GetMirroredRect(gfx::ToFlooredRectDeprecated(button_bounds_in_dips)); - - // There is a small one-pixel strip right above the caption buttons in - // which the resize border "peeks" through. - constexpr int kCaptionButtonTopInset = 1; - // The sizing region at the window edge above the caption buttons is - // 1 px regardless of scale factor. If we inset by 1 before converting - // to DIPs, the precision loss might eliminate this region entirely. The - // best we can do is to inset after conversion. This guarantees we'll - // show the resize cursor when resizing is possible. The cost of which - // is also maybe showing it over the portion of the DIP that isn't the - // outermost pixel. - buttons.Inset(gfx::Insets::TLBR(0, kCaptionButtonTopInset, 0, 0)); - if (buttons.Contains(point)) - return HTNOWHERE; + if (base::win::GetVersion() >= base::win::Version::WIN8) { + RECT button_bounds = {0}; + if (SUCCEEDED(DwmGetWindowAttribute( + views::HWNDForWidget(frame()), DWMWA_CAPTION_BUTTON_BOUNDS, + &button_bounds, sizeof(button_bounds)))) { + gfx::RectF button_bounds_in_dips = gfx::ConvertRectToDips( + gfx::Rect(button_bounds), display::win::GetDPIScale()); + // TODO(crbug.com/1131681): GetMirroredRect() requires an integer rect, + // but the size in DIPs may not be an integer with a fractional device + // scale factor. If we want to keep using integers, the choice to use + // ToFlooredRectDeprecated() seems to be doing the wrong thing given the + // comment below about insetting 1 DIP instead of 1 physical pixel. We + // should probably use ToEnclosedRect() and then we could have inset 1 + // physical pixel here. + gfx::Rect buttons = GetMirroredRect( + gfx::ToFlooredRectDeprecated(button_bounds_in_dips)); + + // There is a small one-pixel strip right above the caption buttons in + // which the resize border "peeks" through. + constexpr int kCaptionButtonTopInset = 1; + // The sizing region at the window edge above the caption buttons is + // 1 px regardless of scale factor. If we inset by 1 before converting + // to DIPs, the precision loss might eliminate this region entirely. The + // best we can do is to inset after conversion. This guarantees we'll + // show the resize cursor when resizing is possible. The cost of which + // is also maybe showing it over the portion of the DIP that isn't the + // outermost pixel. + buttons.Inset(gfx::Insets::TLBR(0, kCaptionButtonTopInset, 0, 0)); + if (buttons.Contains(point)) + return HTNOWHERE; + } } int top_border_thickness = FrameTopBorderThickness(false); diff --git a/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc b/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc index dbed46d56e2c9..7fcddb93ef090 100644 --- a/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc +++ b/shell/browser/ui/win/electron_desktop_window_tree_host_win.cc @@ -46,6 +46,14 @@ bool ElectronDesktopWindowTreeHostWin::ShouldPaintAsActive() const { return views::DesktopWindowTreeHostWin::ShouldPaintAsActive(); } +bool ElectronDesktopWindowTreeHostWin::HasNativeFrame() const { + // Since we never use chromium's titlebar implementation, we can just say + // that we use a native titlebar. This will disable the repaint locking when + // DWM composition is disabled. + // See also https://github.com/electron/electron/issues/1821. + return !ui::win::IsAeroGlassEnabled(); +} + bool ElectronDesktopWindowTreeHostWin::GetDwmFrameInsetsInPixels( gfx::Insets* insets) const { // Set DWMFrameInsets to prevent maximized frameless window from bleeding diff --git a/shell/browser/ui/win/electron_desktop_window_tree_host_win.h b/shell/browser/ui/win/electron_desktop_window_tree_host_win.h index 1901cad02feb6..1e23f8e3d01b8 100644 --- a/shell/browser/ui/win/electron_desktop_window_tree_host_win.h +++ b/shell/browser/ui/win/electron_desktop_window_tree_host_win.h @@ -33,6 +33,7 @@ class ElectronDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin, LPARAM l_param, LRESULT* result) override; bool ShouldPaintAsActive() const override; + bool HasNativeFrame() const override; bool GetDwmFrameInsetsInPixels(gfx::Insets* insets) const override; bool GetClientAreaInsets(gfx::Insets* insets, HMONITOR monitor) const override; diff --git a/shell/common/application_info_win.cc b/shell/common/application_info_win.cc index 77fec81eb14b6..6882b1eae5058 100644 --- a/shell/common/application_info_win.cc +++ b/shell/common/application_info_win.cc @@ -71,11 +71,41 @@ bool GetAppUserModelID(ScopedHString* app_id) { } bool IsRunningInDesktopBridgeImpl() { - UINT32 length = PACKAGE_FAMILY_NAME_MAX_LENGTH; - wchar_t packageFamilyName[PACKAGE_FAMILY_NAME_MAX_LENGTH]; - HANDLE proc = GetCurrentProcess(); - LONG result = GetPackageFamilyName(proc, &length, packageFamilyName); - return result == ERROR_SUCCESS; + if (IsWindows8OrGreater()) { + // GetPackageFamilyName is not available on Windows 7 + using GetPackageFamilyNameFuncPtr = decltype(&GetPackageFamilyName); + + static bool initialize_get_package_family_name = true; + static GetPackageFamilyNameFuncPtr get_package_family_namePtr = NULL; + + if (initialize_get_package_family_name) { + initialize_get_package_family_name = false; + HMODULE kernel32_base = GetModuleHandle(L"Kernel32.dll"); + if (!kernel32_base) { + NOTREACHED() << std::string(" ") << std::string(__FUNCTION__) + << std::string("(): Can't open Kernel32.dll"); + return false; + } + + get_package_family_namePtr = + reinterpret_cast( + GetProcAddress(kernel32_base, "GetPackageFamilyName")); + + if (!get_package_family_namePtr) { + return false; + } + } + + UINT32 length = PACKAGE_FAMILY_NAME_MAX_LENGTH; + wchar_t packageFamilyName[PACKAGE_FAMILY_NAME_MAX_LENGTH]; + HANDLE proc = GetCurrentProcess(); + LONG result = + (*get_package_family_namePtr)(proc, &length, packageFamilyName); + + return result == ERROR_SUCCESS; + } else { + return false; + } } bool IsRunningInDesktopBridge() { diff --git a/shell/common/language_util_win.cc b/shell/common/language_util_win.cc index 1e5020ef61402..e8e681aaaf742 100644 --- a/shell/common/language_util_win.cc +++ b/shell/common/language_util_win.cc @@ -18,6 +18,12 @@ namespace electron { bool GetPreferredLanguagesUsingGlobalization( std::vector* languages) { + if (base::win::GetVersion() < base::win::Version::WIN10) + return false; + if (!base::win::ResolveCoreWinRTDelayload() || + !base::win::ScopedHString::ResolveCoreWinRTStringDelayload()) + return false; + base::win::ScopedHString guid = base::win::ScopedHString::Create( RuntimeClass_Windows_System_UserProfile_GlobalizationPreferences); Microsoft::WRL::ComPtr< diff --git a/shell/common/platform_util_win.cc b/shell/common/platform_util_win.cc index 22eded18a4d5d..443645e111afd 100644 --- a/shell/common/platform_util_win.cc +++ b/shell/common/platform_util_win.cc @@ -369,11 +369,23 @@ bool MoveItemToTrashWithError(const base::FilePath& path, // Elevation prompt enabled for UAC protected files. This overrides the // SILENT, NO_UI and NOERRORUI flags. - if (FAILED(pfo->SetOperationFlags( - FOF_NO_UI | FOFX_ADDUNDORECORD | FOF_NOERRORUI | FOF_SILENT | - FOFX_SHOWELEVATIONPROMPT | FOFX_RECYCLEONDELETE))) { - *error = "Failed to set operation flags"; - return false; + if (base::win::GetVersion() >= base::win::Version::WIN8) { + // Windows 8 introduces the flag RECYCLEONDELETE and deprecates the + // ALLOWUNDO in favor of ADDUNDORECORD. + if (FAILED(pfo->SetOperationFlags( + FOF_NO_UI | FOFX_ADDUNDORECORD | FOF_NOERRORUI | FOF_SILENT | + FOFX_SHOWELEVATIONPROMPT | FOFX_RECYCLEONDELETE))) { + *error = "Failed to set operation flags"; + return false; + } + } else { + // For Windows 7 and Vista, RecycleOnDelete is the default behavior. + if (FAILED(pfo->SetOperationFlags(FOF_NO_UI | FOF_ALLOWUNDO | + FOF_NOERRORUI | FOF_SILENT | + FOFX_SHOWELEVATIONPROMPT))) { + *error = "Failed to set operation flags"; + return false; + } } // Create an IShellItem from the supplied source path. diff --git a/spec/fixtures/version-bumper/fixture_support.md b/spec/fixtures/version-bumper/fixture_support.md new file mode 100644 index 0000000000000..0ca1e58ad4bde --- /dev/null +++ b/spec/fixtures/version-bumper/fixture_support.md @@ -0,0 +1,122 @@ +# Electron Support + +## Finding Support + +If you have a security concern, +please see the [security document](https://github.com/electron/electron/tree/master/SECURITY.md). + +If you're looking for programming help, +for answers to questions, +or to join in discussion with other developers who use Electron, +you can interact with the community in these locations: + +* [`Electron's Discord`](https://discord.com/invite/electron) has channels for: + * Getting help + * Ecosystem apps like [Electron Forge](https://github.com/electron-userland/electron-forge) and [Electron Fiddle](https://github.com/electron/fiddle) + * Sharing ideas with other Electron app developers + * And more! +* [`electron`](https://discuss.atom.io/c/electron) category on the Atom forums +* `#atom-shell` channel on Freenode +* `#electron` channel on [Atom's Slack](https://discuss.atom.io/t/join-us-on-slack/16638?source_topic_id=25406) +* [`electron-ru`](https://telegram.me/electron_ru) *(Russian)* +* [`electron-br`](https://electron-br.slack.com) *(Brazilian Portuguese)* +* [`electron-kr`](https://electron-kr.github.io/electron-kr) *(Korean)* +* [`electron-jp`](https://electron-jp.slack.com) *(Japanese)* +* [`electron-tr`](https://electron-tr.herokuapp.com) *(Turkish)* +* [`electron-id`](https://electron-id.slack.com) *(Indonesia)* +* [`electron-pl`](https://electronpl.github.io) *(Poland)* + +If you'd like to contribute to Electron, +see the [contributing document](https://github.com/electron/electron/blob/master/CONTRIBUTING.md). + +If you've found a bug in a [supported version](#supported-versions) of Electron, +please report it with the [issue tracker](../development/issues.md). + +[awesome-electron](https://github.com/sindresorhus/awesome-electron) +is a community-maintained list of useful example apps, +tools and resources. + +## Supported Versions + +The latest three *stable* major versions are supported by the Electron team. +For example, if the latest release is 6.1.x, then the 5.0.x as well +as the 4.2.x series are supported. We only support the latest minor release +for each stable release series. This means that in the case of a security fix +6.1.x will receive the fix, but we will not release a new version of 6.0.x. + +The latest stable release unilaterally receives all fixes from `master`, +and the version prior to that receives the vast majority of those fixes +as time and bandwidth warrants. The oldest supported release line will receive +only security fixes directly. + +All supported release lines will accept external pull requests to backport +fixes previously merged to `master`, though this may be on a case-by-case +basis for some older supported lines. All contested decisions around release +line backports will be resolved by the [Releases Working Group](https://github.com/electron/governance/tree/master/wg-releases) as an agenda item at their weekly meeting the week the backport PR is raised. + +When an API is changed or removed in a way that breaks existing functionality, the +previous functionality will be supported for a minimum of two major versions when +possible before being removed. For example, if a function takes three arguments, +and that number is reduced to two in major version 10, the three-argument version would +continue to work until, at minimum, major version 12. Past the minimum two-version +threshold, we will attempt to support backwards compatibility beyond two versions +until the maintainers feel the maintenance burden is too high to continue doing so. + +### Currently supported versions + +* 4.x.y +* 3.x.y +* 2.x.y +* 1.x.y + +### End-of-life + +When a release branch reaches the end of its support cycle, the series +will be deprecated in NPM and a final end-of-support release will be +made. This release will add a warning to inform that an unsupported +version of Electron is in use. + +These steps are to help app developers learn when a branch they're +using becomes unsupported, but without being excessively intrusive +to end users. + +If an application has exceptional circumstances and needs to stay +on an unsupported series of Electron, developers can silence the +end-of-support warning by omitting the final release from the app's +`package.json` `devDependencies`. For example, since the 1-6-x series +ended with an end-of-support 1.6.18 release, developers could choose +to stay in the 1-6-x series without warnings with `devDependency` of +`"electron": 1.6.0 - 1.6.17`. + +## Supported Platforms + +Following platforms are supported by Electron: + +### macOS + +Only 64bit binaries are provided for macOS, and the minimum macOS version +supported is macOS 10.11 (El Capitan). + +Native support for Apple Silicon (`arm64`) devices was added in Electron 11.0.0. + +### Windows + +Windows 7 and later are supported, older operating systems are not supported +(and do not work). + +Both `ia32` (`x86`) and `x64` (`amd64`) binaries are provided for Windows. +[Native support for Windows on Arm (`arm64`) devices was added in Electron 6.0.8.](windows-arm.md). +Running apps packaged with previous versions is possible using the ia32 binary. + +### Linux + +The prebuilt binaries of Electron are built on Ubuntu 18.04. + +Whether the prebuilt binary can run on a distribution depends on whether the +distribution includes the libraries that Electron is linked to on the building +platform, so only Ubuntu 18.04 is guaranteed to work, but following platforms +are also verified to be able to run the prebuilt binaries of Electron: + +* Ubuntu 14.04 and newer +* Fedora 24 and newer +* Debian 8 and newer