Compare commits

...

130 Commits

Author SHA1 Message Date
Sudowoodo Release Bot
ba32b32ec3 Bump v19.0.2 2022-06-01 08:31:50 -07:00
trop[bot]
3ad5a45173 fix: zombie windows when fullscreening and closing (#34391)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-31 15:36:50 +02:00
Shelley Vohr
b9d16ab3eb fix: esc not working on Windows during fullscreen (#34359)
* fix: esc not working on Windows during fullscreen

* chore: fix lint
2022-05-30 16:28:51 +02:00
Shelley Vohr
7e2606df02 fix: missing resource printing DCHECK (#34369)
* fix: missing resource printing DCHECK

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-30 12:19:27 +02:00
trop[bot]
8692a5b921 test: add setTitlebarOverlay spec (#34252)
spec: add setTitlebarOverlay spec

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-26 11:05:03 -04:00
electron-roller[bot]
abf438bddc chore: bump chromium to 102.0.5005.63 (19-x-y) (#34349)
chore: bump chromium in DEPS to 102.0.5005.63

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2022-05-25 16:45:55 -04:00
Sudowoodo Release Bot
56515ad544 Bump v19.0.1 2022-05-25 08:31:42 -07:00
trop[bot]
a9ff8f1359 build: do not checkout chromium for ts docs check (#34344)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-24 21:36:57 -07:00
trop[bot]
f84cafe4fd chore: add a TRACE call for crash_reporter::Start() (#34326)
chore: add a TRACE call for crash_reporter::Start()

Initializing the crashReporter takes around 620 milliseconds on Intel
macOS. I have sent a CL to crashpad to partially fix the performance
issue in
https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3641386.
It would be beneficial to log the performance impact of this function in
the traces in case this slows down in the future.

Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2022-05-24 07:41:08 -07:00
Sudowoodo Release Bot
42266d2bf0 Bump v19.0.0 2022-05-23 10:25:38 -07:00
John Kleinschmidt
44b5c72f67 fix: crash on navigator.serial.getPorts() (#34323)
(cherry picked from commit 7f9431764f)
2022-05-23 10:21:05 -07:00
trop[bot]
96e1c7ec92 fix: building node modules with Visual Studio 2017 (#34316)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-23 10:11:38 -07:00
trop[bot]
0206a9b7ed fix: service worker registration with custom protocols (#34315)
* fix: service worker registration with custom protocols

Refs https://github.com/electron/electron/issues/32664

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-23 08:29:54 -07:00
trop[bot]
10ad6f8295 docs: remove X-Content-Security-Policy header in quick-start.md (#34319)
reference: Note: It is known that having both Content-Security-Policy
 and X-Content-Security-Policy or X-Webkit-CSP causes unexpected
 behaviours on certain versions of browsers. Please avoid using deprecated
 X-* headers. https://content-security-policy.com/
also:
1ad18486ed

Co-authored-by: Letu Ren <fantasquex@gmail.com>
2022-05-23 11:19:05 -04:00
Keeley Hammond
23c18be06f revert: add first-instance-ack event to the app.requestSingleInstanceLock() flow (#34312)
fix: revert "feat: add first-instance-ack event to the `app.requestSingleInstanceLock()` flow (#34295)

* Revert "fix: requestSingleInstanceLock API ConnectNamedPipe sometimes hangs program (#33778)"

This reverts commit ffb8749243.

* fix: revert "feat: add first-instance-ack event to the `app.requestSingleInstanceLock()` flow"

* chore: update patch
2022-05-23 14:51:05 +02:00
Keeley Hammond
cc4565bb41 ci: save Windows artifacts at end of job in case they fail (#34313) 2022-05-23 11:25:53 +02:00
Shelley Vohr
9d1c53a7e4 fix: DCHECK on webContents.print() (#34299)
* fix: DCHECK on webContents.print()

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-05-23 10:11:06 +02:00
Shelley Vohr
c7cd23c069 fix: WCO crash on bad titlebarStyle (#34302) 2022-05-22 19:42:27 -07:00
Shelley Vohr
f9dc5b52d0 fix: crash when loading extension with missing manifest (#34303) 2022-05-22 19:32:22 -07:00
electron-roller[bot]
aca4b543d5 chore: bump chromium to 102.0.5005.61 (19-x-y) (#34288)
chore: bump chromium in DEPS to 102.0.5005.61

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2022-05-20 10:32:30 +02:00
trop[bot]
c2a11cef63 fix: crash when creating interface for speculative frame (#34294)
Co-authored-by: samuelmaddock <samuel.maddock@gmail.com>
2022-05-19 15:13:48 -07:00
trop[bot]
85a7498bd6 fix: delayed bounds when moving/resizing and preventing default (#34285)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-19 18:25:11 +02:00
Sudowoodo Release Bot
b0c255b72c Bump v19.0.0-beta.8 2022-05-19 06:31:02 -07:00
trop[bot]
2d91a03b36 docs: Update release dates for E20 (#34275)
Co-authored-by: Sofia Nguy <sofianguy@gmail.com>
2022-05-18 13:21:51 -07:00
trop[bot]
424fd85b1a docs: add missing explanation for [angle|dawn]_enable_vulkan_validation_layers = false (#34259)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-17 11:43:55 -04:00
electron-roller[bot]
ad48ccbb9b chore: bump chromium to 102.0.5005.49 (19-x-y) (#34198)
* chore: bump chromium in DEPS to 102.0.5005.49

* chore: update patches

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>
2022-05-16 12:01:03 -04:00
Sudowoodo Release Bot
2ea9be3ade Bump v19.0.0-beta.7 2022-05-16 06:31:51 -07:00
trop[bot]
52a9566f28 fix: fetching PDF element from WebLocalFrame (#34215)
fix: fetching PDF element from WebLocalFrame

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-13 11:24:01 -05:00
trop[bot]
4ecaae9555 fix: call loadUrl when opening new windows from links (#34189)
* fix: call loadUrl when opening new windows from links

* spec: add regression test

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-12 21:49:25 -04:00
trop[bot]
21b8200170 fix: tray icon not highlighting on empty menu (#34208)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-12 16:20:00 -07:00
Sudowoodo Release Bot
2b6cd3458f Bump v19.0.0-beta.6 2022-05-12 06:31:14 -07:00
trop[bot]
00e747ac24 test: fixup done being called multiple times (#34188)
* test: fixup done being called multiple times

* chore: run ci

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-12 11:04:42 +02:00
Keeley Hammond
082b06cf4e build: re-enable 32-bit Windows symbol generation (#34179) 2022-05-11 13:16:49 -07:00
trop[bot]
b07e17a3bb fix: fix a crash in safeStorage on Linux (#34147)
On Linux, `isEncryptionAvailable()` was crashing instead of returning a
boolean before the 'ready' event was emitted by the app. The reason of
the crash is that [`CreateKeyStorage()`](https://source.chromium.org/chromium/chromium/src/+/main:components/os_crypt/os_crypt_linux.cc;l=74;drc=35be6215ec8f09e50176f36753c68f26c63d1885;bpv=1;bpt=0)
expects the config to be set but the function responsible for setting the
config, [`SetConfig()`](https://source.chromium.org/chromium/chromium/src/+/main:components/os_crypt/os_crypt_linux.cc;l=237;drc=35be6215ec8f09e50176f36753c68f26c63d1885;bpv=1;bpt=0),
is called only after the app is ready inside [`PostCreateMainMessageLoop()`](https://github.com/electron/electron/blob/main/shell/browser/electron_browser_main_parts.cc#L499).
So this changes `IsEncryptionAvailable()` to return `false` when the app
is not ready on Linux and uses that instead of the raw API in other
places like `EncryptString()` and `DecryptString()`.

Fixes: https://github.com/electron/electron/issues/32206
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2022-05-11 10:20:30 -04:00
trop[bot]
49ee456797 test: run node specs with py3 (#34165)
Co-authored-by: Jeremy Rose <japthorp@slack-corp.com>
2022-05-11 10:02:00 +02:00
trop[bot]
85063322e9 fix: building node modules with Visual Studio 2017 (#34164)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-11 10:01:48 +02:00
trop[bot]
633d2961eb fix: create singleton pipename from user & executable (#34160)
* fix: create singleton pipename from user & executable

* fix: use process id & main thread id for pipe name

* fix: write rand to file using WIN method

* fix: remove file rand, add user_name to pipe

* chore: style fixes, shorten program_name & user_name

* fix: remove user_name

* chore: trigger CircleCI

Co-authored-by: VerteDinde <keeleymhammond@gmail.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2022-05-10 16:26:05 -07:00
trop[bot]
4f0592101b chore: stub gtk_native_dialog_get_type (#34151)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-05-09 20:59:41 -07:00
trop[bot]
8797485564 build: change upload-to-s3 vars to upload-to-storage (#34143)
* build: change upload-to-s3 vars to upload-to-az

* build: change upload-to-az to upload-to-storage

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2022-05-09 12:57:14 -07:00
Sudowoodo Release Bot
c3746dc439 Bump v19.0.0-beta.5 2022-05-09 06:31:11 -07:00
Keeley Hammond
d5dadd0d4a fix: load FirstPartySets without Electron initialization (#34138) 2022-05-09 10:44:04 +02:00
trop[bot]
da62dd2721 build: stop uploading assets to S3 (#34116)
* build: remove S3 uploads

* build: remove ending slash upload-index-json (#34125)

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
2022-05-07 03:25:57 -07:00
trop[bot]
c945629872 build: use azure function to hash assets instead of lambda (#34123)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-07 03:25:29 -07:00
trop[bot]
536a17f5ed docs: add missing ackCallback parameter (#34128)
Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>
2022-05-06 23:34:54 -07:00
trop[bot]
433765cd73 refactor: prevent RemoveFromLoginItems() from mounting volumes from login items (#34108)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-05 22:29:41 -04:00
electron-roller[bot]
870110fd52 chore: bump chromium to 102.0.5005.40 (19-x-y) (#34089)
* chore: bump chromium in DEPS to 102.0.5005.40

* chore: update patches

* Trigger Build

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: John Kleinschmidt <jkleinsc@electronjs.org>
2022-05-05 22:06:43 -04:00
trop[bot]
8ce14231fb test: unflake some more tests (#34102)
* test: unflake webview fullscreen test

* test: unflake net throttle test

* Update spec-main/api-net-spec.ts

Co-authored-by: Jeremy Rose <jeremya@chromium.org>

Co-authored-by: Samuel Attard <sattard@salesforce.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-05-05 20:19:46 -04:00
trop[bot]
de09ba2c51 fix: offscreen rendering crash on input select (#34093)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-05 11:49:28 -07:00
trop[bot]
290b548b15 test: unflake some focus tests (#34079)
* spec: unflake some focus tests

* test: disable flaky webFrame visibiilty spec

Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-05 09:40:11 -04:00
Sudowoodo Release Bot
3df4dcc591 Bump v19.0.0-beta.4 2022-05-05 06:31:30 -07:00
trop[bot]
c33d65c1d9 fix: requestSingleInstanceLock API sometimes hangs (#34071)
Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>
2022-05-04 16:41:34 -07:00
trop[bot]
ddb0b1b4c4 test: fix nativeModulesEnabled in spec/webview-spec.js (#34066)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-04 16:28:33 +02:00
trop[bot]
14d3e369ae test: scope internal test fixtures under @electron-ci (#34024)
* test: scope internal test fixtures under `@electron`

* Missed references

* Move packages from @electron to @electron-ci scope

* Fix tests

* fix require

Co-authored-by: Jamie Magee <jamie.magee@gmail.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-04 00:05:49 -07:00
trop[bot]
9f66268fab fix: make BrowserWindow#isFocused() return false when blur() is called on macOS (#34031)
The isFocused() method on macOS works by checking if the selected
BrowserWindow is a key window. Unfortunately, this didn't work well
with blur() because it wasn't calling any macOS APIs that would change
the key status of the window. Hence, this changes the implementation of
blur() to call orderOut first, which removes the key
status of the window. Then when the orderBack function is called, it
moves the window to the back of its level in the screen list, without
changing the key window.

Fixes: https://github.com/electron/electron/issues/33732
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2022-05-04 00:05:17 -07:00
Samuel Attard
577b2ba44b refactor: use posix_spawn instead of NSTask so we can disclaim the spawned ShipIt executable (#33468) (#34058) 2022-05-03 16:14:12 -07:00
trop[bot]
7e35b91f4d build: use smaller resource_class because goma (#34032)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-05-03 11:28:59 -04:00
electron-roller[bot]
04f2b2e2e3 chore: bump chromium to 102.0.5005.27 (19-x-y) (#33932)
* chore: bump chromium in DEPS to 102.0.5005.12

* chore: bump chromium in DEPS to 102.0.5005.22

* 3587410: [Printing] Remove JobEventDetails

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3587410
(cherry picked from commit 75d75bc087a29640cc58ecb7122dbc8ea10ce785)

* chore: update patches

* 3579297: Convert UpdatePrintSettings() to use non-deprecated base::Value APIs.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3579297

* 3577218: WebUI: Delete webui_resources.grd and related GN targets.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3577218
(cherry picked from commit b12e658fee8f8d8832145f0ab141549c3466f567)

* chore: bump chromium in DEPS to 102.0.5005.27

* 3368244: Hook SnapshotForContentAnalysis renderer API to scan system prints

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3368244
(cherry picked from commit 9ccc4d6249)

* 3584006: Remove IsRenderViewLive from content public

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3584006
(cherry picked from commit 5c5bc4ca6d)

* 3368244: Hook SnapshotForContentAnalysis renderer API to scan system prints

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3368244
(cherry picked from commit dbdff6fe7e)

* 3581708: Restore original display when moving from tab-fullscreen to browser-fullscreen.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3581708
(cherry picked from commit c02749954c)

* 64908: Stop building legacy SwiftShader GL in Chromium

https://swiftshader-review.googlesource.com/c/SwiftShader/+/64908

* 3573245: Added Themed versions of RoundedRectBackground and RoundedRectBorder.

https://chromium-review.googlesource.com/c/chromium/src/+/3573245

* fixup for lint

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-05-03 11:27:43 -04:00
Sudowoodo Release Bot
7f88b507d9 Bump v19.0.0-beta.3 2022-05-02 10:47:10 -07:00
trop[bot]
855f36903e fix: move FirstPartySets into the browser process (#34011)
Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3448551

Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2022-05-02 10:46:22 -07:00
trop[bot]
9ef6a77a72 fix: support mixed-case extensions in Linux file dialogs (#34015)
Co-authored-by: Kevin Ushey <kevinushey@gmail.com>
2022-05-02 10:33:48 -07:00
trop[bot]
853693bc87 build: allow script/spec-runner.js with empty list of runners (#34002)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-02 09:45:40 -04:00
trop[bot]
f6a2c296d8 docs: fix return type of setJumpList() in electron.d.ts (#33963)
Before:
```ts
setJumpList(categories: (JumpListCategory[]) | (null)): void;
```

After:
```ts
setJumpList(categories: (JumpListCategory[]) | (null)): ('ok' | 'error' | 'invalidSeparatorError' | 'fileTypeRegistrationError' | 'customCategoryAccessDeniedError');
```

Fixes: https://github.com/electron/electron/issues/33909
Signed-off-by: Darshan Sen <raisinten@gmail.com>

Co-authored-by: Darshan Sen <raisinten@gmail.com>
2022-05-02 17:29:51 +09:00
trop[bot]
eb3abf4c98 refactor: better solution for resizable frameless DCHECK (#33974)
* refactor: better solution for resizable frameless DCHECK

* fix: also implement TargetForRectin WinFrameView

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-05-02 17:29:39 +09:00
trop[bot]
6f853ef616 spec: allow connections to port 2049 (#33993)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-05-02 10:27:34 +09:00
Sudowoodo Release Bot
002ea74027 Bump v19.0.0-beta.2 2022-04-29 06:38:53 -07:00
Keeley Hammond
f30714e85d fix: fix FirstPartySetsHandler initialization (#33972) 2022-04-28 22:18:34 -07:00
Keeley Hammond
1f1a0b5461 build: improve CI speeds and reduce CI costs (#33904) (#33951)
* build: improve CI speeds and reduce CI costs (#33904)

* rely on src cache instead of workspace
* run some tasks in the background and "thread join" later
* merge some ninja build commands to reduce overhead

* remove third_party/electron_node:overlapped-checker

Target is not present in older branches

Co-authored-by: Samuel Attard <sam@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-04-28 12:54:08 -07:00
trop[bot]
dce5680271 feat: allow null when subscribing notification (#33770)
* feat: allow null when subscribing notification

* docs: document null event

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-28 12:20:08 -04:00
trop[bot]
fdd268b31e fix: disable MallocNanoZone on mac (#33966)
Co-authored-by: Jacek Oleksy <jacek.oleksy@gmail.com>
2022-04-28 12:00:45 -04:00
Sudowoodo Release Bot
005eeafe95 Bump v19.0.0-beta.1 2022-04-28 08:53:29 -07:00
Sudowoodo Release Bot
6944863de8 Revert "Bump v19.0.0-alpha.6"
This reverts commit e69ca30e61.
2022-04-28 06:50:36 -07:00
Sudowoodo Release Bot
e69ca30e61 Bump v19.0.0-alpha.6 2022-04-28 06:31:27 -07:00
trop[bot]
40f6d434a9 build: use dev-cdn instead of sysroots s3 bucket (#33937)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-04-28 03:14:14 -07:00
trop[bot]
39ab6525b3 build: ensure sync-done file exists during git cache save (#33956)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-04-27 17:21:34 -07:00
trop[bot]
693b9ec77e feat: implement chrome.tabs.reload to fix PDF Viewer (#33712)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-27 12:17:43 -07:00
trop[bot]
b4b2262c1b build: fix macos release GN gen (#33920)
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-04-27 11:36:29 -07:00
trop[bot]
04510c6870 build: actually verify az urls too (#33950)
Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-04-27 11:06:56 -07:00
Samuel Attard
f2b27f8bb1 build: improve circleci config (#33940)
* build: improve circleci config (#33881)

* build: fix conditional restore of git cache

* build: split lint out of setup.yml

* ci: update release script to handle new CircleCI configs (#33914)

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-04-27 11:02:31 -07:00
trop[bot]
8bd1bbc5ae chore: use semantic-commit-action (#33867)
* chore: use semantic-commit-action

* Update semantic.yml

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2022-04-26 19:05:56 +09:00
trop[bot]
3ed7b54608 build: upload to AZ as well as S3 (#33597)
* build: upload to AZ aswell as S3

* fix: provide env to azput

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-04-25 23:29:01 -07:00
electron-roller[bot]
b0ab8e49a9 chore: bump chromium to 102.0.4999.0. (19-x-y) (#33848)
* chore: bump chromium in DEPS to 102.0.5005.3

* chore: bump chromium in DEPS to 102.0.5005.2

* chore: bump chromium in DEPS to 102.0.5005.12

* chore: bump chromium to 102.0.4999.0 (main) (#33731)

* chore: bump chromium in DEPS to 102.0.4999.0

* 3576640: Set OOM handler during V8 initialization

https://chromium-review.googlesource.com/c/chromium/src/+/3576640

* 3574964: Remove deprecated base::Value usage in print_settings_conversion code.

https://chromium-review.googlesource.com/c/chromium/src/+/3574964

* 3570062: Replicate Active state to render process for all RenderViews.

https://chromium-review.googlesource.com/c/chromium/src/+/3570062

* chore: fixup patch indices

* 3380402: Remove legacy SwiftShader

https://chromium-review.googlesource.com/c/chromium/src/+/3380402

* 3570254: [Local Fonts] Rename permission name from FONT_ACCESS to LOCAL_FONTS.

https://chromium-review.googlesource.com/c/chromium/src/+/3570254

* 3572172: Rename or remove several parameters involved in creation of MimeHandler streams

https://chromium-review.googlesource.com/c/chromium/src/+/3572172

* fix: add missing base/bits include

* chore: fix lint

* chore: remove ia32 Linux support

* chore: patch out swift-format cipd dep on macOS

* build: apply patch better

* build: reset all caches

* build: update zip manifests to remove swiftshared libraries

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3380402

* Revert "build: update zip manifests to remove swiftshared libraries"

This reverts commit 6aeec01ef1a79425a7b7d8c1cfb131a26b91c494.

* Revert "3380402: Remove legacy SwiftShader"

This reverts commit 4c7eebbbf2d0a459cc192959e17ae20f970c2da2.

* build: remove unused swiftshader egl libraries

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Attard <sattard@salesforce.com>
(cherry picked from commit f3e0517b6e)

* chore: update patch after cherry-pick from main roller pr

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-04-25 09:49:02 -04:00
Sudowoodo Release Bot
cb6acecfbe Bump v19.0.0-alpha.5 2022-04-25 06:31:14 -07:00
trop[bot]
97c99731df fix: apply senderFrame details to ipcMain port event (#33783)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-25 09:43:59 +09:00
Sudowoodo Release Bot
6adcd6d4ec Bump v19.0.0-alpha.4 2022-04-21 12:01:45 -07:00
Sudowoodo Release Bot
a9e20abc6b Revert "Bump v19.0.0-alpha.4"
This reverts commit 7c0ed9e837.
2022-04-21 10:25:18 -07:00
Sudowoodo Release Bot
7c0ed9e837 Bump v19.0.0-alpha.4 2022-04-21 06:30:39 -07:00
trop[bot]
9e35bddc32 build: fix intermittent compilation failures on macOS (#33879)
* build: fix intermittent compilation failures on macOS

* chore: remove //base dependency from main executable

* chore: fix lint

Co-authored-by: Milan Burda <milan.burda@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-21 03:14:31 -07:00
trop[bot]
6c0d8e3989 chore: backport 7c9b3938d from libuv (#33872)
Backports https://github.com/libuv/libuv/pull/3597

Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-21 17:21:20 +09:00
Samuel Attard
94d13db50d fix: include accessibility blink strings (#33841) 2022-04-19 20:01:16 -07:00
electron-roller[bot]
cfd9825bc2 chore: bump chromium to 102.0.4989.0 (19-x-y) (#33556)
* chore: bump chromium in DEPS to 102.0.4975.0

* chore: bump chromium in DEPS to 102.0.4977.0

* chore: bump chromium in DEPS to 102.0.4979.0

* chore: bump chromium in DEPS to 102.0.4981.0

* chore: bump chromium in DEPS to 102.0.4983.0

* chore: bump chromium in DEPS to 102.0.4985.0

* chore: bump chromium in DEPS to 102.0.4987.0

* chore: bump chromium in DEPS to 102.0.4989.0

* chore: bump chromium in DEPS to 102.0.4991.0

* chore: bump chromium in DEPS to 102.0.4993.0

* chore: bump chromium in DEPS to 102.0.4995.0

* chore: bump chromium in DEPS to 102.0.4997.0

* chore: bump chromium in DEPS to 102.0.4999.0

* chore: bump chromium in DEPS to 102.0.5001.0

* chore: bump chromium in DEPS to 102.0.5003.0

* chore: bump chromium in DEPS to 102.0.5005.0

* chore: bump chromium in DEPS to 102.0.5005.3

* chore: bump chromium to 102.0.4989.0 (main) (#33557)

* chore: bump chromium in DEPS to 102.0.4975.0

* chore: bump chromium in DEPS to 102.0.4977.0

* chore: update patches

* Remove parameter of OnGpuProcessCrashed()

https://chromium-review.googlesource.com/c/chromium/src/+/3543396

* hid: Add exclusionFilters option to requestDevice

https://chromium-review.googlesource.com/c/chromium/src/+/3478175

* chore: bump chromium in DEPS to 102.0.4979.0

* chore: bump chromium in DEPS to 102.0.4981.0

* chore: update patches

* Deny notification/push permission for documents in non-standard StoragePartitions

https://chromium-review.googlesource.com/c/chromium/src/+/3257305

* Improve FrameTreeNode tracking in URLLoaderNetworkContext

https://chromium-review.googlesource.com/c/chromium/src/+/3341866

* fixup! Remove parameter of OnGpuProcessCrashed()

* chore: fix lint

* Reland "Use gfx::Insets[F]::TLBR() and gfx::Insets[F]::VH() in the rest of Chrome"

https://chromium-review.googlesource.com/c/chromium/src/+/3554236

* chore: bump chromium in DEPS to 102.0.4983.0

* Ensure EyeDropperView does not access a destroyed window

https://chromium-review.googlesource.com/c/chromium/src/+/3561542

* ci: don't delete dawn .git directory

83901: Adds a generated file with the dawn git hash encoded at build time. | https://dawn-review.googlesource.com/c/dawn/+/83901

* ci: update Windows toolchain

3550827: New toolchain for Windows 10 20348 SDK | https://chromium-review.googlesource.com/c/chromium/src/+/3550827

* chore: bump chromium in DEPS to 102.0.4985.0

* chore: update patches

* chore: bump chromium in DEPS to 102.0.4987.0

* chore: update patches

* 3563432: codehealth: remove uses of DictionaryValue in cbui/webui

https://chromium-review.googlesource.com/c/chromium/src/+/3563432

* chore: update patches after rebase

* Use gfx::Insets[F]::TLBR() and gfx::Insets[F]::VH() in the rest of Chrome

https://chromium-review.googlesource.com/c/chromium/src/+/3554236

* 3565724: Preserve "proper method names" as-is in error.stack.

https://chromium-review.googlesource.com/c/v8/v8/+/3565724

* chore: bump chromium in DEPS to 102.0.4989.0

* chore: update patches

* fixup ci: don't delete dawn .git directory for Windows

* 3560843: Remove multi-parameter version of gfx::Rect[F]::Inset()

https://chromium-review.googlesource.com/c/chromium/src/+/3560843

* 3572711: Remove unused IDS_PDF_TOOLTIP_ROTATE_CW resource.

https://chromium-review.googlesource.com/c/chromium/src/+/3572711

* 3572926: Reland "[Sysroot] Switch to Debian Bullseye stable"

https://chromium-review.googlesource.com/c/chromium/src/+/3572926

* build: fixup sysroots with electron specific dependencies

* fixup Remove multi-parameter version of gfx::Rect[F]::Inset()

* fixup 3565724: Preserve "proper method names" as-is in error.stack.

* fixup Remove multi-parameter version of gfx::Rect[F]::Inset()

* test: add spec for navigator.hid.requestDevice({ exclusionFilters: [...] }

* fixup 3565724: Preserve "proper method names" as-is in error.stack.

* ci: use python3 to get the windows toolchain profile

3525960: Explicitly run everything with python3 | https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3525960

* chore: add diagnostic logging

* fix: try calling process.crash()

* chore: remove logging

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
(cherry picked from commit 59dd17f2cf)

* chore: update patches after rebase

* chore: bump chromium in DEPS to 102.0.5005.3

* Revert "chore: bump chromium in DEPS to 102.0.5005.3"

This reverts commit 958cfb2aff.

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-04-19 15:15:36 -04:00
Sudowoodo Release Bot
5ede2aefe7 Bump v19.0.0-alpha.3 2022-04-18 11:12:41 -07:00
trop[bot]
a4308f6ca5 fix: potential crash caused by dlopen different gtk libraries (#33813)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-18 09:43:59 -04:00
Sudowoodo Release Bot
ddd550a95d Bump v19.0.0-alpha.2 2022-04-14 22:29:35 -07:00
trop[bot]
fd3a49ef81 fix: event propagation after exiting fullscreen on Windows (#33788)
* fix: event propagation after exiting fullscreen on Windows

* ci: empty commit to trigger circleci

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-14 22:28:17 -07:00
trop[bot]
1f99f5b902 ci: build python2 from source (#33798)
* ci: add python2 to publish jobs

* chore: install python2 via circle

Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-14 22:24:16 -07:00
Sudowoodo Release Bot
542b10da26 Revert "Bump v19.0.0-alpha.2"
This reverts commit ceb1cd9002.
2022-04-14 07:04:03 -07:00
Sudowoodo Release Bot
ceb1cd9002 Bump v19.0.0-alpha.2 2022-04-14 06:30:56 -07:00
trop[bot]
9e61ef9d2f ci: manually install python@2 (#33786)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-14 06:14:16 -07:00
trop[bot]
20353c29e5 chore: add missing GN dep (#33767)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-14 09:54:25 +02:00
trop[bot]
2217dffbfa chore: interpret bytes to string (#33775)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-14 09:51:14 +02:00
trop[bot]
1dc407a349 fix: #ARGB to #RGBA conversion (#33755)
* fix: argb to rgba conversion

* chore: remove logging import

* refactor: color_str -> converted_color_str

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-13 19:05:05 +02:00
Keeley Hammond
f76354b8a5 build: filter symbols/json correctly per arch (#33751) 2022-04-13 11:31:20 +02:00
trop[bot]
6b9509d2c9 docs: note safeStorage.isEncryptionAvailable() needs ready event (#33739)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-13 10:45:51 +02:00
Sudowoodo Release Bot
dfb6608b98 Revert "Bump v19.0.0-alpha.2"
This reverts commit 7ce1018581.
2022-04-12 19:29:39 -07:00
Sudowoodo Release Bot
7ce1018581 Bump v19.0.0-alpha.2 2022-04-12 16:58:52 -07:00
trop[bot]
f70bc4de62 build: migrate urllib to python3 (#33744)
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2022-04-12 16:58:01 -07:00
trop[bot]
3232650535 build: explicitly run scripts with python3 (#33728)
* build: explicitly run scripts with python3

* chore: update patches

Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-04-12 13:03:04 -07:00
trop[bot]
d37b2671e4 docs: recommend setting e.returnValue (#33646)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2022-04-12 12:09:41 +02:00
trop[bot]
60b91ddcfb build: use python3 to lint (#33718) 2022-04-12 11:02:36 +02:00
Sudowoodo Release Bot
d1037e45b3 Revert "Bump v19.0.0-alpha.2"
This reverts commit fb8d290f0e.
2022-04-11 18:41:53 -07:00
trop[bot]
11e14081cf fix: report more detailed errors in shell.openExternal() on Windows (#33660)
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-04-11 12:00:07 -07:00
Sudowoodo Release Bot
fb8d290f0e Bump v19.0.0-alpha.2 2022-04-11 11:42:07 -07:00
Keeley Hammond
f149686bb9 build: temporarily disable 32-bit Windows symbol generation (#33653) (#33689)
* build: temporarily disable 32-bit Windows symbol generation (#33653)

* build: temporarily disable 32-bit Windows symbol generation

* fix: modify upload.py

* chore: fix comment

Co-authored-by: VerteDinde <vertedinde@electronjs.org>

* chore: upload correct assets

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2022-04-11 11:40:57 -07:00
Sudowoodo Release Bot
43b982e0fa Revert "Bump v19.0.0-alpha.2"
This reverts commit c98e4d85ef.
2022-04-11 11:03:43 -07:00
Sudowoodo Release Bot
c98e4d85ef Bump v19.0.0-alpha.2 2022-04-11 06:30:36 -07:00
trop[bot]
96903856a8 fix: build when pdf component is disabled (#33666)
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2022-04-08 07:50:17 -04:00
Sudowoodo Release Bot
9018c76e37 Revert "Bump v19.0.0-alpha.2"
This reverts commit ac3dd718bf.
2022-04-07 07:44:17 -07:00
Sudowoodo Release Bot
ac3dd718bf Bump v19.0.0-alpha.2 2022-04-07 06:32:07 -07:00
trop[bot]
ae9be599e7 fix: don't unmaximize on macOS if user set max bounds (#33549)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-06 17:17:28 -04:00
trop[bot]
d0fde072d4 fix: remove usage of private pid API on MAS (#33623)
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-04-06 13:40:05 +02:00
trop[bot]
5b9647d3ff docs: mark platform-specific functionality for BrowserWindow (#33596)
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
2022-04-05 12:42:07 -04:00
trop[bot]
05f58d824c Revert "fix: some frameless windows showing a frame on Windows (#32692)" (#33609)
This reverts commit 7c701367c0.

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-04-05 12:27:17 -04:00
trop[bot]
5f6d02a4e7 fix: add missing translation string for ax tree (#33617)
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2022-04-05 08:58:10 -07:00
Sudowoodo Release Bot
01b429edf2 Revert "Bump v19.0.0-alpha.2"
This reverts commit 1b8181af14.
2022-04-04 08:05:27 -07:00
Sudowoodo Release Bot
1b8181af14 Bump v19.0.0-alpha.2 2022-04-04 06:31:13 -07:00
trop[bot]
bdff8837a7 fix: create userData on requestSingleInstanceLock() if needed (#33559) (#33593)
* test: use custom userData folder for requestSingleInstanceLock()

* update test

* prefix test folder path

* fix: create userDataDir on requestSingleInstanceLock() if needed

* Trigger Build

Co-authored-by: Micha Hanselmann <micha.hanselmann@gmail.com>
2022-04-04 17:57:52 +09:00
Sudowoodo Release Bot
85b8861a7f Revert "Bump v19.0.0-alpha.2"
This reverts commit 74e57fa3e7.
2022-03-31 16:46:31 -07:00
Sudowoodo Release Bot
74e57fa3e7 Bump v19.0.0-alpha.2 2022-03-31 06:30:58 -07:00
electron-roller[bot]
6442e87276 chore: bump chromium to 102.0.4971.0 (19-x-y) (#33518)
* chore: bump chromium in DEPS to 102.0.4973.0

* chore: bump chromium to 102.0.4971.0 (main) (#33454)

* chore: bump chromium in DEPS to 102.0.4965.0

* chore: 3-way merge of chromium/printing.patch

* chore: update patch shear in chromium/picture-in-picture.patch

* chore: update patches

* 3101519: Window Placement: Prototype fullscreen companion window support

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3101519

build: add popup_preventer.cc, .h to our library. It's needed because
FullscreenController, we were already using, started aggregating a
PopupPreventer in 3101519.

* chore: bump chromium in DEPS to 102.0.4967.0

* Revert "3101519: Window Placement: Prototype fullscreen companion window support"

This reverts commit fc215cb99c464e939882ed3f5cf8e9874a8e3311.

Adding popup_preventer might not be the right solution; there are
cascading dependencies.

* 3551449: Add service-based usage for system print settings

Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3551449

chore: fix code shear in patches/chromium/printing.patch

* chore: update patches

* chore: bump chromium in DEPS to 102.0.4969.0

* chore: update patches

* chore: bump chromium in DEPS to 102.0.4971.0

* chore: update fix_patch_out_permissions_checks_in_exclusive_access.patch

Refs https://chromium-review.googlesource.com/c/chromium/src/+/3101519

PopupunderPreventer is not useful in //electron since the window
attributes are controlled by the user via setWindowOpenHandler.

* chore: update patches

* Add FirstPartySetsHandler as a interface class in content API.

https://chromium-review.googlesource.com/c/chromium/src/+/3503410

* Create a new MediaStreamRequestType for GetOpenDevice

https://chromium-review.googlesource.com/c/chromium/src/+/3541939

* Support site isolation for <webview> tags in WebViewRendererState.

https://chromium-review.googlesource.com/c/chromium/src/+/3537735

* ci: update xcode version

Refs https://chromium-review.googlesource.com/c/chromium/src/+/3544199
https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
(cherry picked from commit b711860d21)

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
2022-03-30 22:43:08 -07:00
Sudowoodo Release Bot
9a8985f7a2 Bump v19.0.0-alpha.1 2022-03-29 16:07:47 -07:00
290 changed files with 5191 additions and 3037 deletions

1
.circleci/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
config-staging

View File

@@ -6,6 +6,7 @@ setup: true
# Orbs
orbs:
path-filtering: circleci/path-filtering@0.1.0
continuation: circleci/continuation@0.2.0
# All input parameters to pass to build config
parameters:
@@ -13,7 +14,7 @@ parameters:
type: boolean
default: false
upload-to-s3:
upload-to-storage:
type: string
default: '1'
@@ -43,103 +44,33 @@ parameters:
default: all
enum: ["all", "osx-x64", "osx-arm64", "mas-x64", "mas-arm64"]
# Envs
env-global: &env-global
ELECTRON_OUT_DIR: Default
env-linux-medium: &env-linux-medium
<<: *env-global
NUMBER_OF_NINJA_PROCESSES: 3
# Executors
executors:
linux-docker:
parameters:
size:
description: "Docker executor size"
default: 2xlarge+
type: enum
enum: ["medium", "xlarge", "2xlarge+"]
docker:
- image: ghcr.io/electron/build:27db4a3e3512bfd2e47f58cea69922da0835f1d9
resource_class: << parameters.size >>
# List of always run steps
step-checkout-electron: &step-checkout-electron
checkout:
path: src/electron
steps-lint: &steps-lint
steps:
- *step-checkout-electron
- run:
name: Setup third_party Depot Tools
command: |
# "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
echo 'export PATH="$PATH:'"$PWD"'/src/third_party/depot_tools"' >> $BASH_ENV
- run:
name: Download GN Binary
command: |
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
gn_version="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep gn_version | head -n1 | cut -d\' -f4)"
cipd ensure -ensure-file - -root . \<<-CIPD
\$ServiceURL https://chrome-infra-packages.appspot.com/
@Subdir src/buildtools/linux64
gn/gn/linux-amd64 $gn_version
CIPD
echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
- run:
name: Download clang-format Binary
command: |
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
sha1_path='buildtools/linux64/clang-format.sha1'
curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/${sha1_path}?format=TEXT" | base64 -d > "src/${sha1_path}"
download_from_google_storage.py --no_resume --no_auth --bucket chromium-clang-format -s "src/${sha1_path}"
- run:
name: Run Lint
command: |
# gn.py tries to find a gclient root folder starting from the current dir.
# When it fails and returns "None" path, the whole script fails. Let's "fix" it.
touch .gclient
# Another option would be to checkout "buildtools" inside the Electron checkout,
# but then we would lint its contents (at least gn format), and it doesn't pass it.
cd src/electron
node script/yarn install --frozen-lockfile
node script/yarn lint
- run:
name: Run Script Typechecker
command: |
cd src/electron
node script/yarn tsc -p tsconfig.script.json
# List of always run jobs.
jobs:
lint:
executor:
name: linux-docker
size: medium
environment:
<<: *env-linux-medium
<<: *steps-lint
# Initial setup workflow
workflows:
lint:
jobs:
# Job inherited from path-filtering orb
- path-filtering/filter:
generate-config:
docker:
- image: cimg/node:16.14
steps:
- checkout
- path-filtering/set-parameters:
base-revision: main
# Params for mapping; `path-to-test parameter-to-set value-for-parameter` for each row
mapping: |
^((?!docs/).)*$ run-build-mac true
^((?!docs/).)*$ run-build-linux true
docs/.* run-docs-only true
^((?!docs/).)*$ run-docs-only false
config-path: .circleci/build_config.yml
- lint
- run:
command: |
cd .circleci/config
yarn
export CIRCLECI_BINARY="$HOME/circleci"
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | DESTDIR=$CIRCLECI_BINARY bash
node build.js
name: Pack config.yml
- continuation/continue:
configuration_path: .circleci/config-staging/built.yml
parameters: /tmp/pipeline-parameters.json
# Initial setup workflow
workflows:
setup:
jobs:
- generate-config

File diff suppressed because it is too large Load Diff

34
.circleci/config/build.js Normal file
View File

@@ -0,0 +1,34 @@
const cp = require('child_process');
const fs = require('fs-extra');
const path = require('path');
const yaml = require('js-yaml');
const STAGING_DIR = path.resolve(__dirname, '..', 'config-staging');
function copyAndExpand(dir = './') {
const absDir = path.resolve(__dirname, dir);
const targetDir = path.resolve(STAGING_DIR, dir);
if (!fs.existsSync(targetDir)) {
fs.mkdirSync(targetDir);
}
for (const file of fs.readdirSync(absDir)) {
if (!file.endsWith('.yml')) {
if (fs.statSync(path.resolve(absDir, file)).isDirectory()) {
copyAndExpand(path.join(dir, file));
}
continue;
}
fs.writeFileSync(path.resolve(targetDir, file), yaml.dump(yaml.load(fs.readFileSync(path.resolve(absDir, file), 'utf8')), {
noRefs: true,
}));
}
}
if (fs.pathExists(STAGING_DIR)) fs.removeSync(STAGING_DIR);
copyAndExpand();
const output = cp.spawnSync(process.env.CIRCLECI_BINARY || 'circleci', ['config', 'pack', STAGING_DIR]);
fs.writeFileSync(path.resolve(STAGING_DIR, 'built.yml'), output.stdout.toString());

View File

@@ -0,0 +1,51 @@
executor:
name: linux-docker
size: medium
steps:
- checkout:
path: src/electron
- run:
name: Setup third_party Depot Tools
command: |
# "depot_tools" has to be checkout into "//third_party/depot_tools" so pylint.py can a "pylintrc" file.
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git src/third_party/depot_tools
echo 'export PATH="$PATH:'"$PWD"'/src/third_party/depot_tools"' >> $BASH_ENV
- run:
name: Download GN Binary
command: |
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
gn_version="$(curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/DEPS?format=TEXT" | base64 -d | grep gn_version | head -n1 | cut -d\' -f4)"
cipd ensure -ensure-file - -root . \<<-CIPD
\$ServiceURL https://chrome-infra-packages.appspot.com/
@Subdir src/buildtools/linux64
gn/gn/linux-amd64 $gn_version
CIPD
echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
- run:
name: Download clang-format Binary
command: |
chromium_revision="$(grep -A1 chromium_version src/electron/DEPS | tr -d '\n' | cut -d\' -f4)"
sha1_path='buildtools/linux64/clang-format.sha1'
curl -sL "https://chromium.googlesource.com/chromium/src/+/${chromium_revision}/${sha1_path}?format=TEXT" | base64 -d > "src/${sha1_path}"
download_from_google_storage.py --no_resume --no_auth --bucket chromium-clang-format -s "src/${sha1_path}"
- run:
name: Run Lint
command: |
# gn.py tries to find a gclient root folder starting from the current dir.
# When it fails and returns "None" path, the whole script fails. Let's "fix" it.
touch .gclient
# Another option would be to checkout "buildtools" inside the Electron checkout,
# but then we would lint its contents (at least gn format), and it doesn't pass it.
cd src/electron
node script/yarn install --frozen-lockfile
node script/yarn lint
- run:
name: Run Script Typechecker
command: |
cd src/electron
node script/yarn tsc -p tsconfig.script.json

View File

@@ -0,0 +1,10 @@
{
"name": "@electron/circleci-config",
"version": "0.0.0",
"private": true,
"license": "MIT",
"dependencies": {
"fs-extra": "^10.1.0",
"js-yaml": "^4.1.0"
}
}

View File

@@ -0,0 +1,43 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
fs-extra@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^2.0.0"
graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.10"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
js-yaml@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602"
integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==
dependencies:
argparse "^2.0.1"
jsonfile@^6.0.1:
version "6.1.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae"
integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==
dependencies:
universalify "^2.0.0"
optionalDependencies:
graceful-fs "^4.1.6"
universalify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==

20
.github/workflows/semantic.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: "Check Semantic Commit"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
jobs:
main:
name: Validate PR Title
runs-on: ubuntu-latest
steps:
- name: semantic-pull-request
uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: false

120
BUILD.gn
View File

@@ -43,6 +43,7 @@ if (is_mac) {
if (is_linux) {
import("//build/config/linux/pkg_config.gni")
import("//tools/generate_stubs/rules.gni")
pkg_config("gio_unix") {
packages = [ "gio-unix-2.0" ]
@@ -54,6 +55,38 @@ if (is_linux) {
"gdk-pixbuf-2.0",
]
}
generate_library_loader("libnotify_loader") {
name = "LibNotifyLoader"
output_h = "libnotify_loader.h"
output_cc = "libnotify_loader.cc"
header = "<libnotify/notify.h>"
config = ":libnotify_config"
functions = [
"notify_is_initted",
"notify_init",
"notify_get_server_caps",
"notify_get_server_info",
"notify_notification_new",
"notify_notification_add_action",
"notify_notification_set_image_from_pixbuf",
"notify_notification_set_timeout",
"notify_notification_set_urgency",
"notify_notification_set_hint_string",
"notify_notification_show",
"notify_notification_close",
]
}
generate_stubs("electron_gtk_stubs") {
sigs = [ "shell/browser/ui/electron_gtk.sigs" ]
extra_header = "shell/browser/ui/electron_gtk.fragment"
output_name = "electron_gtk_stubs"
public_deps = [ "//ui/gtk:gtk_config" ]
logging_function = "LogNoop()"
logging_include = "ui/gtk/log_noop.h"
}
}
declare_args() {
@@ -253,31 +286,6 @@ copy("copy_shell_devtools_discovery_page") {
outputs = [ "$target_gen_dir/shell_devtools_discovery_page.html" ]
}
if (is_linux) {
generate_library_loader("libnotify_loader") {
name = "LibNotifyLoader"
output_h = "libnotify_loader.h"
output_cc = "libnotify_loader.cc"
header = "<libnotify/notify.h>"
config = ":libnotify_config"
functions = [
"notify_is_initted",
"notify_init",
"notify_get_server_caps",
"notify_get_server_info",
"notify_notification_new",
"notify_notification_add_action",
"notify_notification_set_image_from_pixbuf",
"notify_notification_set_timeout",
"notify_notification_set_urgency",
"notify_notification_set_hint_string",
"notify_notification_show",
"notify_notification_close",
]
}
}
npm_action("electron_version_args") {
script = "generate-version-json"
@@ -363,10 +371,6 @@ source_set("electron_lib") {
"//components/network_session_configurator/common",
"//components/omnibox/browser:buildflags",
"//components/os_crypt",
"//components/pdf/browser",
"//components/pdf/browser:interceptors",
"//components/pdf/common",
"//components/pdf/renderer",
"//components/pref_registry",
"//components/prefs",
"//components/security_state/content",
@@ -541,6 +545,7 @@ source_set("electron_lib") {
if (is_linux) {
libs = [ "xshmfence" ]
deps += [
":electron_gtk_stubs",
":libnotify_loader",
"//build/config/linux/gtk",
"//dbus",
@@ -700,6 +705,8 @@ source_set("electron_lib") {
deps += [
"//chrome/browser/resources/pdf:resources",
"//components/pdf/browser",
"//components/pdf/browser:interceptors",
"//components/pdf/common",
"//components/pdf/renderer",
"//pdf",
]
@@ -803,16 +810,11 @@ if (is_mac) {
# Add the SwiftShader .dylibs in the Libraries directory of the Framework.
bundle_data("electron_swiftshader_binaries") {
sources = [
"$root_out_dir/egl_intermediates/libswiftshader_libEGL.dylib",
"$root_out_dir/egl_intermediates/libswiftshader_libGLESv2.dylib",
"$root_out_dir/vk_intermediates/libvk_swiftshader.dylib",
"$root_out_dir/vk_intermediates/vk_swiftshader_icd.json",
]
outputs = [ "{{bundle_contents_dir}}/Libraries/{{source_file_part}}" ]
public_deps = [
"//ui/gl:swiftshader_egl_library_copy",
"//ui/gl:swiftshader_vk_library_copy",
]
public_deps = [ "//ui/gl:swiftshader_vk_library_copy" ]
}
}
group("electron_angle_library") {
@@ -1054,7 +1056,6 @@ if (is_mac) {
"shell/app/electron_main_mac.cc",
"shell/app/uv_stdio_fix.cc",
"shell/app/uv_stdio_fix.h",
"shell/common/electron_constants.cc",
]
include_dirs = [ "." ]
deps = [
@@ -1105,21 +1106,18 @@ if (is_mac) {
deps = [ ":electron_app" ]
}
extract_symbols("swiftshader_egl_syms") {
binary = "$root_out_dir/libswiftshader_libEGL.dylib"
extract_symbols("egl_syms") {
binary = "$root_out_dir/libEGL.dylib"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/libswiftshader_libEGL.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libEGL.dylib"
deps =
[ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL" ]
dsym_file = "$root_out_dir/libEGL.dylib.dSYM/Contents/Resources/DWARF/libEGL.dylib"
deps = [ "//third_party/angle:libEGL" ]
}
extract_symbols("swiftshader_gles_syms") {
binary = "$root_out_dir/libswiftshader_libGLESv2.dylib"
extract_symbols("gles_syms") {
binary = "$root_out_dir/libGLESv2.dylib"
symbol_dir = "$root_out_dir/breakpad_symbols"
dsym_file = "$root_out_dir/libswiftshader_libGLESv2.dylib.dSYM/Contents/Resources/DWARF/libswiftshader_libGLESv2.dylib"
deps = [
"//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
]
dsym_file = "$root_out_dir/libGLESv2.dylib.dSYM/Contents/Resources/DWARF/libGLESv2.dylib"
deps = [ "//third_party/angle:libGLESv2" ]
}
extract_symbols("crashpad_handler_syms") {
@@ -1131,10 +1129,10 @@ if (is_mac) {
group("electron_symbols") {
deps = [
":egl_syms",
":electron_app_syms",
":electron_framework_syms",
":swiftshader_egl_syms",
":swiftshader_gles_syms",
":gles_syms",
]
if (!is_mas_build) {
@@ -1271,6 +1269,10 @@ if (is_mac) {
if (!is_component_build && is_component_ffmpeg) {
configs += [ "//build/config/gcc:rpath_for_built_shared_libraries" ]
}
if (is_linux) {
deps += [ "//sandbox/linux:chrome_sandbox" ]
}
}
}
@@ -1289,27 +1291,23 @@ if (is_mac) {
deps = [ ":electron_app" ]
}
extract_symbols("swiftshader_egl_symbols") {
binary = "$root_out_dir/swiftshader/libEGL$_target_shared_library_suffix"
extract_symbols("egl_symbols") {
binary = "$root_out_dir/libEGL$_target_shared_library_suffix"
symbol_dir = "$root_out_dir/breakpad_symbols"
deps =
[ "//third_party/swiftshader/src/OpenGL/libEGL:swiftshader_libEGL" ]
deps = [ "//third_party/angle:libEGL" ]
}
extract_symbols("swiftshader_gles_symbols") {
binary =
"$root_out_dir/swiftshader/libGLESv2$_target_shared_library_suffix"
extract_symbols("gles_symbols") {
binary = "$root_out_dir/libGLESv2$_target_shared_library_suffix"
symbol_dir = "$root_out_dir/breakpad_symbols"
deps = [
"//third_party/swiftshader/src/OpenGL/libGLESv2:swiftshader_libGLESv2",
]
deps = [ "//third_party/angle:libGLESv2" ]
}
group("electron_symbols") {
deps = [
":egl_symbols",
":electron_app_symbols",
":swiftshader_egl_symbols",
":swiftshader_gles_symbols",
":gles_symbols",
]
}
}

2
DEPS
View File

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'102.0.4962.3',
'102.0.5005.63',
'node_version':
'v16.14.2',
'nan_version':

View File

@@ -1 +1 @@
19.0.0-nightly.20220329
19.0.2

View File

@@ -11,7 +11,7 @@
# - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64', 'mips64el'}.
# Is used in some publishing scripts, but does NOT affect the Electron binary.
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value.
# - "UPLOAD_TO_S3" Set it to '1' upload a release to the S3 bucket.
# - "UPLOAD_TO_STORAGE" Set it to '1' upload a release to the Azure bucket.
# Otherwise the release will be uploaded to the Github Releases.
# (The value is only checked if "ELECTRON_RELEASE" is defined.)
#
@@ -29,7 +29,7 @@
version: 1.0.{build}
build_cloud: electron-16-core
image: vs2019bt-16.6.2
image: vs2019bt-16.16.11
environment:
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
ELECTRON_OUT_DIR: Default
@@ -154,6 +154,12 @@ build_script:
if ($LASTEXITCODE -ne 0) {
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
}
# build time generation of file dawn/common/Version_autogen.h depends on third_party/dawn/.git/HEAD
# https://dawn-review.googlesource.com/c/dawn/+/83901
$(7z a $zipfile src\third_party\dawn\.git)
if ($LASTEXITCODE -ne 0) {
Write-warning "Failed to add third_party\dawn\.git; continuing anyway"
}
}
- cd src
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
@@ -176,17 +182,8 @@ build_script:
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default third_party/electron_node:headers
- python %LOCAL_GOMA_DIR%\goma_ctl.py stat
- python electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
- appveyor PushArtifact out/Default/windows_toolchain_profile.json
- appveyor PushArtifact out/Default/dist.zip
- appveyor PushArtifact out/Default/shell_browser_ui_unittests.exe
- appveyor PushArtifact out/Default/chromedriver.zip
- appveyor PushArtifact out/ffmpeg/ffmpeg.zip
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
- 7z a node_headers.zip out\Default\gen\node_headers
- appveyor PushArtifact node_headers.zip
- appveyor PushArtifact out/Default/mksnapshot.zip
- appveyor PushArtifact out/Default/hunspell_dictionaries.zip
- appveyor PushArtifact out/Default/electron.lib
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
@@ -201,7 +198,6 @@ build_script:
# It's useful to have pdb files when debugging testing builds that are
# built on CI.
7z a pdb.zip out\Default\*.pdb
appveyor-retry appveyor PushArtifact pdb.zip
}
- python electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
test_script:
@@ -230,14 +226,13 @@ test_script:
- echo "Done verifying mksnapshot"
- if "%RUN_TESTS%"=="true" ( echo Verifying chromedriver & python electron\script\verify-chromedriver.py --build-dir out\Default --source-root %cd% )
- echo "Done verifying chromedriver"
- if exist %cd%\electron.log ( appveyor-retry appveyor PushArtifact %cd%\electron.log )
deploy_script:
- cd electron
- ps: >-
if (Test-Path Env:\ELECTRON_RELEASE) {
if (Test-Path Env:\UPLOAD_TO_S3) {
Write-Output "Uploading Electron release distribution to s3"
& python script\release\uploaders\upload.py --verbose --upload_to_s3
if (Test-Path Env:\UPLOAD_TO_STORAGE) {
Write-Output "Uploading Electron release distribution to azure"
& python script\release\uploaders\upload.py --verbose --upload_to_storage
} else {
Write-Output "Uploading Electron release distribution to github releases"
& python script\release\uploaders\upload.py --verbose
@@ -246,4 +241,18 @@ deploy_script:
node script/release/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
}
on_finish:
- if exist src\electron\electron.log ( appveyor-retry appveyor PushArtifact src\electron\electron.log )
- cd ..
- 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
}
- if exist electron\electron.log ( appveyor-retry appveyor PushArtifact electron\electron.log )

View File

@@ -21,6 +21,9 @@ proprietary_codecs = true
ffmpeg_branding = "Chrome"
enable_basic_printing = true
# Removes DLLs from the build, which are only meant to be used for Chromium development.
# See https://github.com/electron/electron/pull/17985
angle_enable_vulkan_validation_layers = false
dawn_enable_vulkan_validation_layers = false

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import subprocess

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
import os
import subprocess
import sys

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from __future__ import print_function
import os
import subprocess

View File

@@ -69,6 +69,7 @@ static_library("chrome") {
"//chrome/browser/ui/exclusive_access/keyboard_lock_controller.h",
"//chrome/browser/ui/exclusive_access/mouse_lock_controller.cc",
"//chrome/browser/ui/exclusive_access/mouse_lock_controller.h",
"//chrome/browser/ui/native_window_tracker.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.cc",
"//chrome/browser/ui/views/eye_dropper/eye_dropper.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view.cc",
@@ -119,6 +120,8 @@ static_library("chrome") {
if (use_aura) {
sources += [
"//chrome/browser/platform_util_aura.cc",
"//chrome/browser/ui/aura/native_window_tracker_aura.cc",
"//chrome/browser/ui/aura/native_window_tracker_aura.h",
"//chrome/browser/ui/views/eye_dropper/eye_dropper_view_aura.cc",
]
}
@@ -307,6 +310,10 @@ static_library("chrome") {
"//chrome/browser/plugins/pdf_iframe_navigation_throttle.cc",
"//chrome/browser/plugins/pdf_iframe_navigation_throttle.h",
]
deps += [
"//components/pdf/browser",
"//components/pdf/renderer",
]
}
}
@@ -334,15 +341,6 @@ source_set("plugins") {
"//chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.cc",
"//chrome/browser/renderer_host/pepper/pepper_isolated_file_system_message_filter.h",
]
deps += [
"//media:media_buildflags",
"//ppapi/buildflags",
"//ppapi/proxy:ipc",
"//services/device/public/mojom",
]
if (enable_pdf_viewer) {
deps += [ "//components/pdf/browser" ]
}
# renderer side
sources += [
@@ -351,17 +349,18 @@ source_set("plugins") {
"//chrome/renderer/pepper/pepper_shared_memory_message_filter.cc",
"//chrome/renderer/pepper/pepper_shared_memory_message_filter.h",
]
if (enable_pdf_viewer) {
deps += [ "//components/pdf/renderer" ]
}
deps += [
"//components/strings",
"//media:media_buildflags",
"//ppapi/buildflags",
"//ppapi/host",
"//ppapi/proxy",
"//ppapi/proxy:ipc",
"//ppapi/shared_impl",
"//services/device/public/mojom",
"//skia",
"//storage/browser",
]
}

View File

@@ -484,7 +484,6 @@ Returns:
* `argv` string[] - An array of the second instance's command line arguments
* `workingDirectory` string - The second instance's working directory
* `additionalData` unknown - A JSON object of additional data passed from the second instance
* `ackCallback` unknown - A function that can be used to send data back to the second instance
This event will be emitted inside the primary instance of your application
when a second instance has been executed and calls `app.requestSingleInstanceLock()`.
@@ -496,35 +495,12 @@ non-minimized.
**Note:** If the second instance is started by a different user than the first, the `argv` array will not include the arguments.
**Note:** `ackCallback` allows the user to send data back to the
second instance during the `app.requestSingleInstanceLock()` flow.
This callback can be used for cases where the second instance
needs to obtain additional information from the first instance
before quitting.
Currently, the limit on the message size is kMaxMessageLength,
or around 32kB. To be safe, keep the amount of data passed to 31kB at most.
In order to call the callback, `event.preventDefault()` must be called, first.
If the callback is not called in either case, `null` will be sent back.
If `event.preventDefault()` is not called, but `ackCallback` is called
by the user in the event, then the behaviour is undefined.
This event is guaranteed to be emitted after the `ready` event of `app`
gets emitted.
**Note:** Extra command line arguments might be added by Chromium,
such as `--original-process-start-time`.
### Event: 'first-instance-ack'
Returns:
* `event` Event
* `additionalData` unknown - A JSON object of additional data passed from the first instance, in response to the first instance's `second-instance` event.
This event will be emitted within the second instance during the call to `app.requestSingleInstanceLock()`, when the first instance calls the `ackCallback` provided by the `second-instance` event handler.
## Methods
The `app` object has the following methods:
@@ -861,6 +837,8 @@ Returns `Object`:
* `categories` [JumpListCategory[]](structures/jump-list-category.md) | `null` - Array of `JumpListCategory` objects.
Returns `string`
Sets or removes a custom Jump List for the application, and returns one of the
following strings:
@@ -983,13 +961,6 @@ starts:
const { app } = require('electron')
let myWindow = null
app.on('first-instance-ack', (event, additionalData) => {
// Print out the ack received from the first instance.
// Note this event handler must come before the requestSingleInstanceLock call.
// Expected output: '{"myAckKey":"myAckValue"}'
console.log(JSON.stringify(additionalData))
})
const additionalData = { myKey: 'myValue' }
const gotTheLock = app.requestSingleInstanceLock(additionalData)
@@ -997,19 +968,14 @@ if (!gotTheLock) {
app.quit()
} else {
app.on('second-instance', (event, commandLine, workingDirectory, additionalData) => {
// We must call preventDefault if we're sending back data.
event.preventDefault()
// Print out data received from the second instance.
// Expected output: '{"myKey":"myValue"}'
console.log(JSON.stringify(additionalData))
console.log(additionalData)
// Someone tried to run a second instance, we should focus our window.
if (myWindow) {
if (myWindow.isMinimized()) myWindow.restore()
myWindow.focus()
}
const ackData = { myAckKey: 'myAckValue' }
ackCallback(ackData)
})
// Create myWindow, load the rest of the app, etc...

View File

@@ -164,14 +164,14 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `maxWidth` Integer (optional) - Window's maximum width. Default is no limit.
* `maxHeight` Integer (optional) - Window's maximum height. Default is no limit.
* `resizable` boolean (optional) - Whether window is resizable. Default is `true`.
* `movable` boolean (optional) - Whether window is movable. This is not implemented
on Linux. Default is `true`.
* `minimizable` boolean (optional) - Whether window is minimizable. This is not
implemented on Linux. Default is `true`.
* `maximizable` boolean (optional) - Whether window is maximizable. This is not
implemented on Linux. Default is `true`.
* `closable` boolean (optional) - Whether window is closable. This is not implemented
on Linux. Default is `true`.
* `movable` boolean (optional) _macOS_ _Windows_ - Whether window is
movable. This is not implemented on Linux. Default is `true`.
* `minimizable` boolean (optional) _macOS_ _Windows_ - Whether window is
minimizable. This is not implemented on Linux. Default is `true`.
* `maximizable` boolean (optional) _macOS_ _Windows_ - Whether window is
maximizable. This is not implemented on Linux. Default is `true`.
* `closable` boolean (optional) _macOS_ _Windows_ - Whether window is
closable. This is not implemented on Linux. Default is `true`.
* `focusable` boolean (optional) - Whether the window can be focused. Default is
`true`. On Windows setting `focusable: false` also implies setting
`skipTaskbar: true`. On Linux setting `focusable: false` makes the window
@@ -185,7 +185,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `fullscreenable` boolean (optional) - Whether the window can be put into fullscreen
mode. On macOS, also whether the maximize/zoom button should toggle full
screen mode or maximize window. Default is `true`.
* `simpleFullscreen` boolean (optional) - Use pre-Lion fullscreen on macOS. Default is `false`.
* `simpleFullscreen` boolean (optional) _macOS_ - Use pre-Lion fullscreen on
macOS. Default is `false`.
* `skipTaskbar` boolean (optional) _macOS_ _Windows_ - Whether to show the window in taskbar.
Default is `false`.
* `kiosk` boolean (optional) - Whether the window is in kiosk mode. Default is `false`.
@@ -201,27 +202,30 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `parent` BrowserWindow (optional) - Specify parent window. Default is `null`.
* `modal` boolean (optional) - Whether this is a modal window. This only works when the
window is a child window. Default is `false`.
* `acceptFirstMouse` boolean (optional) - Whether clicking an inactive window will also
click through to the web contents. Default is `false` on macOS. This option is not
configurable on other platforms.
* `acceptFirstMouse` boolean (optional) _macOS_ - Whether clicking an
inactive window will also click through to the web contents. Default is
`false` on macOS. This option is not configurable on other platforms.
* `disableAutoHideCursor` boolean (optional) - Whether to hide cursor when typing.
Default is `false`.
* `autoHideMenuBar` boolean (optional) - Auto hide the menu bar unless the `Alt`
key is pressed. Default is `false`.
* `enableLargerThanScreen` boolean (optional) - Enable the window to be resized larger
than screen. Only relevant for macOS, as other OSes allow
larger-than-screen windows by default. Default is `false`.
* `enableLargerThanScreen` boolean (optional) _macOS_ - Enable the window to
be resized larger than screen. Only relevant for macOS, as other OSes
allow larger-than-screen windows by default. Default is `false`.
* `backgroundColor` string (optional) - The window's background color in Hex, RGB, RGBA, HSL, HSLA or named CSS color format. Alpha in #AARRGGBB format is supported if `transparent` is set to `true`. Default is `#FFF` (white). See [win.setBackgroundColor](browser-window.md#winsetbackgroundcolorbackgroundcolor) for more information.
* `hasShadow` boolean (optional) - Whether window should have a shadow. Default is `true`.
* `opacity` number (optional) - Set the initial opacity of the window, between 0.0 (fully
transparent) and 1.0 (fully opaque). This is only implemented on Windows and macOS.
* `opacity` number (optional) _macOS_ _Windows_ - Set the initial opacity of
the window, between 0.0 (fully transparent) and 1.0 (fully opaque). This
is only implemented on Windows and macOS.
* `darkTheme` boolean (optional) - Forces using dark theme for the window, only works on
some GTK+3 desktop environments. Default is `false`.
* `transparent` boolean (optional) - Makes the window [transparent](../tutorial/window-customization.md#create-transparent-windows).
Default is `false`. On Windows, does not work unless the window is frameless.
* `type` string (optional) - The type of window, default is normal window. See more about
this below.
* `visualEffectState` string (optional) - Specify how the material appearance should reflect window activity state on macOS. Must be used with the `vibrancy` property. Possible values are:
* `visualEffectState` string (optional) _macOS_ - Specify how the material
appearance should reflect window activity state on macOS. Must be used
with the `vibrancy` property. Possible values are:
* `followWindow` - The backdrop should automatically appear active when the window is active, and inactive when it is not. This is the default.
* `active` - The backdrop should always appear active.
* `inactive` - The backdrop should always appear inactive.
@@ -229,36 +233,41 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
Default is `default`. Possible values are:
* `default` - Results in the standard title bar for macOS or Windows respectively.
* `hidden` - Results in a hidden title bar and a full size content window. On macOS, the window still has the standard window controls (“traffic lights”) in the top left. On Windows, when combined with `titleBarOverlay: true` it will activate the Window Controls Overlay (see `titleBarOverlay` for more information), otherwise no window controls will be shown.
* `hiddenInset` - Only on macOS, results in a hidden title bar with an alternative look
where the traffic light buttons are slightly more inset from the window edge.
* `customButtonsOnHover` - Only on macOS, results in a hidden title bar and a full size
content window, the traffic light buttons will display when being hovered
over in the top left of the window. **Note:** This option is currently
experimental.
* `trafficLightPosition` [Point](structures/point.md) (optional) - Set a
custom position for the traffic light buttons in frameless windows.
* `roundedCorners` boolean (optional) - Whether frameless window should have
rounded corners on macOS. Default is `true`.
* `fullscreenWindowTitle` boolean (optional) _Deprecated_ - Shows the title in
the title bar in full screen mode on macOS for `hiddenInset` titleBarStyle.
Default is `false`.
* `hiddenInset` _macOS_ - Only on macOS, results in a hidden title bar
with an alternative look where the traffic light buttons are slightly
more inset from the window edge.
* `customButtonsOnHover` _macOS_ - Only on macOS, results in a hidden
title bar and a full size content window, the traffic light buttons will
display when being hovered over in the top left of the window.
**Note:** This option is currently experimental.
* `trafficLightPosition` [Point](structures/point.md) (optional) _macOS_ -
Set a custom position for the traffic light buttons in frameless windows.
* `roundedCorners` boolean (optional) _macOS_ - Whether frameless window
should have rounded corners on macOS. Default is `true`.
* `fullscreenWindowTitle` boolean (optional) _macOS_ _Deprecated_ - Shows
the title in the title bar in full screen mode on macOS for `hiddenInset`
titleBarStyle. Default is `false`.
* `thickFrame` boolean (optional) - Use `WS_THICKFRAME` style for frameless windows on
Windows, which adds standard window frame. Setting it to `false` will remove
window shadow and window animations. Default is `true`.
* `vibrancy` string (optional) - Add a type of vibrancy effect to the window, only on
macOS. Can be `appearance-based`, `light`, `dark`, `titlebar`, `selection`,
`menu`, `popover`, `sidebar`, `medium-light`, `ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`, `tooltip`, `content`, `under-window`, or `under-page`. Please note that `appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are deprecated and have been removed in macOS Catalina (10.15).
* `zoomToPageWidth` boolean (optional) - Controls the behavior on macOS when
option-clicking the green stoplight button on the toolbar or by clicking the
Window > Zoom menu item. If `true`, the window will grow to the preferred
width of the web page when zoomed, `false` will cause it to zoom to the
width of the screen. This will also affect the behavior when calling
`maximize()` directly. Default is `false`.
* `tabbingIdentifier` string (optional) - Tab group name, allows opening the
window as a native tab on macOS 10.12+. Windows with the same tabbing
identifier will be grouped together. This also adds a native new tab button
to your window's tab bar and allows your `app` and window to receive the
`new-window-for-tab` event.
* `vibrancy` string (optional) _macOS_ - Add a type of vibrancy effect to
the window, only on macOS. Can be `appearance-based`, `light`, `dark`,
`titlebar`, `selection`, `menu`, `popover`, `sidebar`, `medium-light`,
`ultra-dark`, `header`, `sheet`, `window`, `hud`, `fullscreen-ui`,
`tooltip`, `content`, `under-window`, or `under-page`. Please note that
`appearance-based`, `light`, `dark`, `medium-light`, and `ultra-dark` are
deprecated and have been removed in macOS Catalina (10.15).
* `zoomToPageWidth` boolean (optional) _macOS_ - Controls the behavior on
macOS when option-clicking the green stoplight button on the toolbar or by
clicking the Window > Zoom menu item. If `true`, the window will grow to
the preferred width of the web page when zoomed, `false` will cause it to
zoom to the width of the screen. This will also affect the behavior when
calling `maximize()` directly. Default is `false`.
* `tabbingIdentifier` string (optional) _macOS_ - Tab group name, allows
opening the window as a native tab on macOS 10.12+. Windows with the same
tabbing identifier will be grouped together. This also adds a native new
tab button to your window's tab bar and allows your `app` and window to
receive the `new-window-for-tab` event.
* `webPreferences` Object (optional) - Settings of web page's features.
* `devTools` boolean (optional) - Whether to enable DevTools. If it is set to `false`, can not use `BrowserWindow.webContents.openDevTools()` to open DevTools. Default is `true`.
* `nodeIntegration` boolean (optional) - Whether node integration is enabled.
@@ -310,8 +319,8 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
* `plugins` boolean (optional) - Whether plugins should be enabled. Default is `false`.
* `experimentalFeatures` boolean (optional) - Enables Chromium's experimental features.
Default is `false`.
* `scrollBounce` boolean (optional) - Enables scroll bounce (rubber banding) effect on
macOS. Default is `false`.
* `scrollBounce` boolean (optional) _macOS_ - Enables scroll bounce
(rubber banding) effect on macOS. Default is `false`.
* `enableBlinkFeatures` string (optional) - A list of feature strings separated by `,`, like
`CSSVariables,KeyboardEventKey` to enable. The full list of supported feature
strings can be found in the [RuntimeEnabledFeatures.json5][runtime-enabled-features]
@@ -464,7 +473,7 @@ window.onbeforeunload = (e) => {
// a non-void value will silently cancel the close.
// It is recommended to use the dialog API to let the user confirm closing the
// application.
e.returnValue = false // equivalent to `return false` but not recommended
e.returnValue = false
}
```
@@ -774,7 +783,7 @@ A `boolean` property that determines whether the window is in fullscreen mode.
A `boolean` property that determines whether the window is focusable.
#### `win.visibleOnAllWorkspaces`
#### `win.visibleOnAllWorkspaces` _macOS_ _Linux_
A `boolean` property that determines whether the window is visible on all workspaces.
@@ -811,13 +820,13 @@ A `string` property that determines the title of the native window.
**Note:** The title of the web page can be different from the title of the native window.
#### `win.minimizable`
#### `win.minimizable` _macOS_ _Windows_
A `boolean` property that determines whether the window can be manually minimized by user.
On Linux the setter is a no-op, although the getter returns `true`.
#### `win.maximizable`
#### `win.maximizable` _macOS_ _Windows_
A `boolean` property that determines whether the window can be manually maximized by user.
@@ -832,13 +841,13 @@ maximizes the window.
A `boolean` property that determines whether the window can be manually resized by user.
#### `win.closable`
#### `win.closable` _macOS_ _Windows_
A `boolean` property that determines whether the window can be manually closed by user.
On Linux the setter is a no-op, although the getter returns `true`.
#### `win.movable`
#### `win.movable` _macOS_ _Windows_
A `boolean` property that determines Whether the window can be moved by user.
@@ -1635,7 +1644,7 @@ Changes window icon.
Sets whether the window traffic light buttons should be visible.
#### `win.setAutoHideMenuBar(hide)`
#### `win.setAutoHideMenuBar(hide)` _Windows_ _Linux_
* `hide` boolean
@@ -1644,7 +1653,7 @@ menu bar will only show when users press the single `Alt` key.
If the menu bar is already visible, calling `setAutoHideMenuBar(true)` won't hide it immediately.
#### `win.isMenuBarAutoHide()`
#### `win.isMenuBarAutoHide()` _Windows_ _Linux_
Returns `boolean` - Whether menu bar automatically hides itself.
@@ -1654,11 +1663,11 @@ Returns `boolean` - Whether menu bar automatically hides itself.
Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single `Alt` key.
#### `win.isMenuBarVisible()`
#### `win.isMenuBarVisible()` _Windows_ _Linux_
Returns `boolean` - Whether the menu bar is visible.
#### `win.setVisibleOnAllWorkspaces(visible[, options])`
#### `win.setVisibleOnAllWorkspaces(visible[, options])` _macOS_ _Linux_
* `visible` boolean
* `options` Object (optional)
@@ -1676,7 +1685,7 @@ Sets whether the window should be visible on all workspaces.
**Note:** This API does nothing on Windows.
#### `win.isVisibleOnAllWorkspaces()`
#### `win.isVisibleOnAllWorkspaces()` _macOS_ _Linux_
Returns `boolean` - Whether the window is visible on all workspaces.

View File

@@ -99,6 +99,7 @@ Only `chrome.storage.local` is supported; `chrome.storage.sync` and
The following methods of `chrome.tabs` are supported:
- `chrome.tabs.sendMessage`
- `chrome.tabs.reload`
- `chrome.tabs.executeScript`
- `chrome.tabs.update` (partial support)
- supported properties: `url`, `muted`.

View File

@@ -18,9 +18,9 @@ The `safeStorage` module has the following methods:
Returns `boolean` - Whether encryption is available.
On Linux, returns true if the secret key is
available. On MacOS, returns true if Keychain is available.
On Windows, returns true with no other preconditions.
On Linux, returns true if the app has emitted the `ready` event and the secret key is available.
On MacOS, returns true if Keychain is available.
On Windows, returns true once the app has emitted the `ready` event.
### `safeStorage.encryptString(plainText)`

View File

@@ -84,7 +84,7 @@ that contains the user information dictionary sent along with the notification.
### `systemPreferences.subscribeNotification(event, callback)` _macOS_
* `event` string
* `event` string | null
* `callback` Function
* `event` string
* `userInfo` Record<string, unknown>
@@ -109,9 +109,11 @@ example values of `event` are:
* `AppleColorPreferencesChangedNotification`
* `AppleShowScrollBarsSettingChanged`
If `event` is null, the `NSDistributedNotificationCenter` doesnt use it as criteria for delivery to the observer. See [docs](https://developer.apple.com/documentation/foundation/nsnotificationcenter/1411723-addobserverforname?language=objc) for more information.
### `systemPreferences.subscribeLocalNotification(event, callback)` _macOS_
* `event` string
* `event` string | null
* `callback` Function
* `event` string
* `userInfo` Record<string, unknown>
@@ -122,9 +124,11 @@ Returns `number` - The ID of this subscription
Same as `subscribeNotification`, but uses `NSNotificationCenter` for local defaults.
This is necessary for events such as `NSUserDefaultsDidChangeNotification`.
If `event` is null, the `NSNotificationCenter` doesnt use it as criteria for delivery to the observer. See [docs](https://developer.apple.com/documentation/foundation/nsnotificationcenter/1411723-addobserverforname?language=objc) for more information.
### `systemPreferences.subscribeWorkspaceNotification(event, callback)` _macOS_
* `event` string
* `event` string | null
* `callback` Function
* `event` string
* `userInfo` Record<string, unknown>
@@ -135,6 +139,8 @@ Returns `number` - The ID of this subscription
Same as `subscribeNotification`, but uses `NSWorkspace.sharedWorkspace.notificationCenter`.
This is necessary for events such as `NSWorkspaceDidActivateApplicationNotification`.
If `event` is null, the `NSWorkspaceNotificationCenter` doesnt use it as criteria for delivery to the observer. See [docs](https://developer.apple.com/documentation/foundation/nsnotificationcenter/1411723-addobserverforname?language=objc) for more information.
### `systemPreferences.unsubscribeNotification(id)` _macOS_
* `id` Integer

View File

@@ -7,21 +7,7 @@ Follow the guidelines below for building **Electron itself** on Linux, for the p
## Prerequisites
* At least 25GB disk space and 8GB RAM.
* Python 2.7.x. Some distributions like CentOS 6.x still use Python 2.6.x
so you may need to check your Python version with `python -V`.
Please also ensure that your system and Python version support at least TLS 1.2.
For a quick test, run the following script:
```sh
$ npx @electron/check-python-tls
```
If the script returns that your configuration is using an outdated security
protocol, use your system's package manager to update Python to the latest
version in the 2.7.x branch. Alternatively, visit https://www.python.org/downloads/
for detailed instructions.
* Python >= 3.7.
* Node.js. There are various ways to install Node. You can download
source code from [nodejs.org](https://nodejs.org) and compile it.
Doing so permits installing Node on your own home directory as a standard user.
@@ -96,7 +82,7 @@ $ sudo apt-get install libc6-dev-arm64-cross linux-libc-dev-arm64-cross \
g++-aarch64-linux-gnu
```
And to cross-compile for `arm` or `ia32` targets, you should pass the
And to cross-compile for `arm` or targets, you should pass the
`target_cpu` parameter to `gn gen`:
```sh

View File

@@ -6,45 +6,12 @@ Follow the guidelines below for building **Electron itself** on macOS, for the p
## Prerequisites
* macOS >= 10.11.6
* [Xcode](https://developer.apple.com/technologies/tools/) >= 9.0.0
* macOS >= 11.6.0
* [Xcode](https://developer.apple.com/technologies/tools/). The exact version
needed depends on what branch you are building, but the latest version of
Xcode is generally a good bet for building `main`.
* [node.js](https://nodejs.org) (external)
* Python 2.7 with support for TLS 1.2
## Python
Please also ensure that your system and Python version support at least TLS 1.2.
This depends on both your version of macOS and Python. For a quick test, run:
```sh
$ npx @electron/check-python-tls
```
If the script returns that your configuration is using an outdated security
protocol, you can either update macOS to High Sierra or install a new version
of Python 2.7.x. To upgrade Python, use [Homebrew](https://brew.sh/):
```sh
$ brew install python@2 && brew link python@2 --force
```
If you are using Python as provided by Homebrew, you also need to install
the following Python modules:
* [pyobjc](https://pypi.org/project/pyobjc/#description)
You can use `pip` to install it:
```sh
$ pip install pyobjc
```
## macOS SDK
If you're developing Electron and don't plan to redistribute your
custom Electron build, you may skip this section.
Official Electron builds are built with [Xcode 12.2](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip), and the macOS 11.0 SDK. Building with a newer SDK works too, but the releases currently use the 11.0 SDK.
* Python >= 3.7
## Building Electron

View File

@@ -28,7 +28,7 @@ For C++ and Python, we follow Chromium's [Coding
Style](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/styleguide/styleguide.md).
There is also a script `script/cpplint.py` to check whether all files conform.
The Python version we are using now is Python 2.7.
The Python version we are using now is Python 3.9.
The C++ code uses a lot of Chromium's abstractions and types, so it's
recommended to get acquainted with them. A good place to start is

View File

@@ -22,11 +22,12 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
| 12.0.0 | -- | 2020-Nov-19 | 2021-Mar-02 | M89 | v14.16 | 🚫 |
| 13.0.0 | -- | 2021-Mar-04 | 2021-May-25 | M91 | v14.16 | 🚫 |
| 14.0.0 | -- | 2021-May-27 | 2021-Aug-31 | M93 | v14.17 | 🚫 |
| 15.0.0 | 2021-Jul-20 | 2021-Sep-01 | 2021-Sep-21 | M94 | v16.5 | |
| 16.0.0 | 2021-Sep-23 | 2021-Oct-20 | 2021-Nov-16 | M96 | v16.9 | |
| 15.0.0 | 2021-Jul-20 | 2021-Sep-01 | 2021-Sep-21 | M94 | v16.5 | 🚫 |
| 16.0.0 | 2021-Sep-23 | 2021-Oct-20 | 2021-Nov-16 | M96 | v16.9 | 🚫 |
| 17.0.0 | 2021-Nov-18 | 2022-Jan-06 | 2022-Feb-01 | M98 | v16.13 | ✅ |
| 18.0.0 | 2022-Feb-03 | 2022-Mar-03 | 2022-Mar-29 | M100 | v16.13 | ✅ |
| 19.0.0 | 2022-Mar-31 | 2022-Apr-26 | 2022-May-24 | M102 | TBD | ✅ |
| 19.0.0 | 2022-Mar-31 | 2022-Apr-26 | 2022-May-24 | M102 | v16.14 | ✅ |
| 20.0.0 | 2022-May-26 | 2022-Jun-21 | 2022-Aug-02 | M104 | TBD | ✅ |
**Notes:**

View File

@@ -131,7 +131,6 @@ folder of your project:
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
@@ -427,7 +426,6 @@ window.addEventListener('DOMContentLoaded', () => {
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>

View File

@@ -65,7 +65,6 @@ template("electron_extra_paks") {
"$root_gen_dir/net/net_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
"$root_gen_dir/ui/resources/webui_resources.pak",
"$target_gen_dir/electron_resources.pak",
]
deps = [
@@ -175,8 +174,10 @@ template("electron_paks") {
source_patterns = [
"${root_gen_dir}/chrome/platform_locale_settings_",
"${root_gen_dir}/components/strings/components_strings_",
"${root_gen_dir}/third_party/blink/public/strings/blink_accessibility_strings_",
"${root_gen_dir}/third_party/blink/public/strings/blink_strings_",
"${root_gen_dir}/device/bluetooth/strings/bluetooth_strings_",
"${root_gen_dir}/extensions/strings/extensions_strings_",
"${root_gen_dir}/services/strings/services_strings_",
"${root_gen_dir}/ui/strings/app_locale_settings_",
"${root_gen_dir}/ui/strings/ax_strings_",
@@ -186,8 +187,10 @@ template("electron_paks") {
"//chrome/app/resources:platform_locale_settings",
"//components/strings:components_strings",
"//device/bluetooth/strings",
"//extensions/strings",
"//services/strings",
"//third_party/blink/public/strings",
"//third_party/blink/public/strings:accessibility_strings",
"//ui/strings:app_locale_settings",
"//ui/strings:ax_strings",
"//ui/strings:ui_strings",

View File

@@ -24,6 +24,9 @@
<message name="IDS_DEFAULT_PRINT_DOCUMENT_TITLE" desc="Default title for a print document">
Untitled Document
</message>
<message name="IDS_UTILITY_PROCESS_PRINT_BACKEND_SERVICE_NAME" desc="The name of the utility process used for backend interactions with printer drivers.">
Print Backend Service
</message>
<!-- Desktop Capturer API -->
<message name="IDS_DESKTOP_MEDIA_PICKER_SINGLE_SCREEN_NAME" desc="Name for screens in the desktop media picker UI when there is only one monitor.">
@@ -145,4 +148,16 @@
</message>
<message name="IDS_HID_CHOOSER_ITEM_WITHOUT_NAME" desc="User option displaying the device IDs for a Human Interface Device (HID) without a device name.">
Unknown Device (<ph name="DEVICE_ID">$1<ex>1234:abcd</ex></ph>) </message>
<if expr="is_win">
<then>
<message name="IDS_AX_UNLABELED_IMAGE_ROLE_DESCRIPTION" desc="Accessibility role description for a graphic (image) on a web page or PDF that does not have a description for blind users." is_accessibility_with_no_ui="true">
Unlabeled graphic
</message>
</then>
<else>
<message name="IDS_AX_UNLABELED_IMAGE_ROLE_DESCRIPTION" desc="Accessibility role description for an image on a web page or PDF that does not have a description for blind users." is_accessibility_with_no_ui="true">
Unlabeled image
</message>
</else>
</if>
</grit-part>

View File

@@ -1,6 +1,6 @@
import * as fs from 'fs';
import { Menu } from 'electron/main';
import { Menu, deprecate } from 'electron/main';
const bindings = process._linkedBinding('electron_browser_app');
const commandLine = process._linkedBinding('electron_common_command_line');
@@ -111,3 +111,7 @@ for (const name of events) {
webContents.emit(name, event, ...args);
});
}
// Deprecation.
deprecate.event(app, 'gpu-process-crashed', 'child-process-gone');
deprecate.event(app, 'renderer-process-crashed', 'render-process-gone');

View File

@@ -627,6 +627,7 @@ WebContents.prototype._init = function () {
});
this.on('-ipc-ports' as any, function (event: Electron.IpcMainEvent, internal: boolean, channel: string, message: any, ports: any[]) {
addSenderFrameToEvent(event);
event.ports = ports.map(p => new MessagePortMain(p));
ipcMain.emit(channel, event, message);
});

View File

@@ -78,6 +78,19 @@ export function openGuestWindow ({ event, embedder, guest, referrer, disposition
...browserWindowOptions
});
if (!guest) {
// When we open a new window from a link (via OpenURLFromTab),
// the browser process is responsible for initiating navigation
// in the new window.
window.loadURL(url, {
httpReferrer: referrer,
...(postData && {
postData,
extraHeaders: formatPostDataHeaders(postData as Electron.UploadRawData[])
})
});
}
handleWindowLifecycleEvents({ embedder, frameName, guest: window, outlivesOpener });
embedder.emit('did-create-window', window, { url, frameName, options: browserWindowOptions, disposition, referrer, postData });
@@ -243,6 +256,15 @@ export function makeWebPreferences ({ embedder, secureOverrideWebPreferences = {
};
}
function formatPostDataHeaders (postData: PostData) {
if (!postData) return;
const { contentType, boundary } = parseContentTypeFormat(postData);
if (boundary != null) { return `content-type: ${contentType}; boundary=${boundary}`; }
return `content-type: ${contentType}`;
}
const MULTIPART_CONTENT_TYPE = 'multipart/form-data';
const URL_ENCODED_CONTENT_TYPE = 'application/x-www-form-urlencoded';

View File

@@ -1,9 +1,10 @@
{
"name": "electron",
"version": "19.0.0-nightly.20220329",
"version": "19.0.2",
"repository": "https://github.com/electron/electron",
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
"devDependencies": {
"@azure/storage-blob": "^12.9.0",
"@electron/docs-parser": "^0.12.4",
"@electron/typescript-definitions": "^8.9.5",
"@octokit/auth-app": "^2.10.0",
@@ -78,14 +79,14 @@
"generate-version-json": "node script/generate-version-json.js",
"lint": "node ./script/lint.js && npm run lint:clang-format && npm run lint:docs",
"lint:js": "node ./script/lint.js --js",
"lint:clang-format": "python script/run-clang-format.py -r -c shell/ || (echo \"\\nCode not formatted correctly.\" && exit 1)",
"lint:clang-format": "python3 script/run-clang-format.py -r -c shell/ || (echo \"\\nCode not formatted correctly.\" && exit 1)",
"lint:clang-tidy": "ts-node ./script/run-clang-tidy.ts",
"lint:cpp": "node ./script/lint.js --cc",
"lint:objc": "node ./script/lint.js --objc",
"lint:py": "node ./script/lint.js --py",
"lint:gn": "node ./script/lint.js --gn",
"lint:docs": "remark docs -qf && npm run lint:js-in-markdown && npm run create-typescript-definitions && npm run lint:docs-relative-links && npm run lint:markdownlint",
"lint:docs-relative-links": "python ./script/check-relative-doc-links.py",
"lint:docs-relative-links": "python3 ./script/check-relative-doc-links.py",
"lint:markdownlint": "markdownlint \"*.md\" \"docs/**/*.md\"",
"lint:js-in-markdown": "standard-markdown docs",
"create-api-json": "electron-docs-parser --dir=./",
@@ -116,14 +117,14 @@
"ts-node script/gen-filenames.ts"
],
"*.{cc,mm,c,h}": [
"python script/run-clang-format.py -r -c --fix"
"python3 script/run-clang-format.py -r -c --fix"
],
"*.md": [
"npm run lint:docs"
],
"*.{gn,gni}": [
"npm run gn-check",
"python script/run-gn-format.py"
"python3 script/run-gn-format.py"
],
"*.py": [
"node script/lint.js --py --fix --only --"

View File

@@ -66,7 +66,6 @@ feat_enable_offscreen_rendering_with_viz_compositor.patch
gpu_notify_when_dxdiag_request_fails.patch
feat_allow_embedders_to_add_observers_on_created_hunspell.patch
feat_add_onclose_to_messageport.patch
ui_gtk_public_header.patch
allow_in-process_windows_to_have_different_web_prefs.patch
refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
crash_allow_setting_more_options.patch
@@ -103,15 +102,19 @@ chore_do_not_use_chrome_windows_in_cryptotoken_webrequestsender.patch
process_singleton.patch
fix_expose_decrementcapturercount_in_web_contents_impl.patch
add_ui_scopedcliboardwriter_writeunsaferawdata.patch
feat_add_data_parameter_to_processsingleton.patch
mas_gate_private_enterprise_APIs.patch
load_v8_snapshot_in_browser_process.patch
fix_patch_out_permissions_checks_in_exclusive_access.patch
fix_adapt_exclusive_access_for_electron_needs.patch
fix_aspect_ratio_with_max_size.patch
fix_dont_delete_SerialPortManager_on_main_thread.patch
feat_add_data_transfer_to_requestsingleinstancelock.patch
fix_crash_when_saving_edited_pdf_files.patch
port_autofill_colors_to_the_color_pipeline.patch
build_disable_partition_alloc_on_mac.patch
fix_non-client_mouse_tracking_and_message_bubbling_on_windows.patch
build_make_libcxx_abi_unstable_false_for_electron.patch
introduce_ozoneplatform_electron_can_call_x11_property.patch
make_gtk_getlibgtk_public.patch
build_disable_print_content_analysis.patch
feat_move_firstpartysets_to_content_browser_client.patch
custom_protocols_plzserviceworker.patch

View File

@@ -10,10 +10,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
This should be upstreamed.
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 9f840287967b50ec1db3a9d27973429ab231a486..731a279e395a8762a25a115665bff99be428de3d 100644
index 660c5f35c6095b23cc483c8eb1c119c215dc681d..961c0d7f7a9fe5f9e130998aeb0c872c571b710e 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -239,6 +239,10 @@ int GpuMain(MainFunctionParams parameters) {
@@ -240,6 +240,10 @@ int GpuMain(MainFunctionParams parameters) {
// to the GpuProcessHost once the GpuServiceImpl has started.
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
@@ -24,7 +24,7 @@ index 9f840287967b50ec1db3a9d27973429ab231a486..731a279e395a8762a25a115665bff99b
// We are experiencing what appear to be memory-stomp issues in the GPU
// process. These issues seem to be impacting the task executor and listeners
// registered to it. Create the task executor on the heap to guard against
@@ -345,7 +349,6 @@ int GpuMain(MainFunctionParams parameters) {
@@ -346,7 +350,6 @@ int GpuMain(MainFunctionParams parameters) {
GpuProcess gpu_process(io_thread_priority);
#endif

View File

@@ -10,7 +10,7 @@ DidCreateScriptContext is called, not all JS APIs are available in the
context, which can cause some preload scripts to trip.
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
index 19c936be477f944d62e85cec81359a71bbcfa45d..b02bb1cd67488f996b6142058c52c34dfe523fff 100644
index eb6f4c87c4479d5f4fb8e3f85a231fb9cc744a63..11298b413021b4d438195482db253a93356b2862 100644
--- a/content/public/renderer/render_frame_observer.h
+++ b/content/public/renderer/render_frame_observer.h
@@ -132,6 +132,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
@@ -23,10 +23,10 @@ index 19c936be477f944d62e85cec81359a71bbcfa45d..b02bb1cd67488f996b6142058c52c34d
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index c9296960c76e34646bf7cb3195b80c0cbc483b58..bc8bdba3facba81c572d43b85881ec02ad7d2f00 100644
index f217de19126feeeafee01b2be31ced936696ce20..95966ce7f0eeb0a7f2822bef69b540ac6bfe298d 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4423,6 +4423,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4489,6 +4489,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@@ -40,10 +40,10 @@ index c9296960c76e34646bf7cb3195b80c0cbc483b58..bc8bdba3facba81c572d43b85881ec02
int world_id) {
for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 7be2fd1e02917537805a271f16f5f248f1c4fc45..ce0fc928448b597fb6401b77730700407ce406da 100644
index d8ffccc148622d4eb0388e03c78ff1def4290701..5a3162cc88e5a48b04fbbb74a5c2ba4b7dd8a5d3 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -595,6 +595,8 @@ class CONTENT_EXPORT RenderFrameImpl
@@ -599,6 +599,8 @@ class CONTENT_EXPORT RenderFrameImpl
uint32_t ng_call_count) override;
void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override;
@@ -67,10 +67,10 @@ index 5adee94f81c0e98db976ac1c6c55fb5eab8c2e65..9d3e43f4394ad9a4377b47a001c4baf4
virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
index aa4b510137d60e6fb924f4f1a6554fe06c19ad75..816b6260020a6cbb6880b0eed197743ccd9002f5 100644
index a6ba8411384855c82712960375bc949c5c2bd522..fc86ca807c9c1bda9236160580b094153778e18b 100644
--- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
+++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
@@ -205,6 +205,7 @@ void LocalWindowProxy::Initialize() {
@@ -207,6 +207,7 @@ void LocalWindowProxy::Initialize() {
}
InstallConditionalFeatures();
@@ -79,10 +79,10 @@ index aa4b510137d60e6fb924f4f1a6554fe06c19ad75..816b6260020a6cbb6880b0eed197743c
if (World().IsMainWorld()) {
GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
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 bca4cbb2b2ba84fe58b5cfeaf190add5803e27c9..b6c9dd3a2a1c9b6667c563d5da86ccb4871ae81f 100644
index f36d04ff77481bd30e0de3f6d45c54dfece4067c..d30f569cd68716b9e963cf0fb5da3f7e65cc215a 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -301,6 +301,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
@@ -303,6 +303,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) = 0;
@@ -92,7 +92,7 @@ index bca4cbb2b2ba84fe58b5cfeaf190add5803e27c9..b6c9dd3a2a1c9b6667c563d5da86ccb4
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 e06c96c068139e829af7bd99ebb111507b2bddb0..a98bc22fc5c96ad1fd2071ea1c9e1aab2fb4d5ff 100644
index 5a83dcdf50acc27da2b1fbb3e515cb4316305a3a..86f31acc40a2dd296c34f3ecf5ef6ccd97cbc18c 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
@@ -275,6 +275,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -110,10 +110,10 @@ index e06c96c068139e829af7bd99ebb111507b2bddb0..a98bc22fc5c96ad1fd2071ea1c9e1aab
v8::Local<v8::Context> 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 6658e44e65f8236927f283e3f65f007ae97ac81f..f384dcc4efd6c56c3e3e212c7e597f13bc9dae57 100644
index ac81fdc1ac99ca02458a10c0d258b846a8a9955e..ed838db2474790437ff4b57e23a1e289afce4d47 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
@@ -79,6 +79,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
@@ -80,6 +80,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override;
@@ -123,10 +123,10 @@ index 6658e44e65f8236927f283e3f65f007ae97ac81f..f384dcc4efd6c56c3e3e212c7e597f13
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 8087d1f62e9b1a8ac33a9e92c10a7cb8b8363e08..845c3329674d99dd385316dbfd1287fa3566a60e 100644
index aab6a77b18f83adeac065083f83b94b7ff251282..0d0e272a162be8d1bee9e0122e3e7a59b0ad32a3 100644
--- a/third_party/blink/renderer/core/loader/empty_clients.h
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -357,6 +357,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
@@ -359,6 +359,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override {}

View File

@@ -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 84044606fb0644b2b6053c72a9750bae3729f666..995c5dfc49a392669f73d85a92fbdb54cf0e11ca 100644
index a9267b633e126f057e914b895f280ed658ff279d..179b5449f53c2d7b9024fb08fe1b1f6c03c6d5b0 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -649,6 +649,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -665,6 +665,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
}
@@ -22,11 +22,11 @@ index 84044606fb0644b2b6053c72a9750bae3729f666..995c5dfc49a392669f73d85a92fbdb54
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 a099eed10dd061994bff696519099c3ef7437a46..a1f1e9b55272e70b4acd5d1f1515fba7d91538fa 100644
index 3f0df3df3dd74ced71869ce01abf7b159387b8f4..85b169530a21bcfc016d1439a71d35378077774d 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -137,6 +137,7 @@ class CONTENT_EXPORT RenderViewHostImpl
bool IsRenderViewLive() const override;
bool IsRenderViewLiveForTesting() const override;
void WriteIntoTrace(perfetto::TracedProto<TraceProto> context) const override;
+ void SetSchedulerThrottling(bool allowed) override;
@@ -34,7 +34,7 @@ index a099eed10dd061994bff696519099c3ef7437a46..a1f1e9b55272e70b4acd5d1f1515fba7
void SendRendererPreferencesToRenderer(
const blink::RendererPreferences& preferences);
diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h
index a6fe708878eb9afba9a68e0be71ba2c0b2a84d7d..5cc81ceb44d0a8baee3ebcc63aa4137b1e9ef08e 100644
index 3b01b3419c4361d5d75ad1c37e5baa3a1967bd09..35c82d931242a1180091267c18e0255840acc5ce 100644
--- a/content/public/browser/render_view_host.h
+++ b/content/public/browser/render_view_host.h
@@ -80,6 +80,9 @@ class CONTENT_EXPORT RenderViewHost {
@@ -48,10 +48,10 @@ index a6fe708878eb9afba9a68e0be71ba2c0b2a84d7d..5cc81ceb44d0a8baee3ebcc63aa4137b
// This interface should only be implemented inside content.
friend class RenderViewHostImpl;
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 4e8d36420d6edc1725a840e1b9f123041d21abe4..dd198cb7bf02e509833c6b4c7d8e5d65d20d46dc 100644
index fd145f0aa562d6b63fb1d3a8a9241ae1aa1ce7a0..54d30fb9db8b48b94abdb815c487f618f9bb6525 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -152,6 +152,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
@@ -151,6 +151,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
static WindowOpenDisposition NavigationPolicyToDisposition(
blink::WebNavigationPolicy policy);
@@ -61,10 +61,10 @@ index 4e8d36420d6edc1725a840e1b9f123041d21abe4..dd198cb7bf02e509833c6b4c7d8e5d65
// ADDING NEW FUNCTIONS? Please keep private functions alphabetized and put
// it in the same order in the .cc file as it was in the header.
diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom
index befd736a9cf362514b9a2ee475dc4a814c85a87b..24b2617f56673a3075697802cf5b574b0c766610 100644
index 39bfc2200e924d0c589cfd07f085f182ef6853a6..bddff6d5ad3f6d08c4dc48e66ebc5319b1a5ec28 100644
--- a/third_party/blink/public/mojom/page/page.mojom
+++ b/third_party/blink/public/mojom/page/page.mojom
@@ -97,4 +97,7 @@ interface PageBroadcast {
@@ -108,4 +108,7 @@ interface PageBroadcast {
// Sent to whole page, but should only be used by the main frame.
SetPageBaseBackgroundColor(skia.mojom.SkColor? color);
@@ -73,10 +73,10 @@ index befd736a9cf362514b9a2ee475dc4a814c85a87b..24b2617f56673a3075697802cf5b574b
+ SetSchedulerThrottling(bool allowed);
};
diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
index 560b72dfbc70172bc668229b29fe0c9da139f320..13ec73b9d627259625d64f5b97838033db89745c 100644
index 5e4032ccf916f969cd669af7d983becddb57c72b..a858c9f2fa609ae756a2e70d0362f2de372dd5be 100644
--- a/third_party/blink/public/web/web_view.h
+++ b/third_party/blink/public/web/web_view.h
@@ -369,6 +369,7 @@ class WebView {
@@ -364,6 +364,7 @@ class WebView {
// Scheduling -----------------------------------------------------------
virtual PageScheduler* Scheduler() const = 0;
@@ -85,10 +85,10 @@ index 560b72dfbc70172bc668229b29fe0c9da139f320..13ec73b9d627259625d64f5b97838033
// 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 daab024ee0e2010e177eabeb7e0fb964c631dd17..06d8ca44fb1dc3748d81b5c5a407dfdf7183f845 100644
index 6504c73f614bebad7b899c8b76c4b3034b7dab7a..f76a0ee0778d7b4e4df69a4c43b4a6bfdc89294d 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -3666,6 +3666,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -3689,6 +3689,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@@ -102,7 +102,7 @@ index daab024ee0e2010e177eabeb7e0fb964c631dd17..06d8ca44fb1dc3748d81b5c5a407dfdf
void WebViewImpl::SetVisibilityState(
mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) {
@@ -3677,7 +3684,8 @@ void WebViewImpl::SetVisibilityState(
@@ -3700,7 +3707,8 @@ void WebViewImpl::SetVisibilityState(
}
GetPage()->SetVisibilityState(visibility_state, is_initial_state);
GetPage()->GetPageScheduler()->SetPageVisible(
@@ -113,7 +113,7 @@ index daab024ee0e2010e177eabeb7e0fb964c631dd17..06d8ca44fb1dc3748d81b5c5a407dfdf
mojom::blink::PageVisibilityState WebViewImpl::GetVisibilityState() {
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 5107ef421138e136b20b25b7bbcc1f0bb246bb66..043266205142e59f88c4c2f2ae6b58bb009f2d9c 100644
index 5c9609a6a8d1e18981ac14ad5321fa82c3eb38e0..0a2564a8e45210ba58438e95caa70d01fac22aee 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -420,6 +420,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -124,7 +124,7 @@ index 5107ef421138e136b20b25b7bbcc1f0bb246bb66..043266205142e59f88c4c2f2ae6b58bb
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) override;
mojom::blink::PageVisibilityState GetVisibilityState() override;
@@ -857,6 +858,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -855,6 +856,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// If true, we send IPC messages when |preferred_size_| changes.
bool send_preferred_size_changes_ = false;

View File

@@ -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 effc18673a7f832352f427c9f4fb8b276fc28ad6..96b67b56002f88e0f4e2af9997aa6a78a1accd96 100644
index 4e51622d725ad0ee448ea1794c209aae7f78e09a..df6e9ed6fda9e6fa695fa3ab717847735dc63b17 100644
--- a/third_party/blink/common/web_preferences/web_preferences.cc
+++ b/third_party/blink/common/web_preferences/web_preferences.cc
@@ -144,6 +144,20 @@ WebPreferences::WebPreferences()
@@ -140,6 +140,20 @@ WebPreferences::WebPreferences()
fake_no_alloc_direct_call_for_testing_enabled(false),
v8_cache_options(blink::mojom::V8CacheOptions::kDefault),
record_whole_document(false),
@@ -33,7 +33,7 @@ index effc18673a7f832352f427c9f4fb8b276fc28ad6..96b67b56002f88e0f4e2af9997aa6a78
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 a62792e0d484dc133f1df34a2c67dde838db203c..ef77424fc6778b047ac98700a5e18a3b6b161aba 100644
index 16e7501cf2da98d0046d65102e634af31c1f6c39..53fbfdb4837fe444c3564523068faadcc12afd1a 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
@@ -22,6 +22,10 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
@@ -47,7 +47,7 @@ index a62792e0d484dc133f1df34a2c67dde838db203c..ef77424fc6778b047ac98700a5e18a3b
!data.ReadLazyFrameLoadingDistanceThresholdsPx(
&out->lazy_frame_loading_distance_thresholds_px) ||
!data.ReadLazyImageLoadingDistanceThresholdsPx(
@@ -150,6 +154,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
@@ -145,6 +149,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
data.fake_no_alloc_direct_call_for_testing_enabled();
out->v8_cache_options = data.v8_cache_options();
out->record_whole_document = data.record_whole_document();
@@ -68,7 +68,7 @@ index a62792e0d484dc133f1df34a2c67dde838db203c..ef77424fc6778b047ac98700a5e18a3b
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 27d0bcc02a57b1a8f8f8e25df7af383d0e9a8c00..1cb920f4d0b01df012bc9b60eb3d9caa555d4e9e 100644
index b2b3be2019209d3810bb0dc570e2a1ebcf702ad8..0ff23de6bd73d6d0ba82402ec39d2f0812c41aab 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 @@
@@ -79,7 +79,7 @@ index 27d0bcc02a57b1a8f8f8e25df7af383d0e9a8c00..1cb920f4d0b01df012bc9b60eb3d9caa
#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"
@@ -159,6 +160,22 @@ struct BLINK_COMMON_EXPORT WebPreferences {
@@ -152,6 +153,22 @@ struct BLINK_COMMON_EXPORT WebPreferences {
blink::mojom::V8CacheOptions v8_cache_options;
bool record_whole_document;
@@ -103,7 +103,7 @@ index 27d0bcc02a57b1a8f8f8e25df7af383d0e9a8c00..1cb920f4d0b01df012bc9b60eb3d9caa
// only controls whether or not the "document.cookie" field is properly
// connected to the backing store, for instance if you wanted to be able to
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 0f5ed102b071001acc566b258946b359d33f5d45..aac80b973e4622d2207b92fcd2537342a60c6909 100644
index 30fd01c6e804d05091ff6147ac570901a8d998b9..4acd2df36ab6928947b5defe8691eccaf3cd7b19 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 @@
@@ -114,7 +114,7 @@ index 0f5ed102b071001acc566b258946b359d33f5d45..aac80b973e4622d2207b92fcd2537342
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "net/nqe/effective_connection_type.h"
#include "third_party/blink/public/common/common_export.h"
@@ -436,6 +437,60 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
@@ -418,6 +419,60 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
return r.record_whole_document;
}
@@ -176,7 +176,7 @@ index 0f5ed102b071001acc566b258946b359d33f5d45..aac80b973e4622d2207b92fcd2537342
return r.cookie_enabled;
}
diff --git a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
index 4feef4089d59cef252ba73f49d4e490875f657ff..db92219655b824ca630edb6afe85d85e017a4a06 100644
index d10d1b4c0b16ac9e863077cf60feca35fa2da329..1a49fb1a11f75aa3c79cd3cc1796957d0b9a5549 100644
--- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
+++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
@@ -10,6 +10,7 @@ import "third_party/blink/public/mojom/v8_cache_options.mojom";
@@ -187,7 +187,7 @@ index 4feef4089d59cef252ba73f49d4e490875f657ff..db92219655b824ca630edb6afe85d85e
enum PointerType {
kPointerNone = 1, // 1 << 0
@@ -211,6 +212,22 @@ struct WebPreferences {
@@ -204,6 +205,22 @@ struct WebPreferences {
V8CacheOptions v8_cache_options;
bool record_whole_document;

View File

@@ -6,7 +6,7 @@ Subject: Allow setting secondary label via SimpleMenuModel
Builds on https://chromium-review.googlesource.com/c/chromium/src/+/2208976
diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
index 746dffb1defec9d776f681d41325a65b02cbdd0f..05a7f20f10e3ff514aa3b3b5386980ddfcc586eb 100644
index a787411f89e2d95e2fa636a7cc6723bdd227e563..f8c67d10957c26fbcd21fa1fe05507efd78f1c29 100644
--- a/ui/base/models/simple_menu_model.cc
+++ b/ui/base/models/simple_menu_model.cc
@@ -53,6 +53,11 @@ std::u16string SimpleMenuModel::Delegate::GetLabelForCommandId(

View File

@@ -15,10 +15,10 @@ Refs changes in:
This patch reverts the changes to fix associated crashes in Electron.
diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc
index da12f2f47f97628f1adeabc8900ffd16132afd7e..61d373f78520a063c7f86bde6869af9d26f32d11 100644
index a519c49a01987feab4dadbc4ba48b73e943fa404..c8d2a65cb428e85c33675668cc106f0af124dfee 100644
--- a/third_party/blink/renderer/core/frame/frame.cc
+++ b/third_party/blink/renderer/core/frame/frame.cc
@@ -122,14 +122,6 @@ bool Frame::Detach(FrameDetachType type) {
@@ -123,14 +123,6 @@ bool Frame::Detach(FrameDetachType type) {
DCHECK(!IsDetached());
@@ -33,7 +33,7 @@ index da12f2f47f97628f1adeabc8900ffd16132afd7e..61d373f78520a063c7f86bde6869af9d
if (type == FrameDetachType::kRemove) {
if (provisional_frame_) {
provisional_frame_->Detach(FrameDetachType::kRemove);
@@ -153,6 +145,14 @@ bool Frame::Detach(FrameDetachType type) {
@@ -154,6 +146,14 @@ bool Frame::Detach(FrameDetachType type) {
GetWindowProxyManager()->ClearForSwap();
}
@@ -49,10 +49,10 @@ index da12f2f47f97628f1adeabc8900ffd16132afd7e..61d373f78520a063c7f86bde6869af9d
// 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 1efaff0e92061bc97dcbf3105f6b6c1dcefff17c..ec2e19c3ccf60f01b73259e1e6eff405ebf15f07 100644
index 3efc0a04ae3fa60dce4aeb9a296c8dd1bb43320a..5dac7c18f39abefcc318ba2a7b8fad449189d0b6 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -545,10 +545,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -543,10 +543,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
}
DCHECK(!view_ || !view_->IsAttached());
@@ -63,7 +63,7 @@ index 1efaff0e92061bc97dcbf3105f6b6c1dcefff17c..ec2e19c3ccf60f01b73259e1e6eff405
if (!Client())
return false;
@@ -594,6 +590,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -592,6 +588,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
DCHECK(!view_->IsAttached());
Client()->WillBeDetached();

View File

@@ -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 083a46a96bf969a075ef05cfe4837c4cce784191..22f18293e65035cc3b9af322520b102eb6b24a76 100644
index 0736e7021761e6019e1b52448d21ffdb73b964fc..571b553e9aaa98739851d0ff312eefe9f6a75596 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -80,6 +80,7 @@

View File

@@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: VerteDinde <vertedinde@electronjs.org>
Date: Sun, 1 May 2022 18:01:42 -0700
Subject: build: disable print_content_analysis
Print Content Analysis enables enterprise users to scan to-be-printed
pages and documents for sensitive data if the OnPrintEnterpriseConnector
policy is enabled. A conversation with the Chromium team confirmed
this feature was intended for enterprise Chrome users and not embedders,
so we're disabling it to prevent build issues/additional unneeded files.
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 559ac76d4e4b9d9c1824c4da186a6b0f7619fcca..72855e0c5fadb286b67144b34ff71f45e1434c73 100644
--- a/printing/buildflags/buildflags.gni
+++ b/printing/buildflags/buildflags.gni
@@ -36,8 +36,7 @@ declare_args() {
# Enable snapshotting a page when printing for its content to be analyzed for
# sensitive content by enterprise users.
- enable_print_content_analysis =
- is_chromeos_ash || is_chromeos_lacros || is_win || is_linux || is_mac
+ enable_print_content_analysis = is_chromeos_ash || is_chromeos_lacros
}
declare_args() {

View File

@@ -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 a6e0a53d4ebbd585114bc0cda2e2d1caaab4a015..95a7e70eee0303471702b81c68f46a0fea2b6f0e 100644
index 3c40d999a9545051e91a9f0ad3bf7ca2a95d80c4..b5a20be5e22238e7e1969bdaf52c0b05e84bb846 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -171,11 +171,16 @@ if (!is_android && !is_mac) {
@@ -33,10 +33,10 @@ index a6e0a53d4ebbd585114bc0cda2e2d1caaab4a015..95a7e70eee0303471702b81c68f46a0f
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 5bbb64d83e2024feeb7a2eae45f6b8e937fc927c..20004fb890e726d11dc672894cdba4645b0a3606 100644
index 948d05358b89895faa97a7d383bfac66a45464a8..43859d267010103daf80525a5af0f312a577411c 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4508,7 +4508,7 @@ static_library("browser") {
@@ -4560,7 +4560,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 5bbb64d83e2024feeb7a2eae45f6b8e937fc927c..20004fb890e726d11dc672894cdba464
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 3d7606b8d7d5f1ec61c9c00be0cc530967985e4b..044b52e00d8b334e90a9f1126b5bc3df916a1af3 100644
index 641f52eb7952858738a6623b480f767261e5d009..6d0c624ea62a9125ef7e5579da197de2327a12ff 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -5907,7 +5907,6 @@ test("unit_tests") {
@@ -6002,7 +6002,6 @@ test("unit_tests") {
deps += [
"//chrome:other_version",
@@ -57,7 +57,7 @@ index 3d7606b8d7d5f1ec61c9c00be0cc530967985e4b..044b52e00d8b334e90a9f1126b5bc3df
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/browser:chrome_process_finder",
@@ -5930,6 +5929,10 @@ test("unit_tests") {
@@ -6025,6 +6024,10 @@ test("unit_tests") {
"//ui/resources",
]
@@ -68,7 +68,7 @@ index 3d7606b8d7d5f1ec61c9c00be0cc530967985e4b..044b52e00d8b334e90a9f1126b5bc3df
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -6619,7 +6622,6 @@ test("unit_tests") {
@@ -6712,7 +6715,6 @@ test("unit_tests") {
}
deps += [
@@ -76,10 +76,10 @@ index 3d7606b8d7d5f1ec61c9c00be0cc530967985e4b..044b52e00d8b334e90a9f1126b5bc3df
"//chrome/browser:cart_db_content_proto",
"//chrome/browser:coupon_db_content_proto",
"//chrome/browser/media/router:test_support",
@@ -6664,6 +6666,11 @@ test("unit_tests") {
"//ui/native_theme:test_support",
"//ui/webui/resources/js/browser_command:mojo_bindings",
]
@@ -6760,6 +6762,11 @@ test("unit_tests") {
if (is_chromeos) {
deps += [ "//ui/chromeos" ]
}
+
+ if (!is_electron_build) {
+ deps += [ "//chrome:packed_resources_integrity_hash" ]

View File

@@ -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 dec348e235b1306cec50e0602fb910f21eaed925..0545e0ce5490df51088ca7a4cacd968e69fa0d09 100644
index a53cc9066a3485ff6829e3c410eb523de7d074d6..9697e2dc2d0892fc7f1007d62488c2f2f24ec92f 100644
--- a/buildtools/third_party/libc++/BUILD.gn
+++ b/buildtools/third_party/libc++/BUILD.gn
@@ -44,7 +44,11 @@ config("winver") {
@@ -30,7 +30,7 @@ index dec348e235b1306cec50e0602fb910f21eaed925..0545e0ce5490df51088ca7a4cacd968e
+ "//electron:libcxx_objects_zip",
"//third_party/catapult/devil:devil",
]
if (is_linux && !is_chromeos) {
if (is_linux) {
diff --git a/buildtools/third_party/libc++abi/BUILD.gn b/buildtools/third_party/libc++abi/BUILD.gn
index 40f1285f14c0843405e0ee51879b8742285a006d..5be895d3e36df53a5960006a1513f1322400fd23 100644
--- a/buildtools/third_party/libc++abi/BUILD.gn

View File

@@ -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 dc75ab59ff7af972c950a9be682ebd9cddce2627..a969bbaaecb4b589808413d40299b68f3bc1fd3e 100644
index ec886101b6e5347bdd832684a5c3b2cc3179c657..0287e414f4020147ddee297f7c1447c32a118905 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -6880,6 +6880,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -6943,6 +6943,7 @@ void RenderFrameHostImpl::CreateNewWindow(
last_committed_origin_, params->window_container_type,
params->target_url, params->referrer.To<Referrer>(),
params->frame_name, params->disposition, *params->features,
@@ -21,10 +21,10 @@ index dc75ab59ff7af972c950a9be682ebd9cddce2627..a969bbaaecb4b589808413d40299b68f
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 2afbf96abef912bf483d08f6c011aa4a2e515e25..92dcf2308842ce8922426b0cafdd5a3e83f4bd52 100644
index 335e70179a03ee379082525bb4c7d596983bd633..faa795be3a6cbc7ae13d9a42a1bdbd01ac0406a9 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3931,6 +3931,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -3947,6 +3947,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
}
auto* new_contents_impl = new_contents.get();
@@ -39,7 +39,7 @@ index 2afbf96abef912bf483d08f6c011aa4a2e515e25..92dcf2308842ce8922426b0cafdd5a3e
new_contents_impl->GetController().SetSessionStorageNamespace(
partition_config, session_storage_namespace);
@@ -3975,12 +3983,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -3991,12 +3999,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -53,10 +53,10 @@ index 2afbf96abef912bf483d08f6c011aa4a2e515e25..92dcf2308842ce8922426b0cafdd5a3e
new_contents_impl, opener, params.target_url,
params.referrer.To<Referrer>(), params.disposition,
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index afc0dc34e4a1f6c06e96d7fa09922e8aaf4bab28..f3d13fc719324e064f70077deb5d95cb9e467820 100644
index a7f36529608011013dab96a803ad3187c940fc81..2bbcea3efede2fda4ff2c5b270e1db0135c54290 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -550,6 +550,10 @@ struct CreateNewWindowParams {
@@ -569,6 +569,10 @@ struct CreateNewWindowParams {
// Governs how downloads are handled if `target_url` results in a download.
blink.mojom.NavigationDownloadPolicy download_policy;
@@ -68,10 +68,10 @@ index afc0dc34e4a1f6c06e96d7fa09922e8aaf4bab28..f3d13fc719324e064f70077deb5d95cb
// 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 d832c0c37554dafad0c44c78f6dc9233015b152f..654abc174a237a90225ad7be7f1180e929b9829b 100644
index ffa24d4b6779226ea3b94afdf176939ea7e42e34..16fb4946cb3ea2d097e8ed05bb340cc3f0782ed6 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -576,6 +576,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -579,6 +579,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -81,10 +81,10 @@ index d832c0c37554dafad0c44c78f6dc9233015b152f..654abc174a237a90225ad7be7f1180e9
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 e142bc65c2a0fe06a1cf59621c424170dc2d641c..8573ea54135e363f83bd786db3483d1c539e4bb1 100644
index ae3dda4b9b40bb0d4c1a10eaedda9270d3543a8b..9b988bb631ab759739ae01c918efb1d563d5aafc 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -169,6 +169,7 @@ class NetworkService;
@@ -165,6 +165,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@@ -92,7 +92,7 @@ index e142bc65c2a0fe06a1cf59621c424170dc2d641c..8573ea54135e363f83bd786db3483d1c
} // namespace network
namespace sandbox {
@@ -958,6 +959,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -954,6 +955,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -102,7 +102,7 @@ index e142bc65c2a0fe06a1cf59621c424170dc2d641c..8573ea54135e363f83bd786db3483d1c
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 f132199113778f6b50972419b61a187e6272300c..7bb1680553c405a9016cfd67eca5fa3c6439b692 100644
index 9bbc7cf6d9542a3f013313e0c497839da2beb9d1..c01e06b08b1cca7a663e30476a551904ce9c6db8 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -26,6 +26,17 @@ namespace content {
@@ -124,7 +124,7 @@ index f132199113778f6b50972419b61a187e6272300c..7bb1680553c405a9016cfd67eca5fa3c
const OpenURLParams& params) {
return nullptr;
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 9c70cc90402dd1541b2b58b3be2fa7ff215f8f57..a998c64237a7ffd6583a33cd54fe3229196300a6 100644
index 04aa4d993b331396ee20464f6e1d2da10c91c834..2556c044b6e28501a5fac9b0040e623b8f35f497 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -16,6 +16,7 @@
@@ -135,7 +135,7 @@ index 9c70cc90402dd1541b2b58b3be2fa7ff215f8f57..a998c64237a7ffd6583a33cd54fe3229
#include "content/public/browser/eye_dropper.h"
#include "content/public/browser/invalidate_type.h"
#include "content/public/browser/media_stream_request.h"
@@ -339,6 +340,13 @@ class CONTENT_EXPORT WebContentsDelegate {
@@ -338,6 +339,13 @@ class CONTENT_EXPORT WebContentsDelegate {
const StoragePartitionConfig& partition_config,
SessionStorageNamespace* session_storage_namespace);
@@ -150,10 +150,10 @@ index 9c70cc90402dd1541b2b58b3be2fa7ff215f8f57..a998c64237a7ffd6583a33cd54fe3229
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 9bdeb8745b3dd6d329f0403ca8c4a6f5de1d59c6..11815bca2741002dd8595af026ef402bc2af999e 100644
index 89b07508aef80680a847c106fea0e2fa58ff964b..6630af3583a6bac6135d46644280d6444fe981b8 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -32,6 +32,7 @@
@@ -33,6 +33,7 @@
#include "third_party/blink/public/platform/impression_conversions.h"
#include "third_party/blink/public/platform/modules/video_capture/web_video_capture_impl_manager.h"
#include "third_party/blink/public/platform/url_conversion.h"
@@ -161,7 +161,7 @@ index 9bdeb8745b3dd6d329f0403ca8c4a6f5de1d59c6..11815bca2741002dd8595af026ef402b
#include "third_party/blink/public/web/modules/mediastream/web_media_stream_device_observer.h"
#include "third_party/blink/public/web/web_frame_widget.h"
#include "third_party/blink/public/web/web_local_frame.h"
@@ -291,6 +292,10 @@ WebView* RenderViewImpl::CreateView(
@@ -295,6 +296,10 @@ WebView* RenderViewImpl::CreateView(
params->impression = blink::ConvertWebImpressionToImpression(*impression);
}
@@ -220,14 +220,14 @@ index 84d32491a56528a84b4395fba1d54cdbb38d522b..09998a83c449ef8cd9f360fbcdcf7edc
} // 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 c18012a217bfc492ac2cdef5776bb23099df57ae..b96bd45cfee98c8177b3ac5979273d1f9ba47388 100644
index 2e2ba228a7f179b7cf9c43434bd20ca20b1f1af6..de9f95426ad2dcc99bc4961a0e57539d287408e4 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2069,6 +2069,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
@@ -2074,6 +2074,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, incumbent_window);
+ window_features.raw_features = features;
FrameLoadRequest frame_request(incumbent_window,
ResourceRequest(completed_url));
// In fenced frames, we should always use `noopener`.
if (GetFrame()->IsInFencedFrameTree()) {

View File

@@ -9,10 +9,10 @@ we're running with contextIsolation enabled, we should be falling back
to Blink's logic. This will be upstreamed in some form.
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 5040ec838c64ffa8aa58ba43f51df649443b2f81..7a7a87d00fa392b7bd07267d9059664d5d472252 100644
index 90d3a635eec331130b738d0839cc9fdfa60ce451..9eb900ff4449f277f8c5ab3ccc29b0aa725be356 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -446,8 +446,9 @@ CodeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> context,
@@ -448,8 +448,9 @@ CodeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> context,
return {true, std::move(stringified_source)};
}

View File

@@ -63,10 +63,10 @@ index faa684c429e8cd5817c043db48dcbea33c6c8782..8b5991bc8279585cc0749f6816aa8a03
content::RenderFrameHost* requesting_frame,
const blink::mojom::FullscreenOptions& options) final;
diff --git a/chrome/browser/ui/ash/ash_web_view_impl.cc b/chrome/browser/ui/ash/ash_web_view_impl.cc
index 593cbe8038789e3b071ec9f5c243be6f0be629f0..18e5ade28bb966b35a6f69b2543768ac482d4730 100644
index 46e5ec4d834e9478db523a5a078218104c161a57..e584921a6d575740fc0331a8bac05904558efc15 100644
--- a/chrome/browser/ui/ash/ash_web_view_impl.cc
+++ b/chrome/browser/ui/ash/ash_web_view_impl.cc
@@ -79,10 +79,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
@@ -83,10 +83,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -80,10 +80,10 @@ index 593cbe8038789e3b071ec9f5c243be6f0be629f0..18e5ade28bb966b35a6f69b2543768ac
/*from_user_gesture=*/true);
return true;
diff --git a/chrome/browser/ui/ash/ash_web_view_impl.h b/chrome/browser/ui/ash/ash_web_view_impl.h
index e1adc822d8086b6c1b103a107923247cbb0aa7f2..2d2d65fa78d8fdccbe44aa1bf9b297e7038781c5 100644
index f0333177f885000fb22818ffa30a0c4ad520a161..03e82957f9d7bf009dcbf5fcd43718c9d2ac9bb8 100644
--- a/chrome/browser/ui/ash/ash_web_view_impl.h
+++ b/chrome/browser/ui/ash/ash_web_view_impl.h
@@ -46,8 +46,7 @@ class AshWebViewImpl : public ash::AshWebView,
@@ -47,8 +47,7 @@ class AshWebViewImpl : public ash::AshWebView,
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -108,10 +108,10 @@ index 6688ba8ba2fb7d930773144cdbc43f1f6fa2b685..22015c7b9b50e1264551ce226757f90e
}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index ace0c593debb46c9238e5708634fc6088a1bc715..31d5c0f00ae43706f16fc8615761e96eab31f1f3 100644
index 7548e63c57dc8463cb59614122e32c574ae17437..a9e1c335e3fae4fa795059c9b28bd5d404184c2e 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1770,12 +1770,11 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -1786,12 +1786,11 @@ bool Browser::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -183,7 +183,7 @@ index ed23267cd9f28f4e02d8374177f0bb697547cc2a..a979719f75ab4c9b49775ec3df5eff13
}
content::WebContents* CreateCustomWebContents(
diff --git a/components/embedder_support/android/delegate/web_contents_delegate_android.cc b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
index 1911b0558fad1d5834befa98e57a978e6e0b72da..cb85515f79617a32e2809ad6eb7f55e4ecc36b3f 100644
index 1a6bbeea689901e23717d660e67f8d1abb21f799..85f7b42e7aadce3abcae9f9596403f9856771993 100644
--- a/components/embedder_support/android/delegate/web_contents_delegate_android.cc
+++ b/components/embedder_support/android/delegate/web_contents_delegate_android.cc
@@ -170,14 +170,13 @@ bool WebContentsDelegateAndroid::IsWebContentsCreationOverridden(
@@ -246,10 +246,10 @@ index c6bd5c19f8a7ceec17c9e32af5296a9617f3a619..02199b439fba7fdc617b7f7980d958b7
void AddNewContents(content::WebContents* source,
std::unique_ptr<content::WebContents> new_contents,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index d69e028b34ab4407abcdea3ece93db39926c587e..a82b571fdabe90771bc8f8ed4ae40df3085592c7 100644
index add5ba98f4409460b93aa2f8c49eb49a1f59470a..4b77c71375a7375e168c9bee93a73c3af6fe1252 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3879,8 +3879,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -3895,8 +3895,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
source_site_instance, params.window_container_type,
@@ -260,7 +260,7 @@ index d69e028b34ab4407abcdea3ece93db39926c587e..a82b571fdabe90771bc8f8ed4ae40df3
static_cast<WebContentsImpl*>(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 7bb1680553c405a9016cfd67eca5fa3c6439b692..3aa2cca04340098859e1072eaa80a46a8e0463b1 100644
index c01e06b08b1cca7a663e30476a551904ce9c6db8..9f50a8721560f734270308776f2f37ad49a8cb91 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -134,8 +134,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
@@ -274,10 +274,10 @@ index 7bb1680553c405a9016cfd67eca5fa3c6439b692..3aa2cca04340098859e1072eaa80a46a
}
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index a998c64237a7ffd6583a33cd54fe3229196300a6..4f57227a9033f905be13bc5166d0324d495a6531 100644
index 2556c044b6e28501a5fac9b0040e623b8f35f497..4c6cd654551b2f5cfd59a5271a8d95a9e6862d3c 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -318,8 +318,7 @@ class CONTENT_EXPORT WebContentsDelegate {
@@ -317,8 +317,7 @@ class CONTENT_EXPORT WebContentsDelegate {
SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -316,7 +316,7 @@ index 7350382146178f58960a9bf68cd959076d2d9790..a70a94d14bdfa993feab60b8e4f32e10
content::RenderFrameHost* opener,
content::SiteInstance* source_site_instance,
diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 56b6d5d28fe21a2bea723060ad48ee0134e814a2..a3da9c86c0018e7f4810feb73ca32896cd6ce93c 100644
index b652f1f30ce7043a0c8434d05a3b1da653aee1fc..259c62c60f302abebf167709b4a1c68ad5607129 100644
--- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -402,8 +402,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(

View File

@@ -7,10 +7,10 @@ spellchecker uses a few IDS_ resources. We need to load these from
Electrons grit header instead of Chromes
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 5f43b35aab6c2f277f0d021b378bee55f97572aa..5bbb64d83e2024feeb7a2eae45f6b8e937fc927c 100644
index af2fd82cbc458b396107a161d9c3dd31077e57a7..948d05358b89895faa97a7d383bfac66a45464a8 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -7126,6 +7126,7 @@ static_library("browser") {
@@ -7182,6 +7182,7 @@ static_library("browser") {
deps += [
"//components/spellcheck/browser",
"//components/spellcheck/common",

View File

@@ -0,0 +1,53 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Fri, 20 May 2022 00:29:34 +0900
Subject: custom_protocols_plzserviceworker.patch
Allow registering custom protocols to handle service worker main script fetching with PlzServiceWorker.
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 f827745b9800d4f11a17e405b0eb22601d7e4dd4..0cecbfb2a6fd3daa71338c94bda4b1f45eb51d5e 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -1591,6 +1591,28 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
loader_factory_bundle_info =
context()->loader_factory_bundle_for_update_check()->Clone();
+ // Give the embedder a chance to register custom schemes that can
+ // handle loading the service worker main script.
+ // Previous registration triggered by
+ // ServiceWorkerContextWrapper::CreateNonNetworkPendingURLLoaderFactoryBundleForUpdateCheck
+ // happens early on browser startup before the JS in the main process
+ // is run by the embedder.
+ auto* factory_bundle = static_cast<blink::PendingURLLoaderFactoryBundle*>(
+ loader_factory_bundle_info.get());
+ ContentBrowserClient::NonNetworkURLLoaderFactoryMap non_network_factories;
+ GetContentClient()
+ ->browser()
+ ->RegisterNonNetworkServiceWorkerUpdateURLLoaderFactories(
+ storage_partition_->browser_context(), &non_network_factories);
+ for (auto& pair : non_network_factories) {
+ const std::string& scheme = pair.first;
+ mojo::PendingRemote<network::mojom::URLLoaderFactory>& factory_remote =
+ pair.second;
+
+ factory_bundle->pending_scheme_specific_factories().emplace(
+ scheme, std::move(factory_remote));
+ }
+
if (base::FeatureList::IsEnabled(
features::kEnableServiceWorkersForChromeUntrusted) &&
scope.scheme_piece() == kChromeUIUntrustedScheme) {
@@ -1611,9 +1633,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
browser_context(), scope_origin)) {
config->RegisterURLDataSource(browser_context());
- static_cast<blink::PendingURLLoaderFactoryBundle*>(
- loader_factory_bundle_info.get())
- ->pending_scheme_specific_factories()
+ factory_bundle->pending_scheme_specific_factories()
.emplace(kChromeUIUntrustedScheme,
CreateWebUIServiceWorkerLoaderFactory(
browser_context(), kChromeUIUntrustedScheme,

View File

@@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the
failing checks and allow the rest of the target to have them enabled.
diff --git a/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc b/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc
index 7a6503d4a4ad33290d97078336c18d81839a8675..0f162b8e681ebb67c5f3b23a40fe3b6ec97cec49 100644
index ab0afb79514e42acb87e94809ed4a2b7c736a825..23fb303820860a030643d6d5a1a449823bb146e8 100644
--- a/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc
+++ b/third_party/blink/renderer/core/mobile_metrics/mobile_friendliness_checker.cc
@@ -506,8 +506,7 @@ void MobileFriendlinessChecker::NotifyInvalidatePaint(
@@ -515,8 +515,7 @@ void MobileFriendlinessChecker::NotifyInvalidatePaint(
->GetPageScaleConstraintsSet()
.FinalConstraints()
.initial_scale;

View File

@@ -41,10 +41,10 @@ index ac1e7854dc9ae629a499fac7626ec456e18c7867..087da9bbfb9081b94ca8ea8d245871dc
int DesktopMediaListBase::GetSourceCount() const {
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.h b/chrome/browser/media/webrtc/desktop_media_list_base.h
index 9c77a2d5872cc340b7a237b896afea1dd3be2503..d06869ff78ec0d48e97c3aeb7ac86d4aa9d9b1ba 100644
index 1150cf5fd95cb19d926a9af6d65472b680f53859..0fc3455f4966dd2047329adc308526dadcc64f1b 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.h
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.h
@@ -38,7 +38,7 @@ class DesktopMediaListBase : public DesktopMediaList {
@@ -39,7 +39,7 @@ class DesktopMediaListBase : public DesktopMediaList {
void SetThumbnailSize(const gfx::Size& thumbnail_size) override;
void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override;
void StartUpdating(DesktopMediaListObserver* observer) override;

View File

@@ -15,7 +15,7 @@ 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 bb79a55d46730a4a127ee6483a7a25ecdc2aea5b..b14fa0f41166a904991ec920cec2f45c3b71c953 100644
index 2b69f4767e9073ea5f12acddf842c7f1dc82e2c1..a2f053c3e2588451458682aa6e86da52a591e1e7 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -308,6 +308,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;

View File

@@ -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 a7636e4535d0c4303c4022620b2fc7d18870f6da..5de5f020da02f30b28bf02701e9fd1662424c914 100644
index 14e13169de8b5e808e3284792237bef9939b1e00..7628a96dc8b2c9e8128cd462138d3487304c6e10 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1900,6 +1900,9 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
@@ -1894,6 +1894,9 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
TargetColorParams LayerTreeHostImpl::GetTargetColorParams(
gfx::ContentColorUsage content_color_usage) const {
TargetColorParams params;
@@ -47,7 +47,7 @@ index f6094a5defe12c34564020b0779626b3e5bff99e..a068a9ba33d3f8c8cdc74ae63ab5e16c
// Image Decode Service and raster tiles without images until the decode is
// ready.
diff --git a/components/viz/common/display/renderer_settings.h b/components/viz/common/display/renderer_settings.h
index d8e2bd1e55a52e86dda5c1b69c425b49e16538bd..80e2c77066f24e99a1894faadbf1d030a188ffa9 100644
index 8b0b5eda59c863efb6f4c67636810871677894c5..eea098eab3c2a5c36fab1a71d888e562e8f93da5 100644
--- a/components/viz/common/display/renderer_settings.h
+++ b/components/viz/common/display/renderer_settings.h
@@ -24,6 +24,7 @@ class VIZ_COMMON_EXPORT RendererSettings {
@@ -80,10 +80,10 @@ index 6a830ec9f29b9764cd425f0681dafbb18d90b457..a7a095ceb9e626c79db21e0d16c8ef47
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a28b9ab108 100644
index 7fb664525ba696626544c8b09597105bff874c05..b987d649ef84451a9d3e5c2f87da3eb06c19c4d6 100644
--- a/components/viz/service/display/gl_renderer.cc
+++ b/components/viz/service/display/gl_renderer.cc
@@ -86,6 +86,9 @@
@@ -87,6 +87,9 @@
using gpu::gles2::GLES2Interface;
@@ -93,7 +93,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
namespace viz {
namespace {
@@ -683,8 +686,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
@@ -685,8 +688,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) {
SetBlendEnabled(quad->ShouldDrawWithBlending());
@@ -105,7 +105,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
// Use the full quad_rect for debug quads to not move the edges based on
// partial swaps.
@@ -1674,7 +1678,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
@@ -1676,7 +1680,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
params->use_color_matrix, tint_gl_composited_content_,
params->apply_shader_based_rounded_corner &&
ShouldApplyRoundedCorner(params->quad)),
@@ -115,7 +115,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
}
void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
@@ -2147,7 +2152,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
@@ -2149,7 +2154,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -125,7 +125,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
gfx::ColorSpace quad_color_space = gfx::ColorSpace::CreateSRGB();
SkColor4f color_f = SkColor4f::FromColor(color);
@@ -2155,7 +2161,7 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
@@ -2157,7 +2163,7 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
// Apply color transform if the color space or source and target do not match.
if (quad_color_space != CurrentRenderPassColorSpace()) {
const gfx::ColorTransform* color_transform =
@@ -134,7 +134,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
gfx::ColorTransform::TriStim col(color_f.fR, color_f.fG, color_f.fB);
color_transform->Transform(&col, 1);
color_f.fR = col.x();
@@ -2377,7 +2383,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
@@ -2379,7 +2385,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
: NON_PREMULTIPLIED_ALPHA,
false, false, tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -144,7 +144,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2476,7 +2483,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
@@ -2478,7 +2485,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
!quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
tint_gl_composited_content_,
ShouldApplyRoundedCorner(quad)),
@@ -154,7 +154,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
if (current_program_->tint_color_matrix_location() != -1) {
auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
@@ -2586,7 +2594,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
@@ -2588,7 +2596,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
// The source color space should never be RGB.
DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
@@ -164,7 +164,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
#if BUILDFLAG(IS_WIN)
// Force sRGB output on Windows for overlay candidate video quads to match
@@ -2767,7 +2776,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
@@ -2769,7 +2778,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
ShouldApplyRoundedCorner(quad)),
@@ -174,7 +174,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
@@ -2838,8 +2848,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
@@ -2840,8 +2850,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
// Bind the program to the GL state.
@@ -185,7 +185,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
/*adjust_src_white_level=*/draw_cache_.is_video_frame,
locked_quad.hdr_metadata());
@@ -3696,7 +3706,9 @@ void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
@@ -3698,7 +3708,9 @@ void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
const gfx::ColorSpace& dst_color_space,
bool adjust_src_white_level,
absl::optional<gfx::HDRMetadata> hdr_metadata) {
@@ -228,7 +228,7 @@ index 553c3be2562e836e2ce6d6f44997cebf3cba7466..fbe38d97a8d1861ecfb5ccb583d050a2
+
+#undef PATCH_CS
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 90c7ace352fe909e3f521403c2a7fbf030ccc31e..f011183e21921f38ce5062079e8430a030159bc1 100644
index 8cd9a960ca1de81857af60daa91596c1dbb17786..7455afe4d81eac31fe3792a4459834a7f968918c 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -227,6 +227,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
@@ -240,10 +240,10 @@ index 90c7ace352fe909e3f521403c2a7fbf030ccc31e..f011183e21921f38ce5062079e8430a0
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 d8939c1936830b101d6bb4079cd99e6015b481c4..366f801cbe84a28ef462037a26da47c9f65057b4 100644
index 09f72f1fbd7b782c5bf52245482b358103f0c243..80d9fd40efed1edc90e7bdf1db534acb876206ca 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -197,6 +197,7 @@
@@ -198,6 +198,7 @@
#include "ui/accessibility/accessibility_switches.h"
#include "ui/base/ui_base_switches.h"
#include "ui/display/display_switches.h"
@@ -251,7 +251,7 @@ index d8939c1936830b101d6bb4079cd99e6015b481c4..366f801cbe84a28ef462037a26da47c9
#include "ui/gl/gl_switches.h"
#include "url/gurl.h"
#include "url/origin.h"
@@ -3212,6 +3213,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
@@ -3219,6 +3220,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[] = {

View File

@@ -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 54a1142f17e2a63b86e1fab52ea90276091c85a4..df9381bf8dc4b2b85548c529038f60cc3185fcdd 100644
index 18c77a5520ea2ae7cfee4eea3ed01fa8a588829d..557b77bea785108359b0c78f12c2b2afbdc2475d 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -511,7 +511,11 @@

View File

@@ -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 63f51521afa85f53073df2e3747eba95e80de09d..ed56e947fa137cbaddaa12503ae983d7acd4463f 100644
index 9e740edbf36dd7a30062c88f857103c56eebd729..7cda66952e0d3a67c32791ad3c7d7de8df03f876 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -809,6 +809,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -808,6 +808,9 @@ void RenderWidgetHostImpl::WasHidden() {
if (is_hidden_)
return;
@@ -20,10 +20,10 @@ index 63f51521afa85f53073df2e3747eba95e80de09d..ed56e947fa137cbaddaa12503ae983d7
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 5e2e1fe4482fdde0df1a02ae9ae6d68431dac4d8..3ae005ae898ee0dd8befa7699b469fc379b5a1d1 100644
index 23783e5e004b613c27fd753e1f7ff96d51fa5f68..225b4ea0c5ac74d6b6700c306182d003a972cedc 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -880,6 +880,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -886,6 +886,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
SiteInstanceGroup* GetSiteInstanceGroup();
@@ -34,10 +34,10 @@ index 5e2e1fe4482fdde0df1a02ae9ae6d68431dac4d8..3ae005ae898ee0dd8befa7699b469fc3
// |routing_id| must not be MSG_ROUTING_NONE.
// If this object outlives |delegate|, DetachDelegate() must be called when
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index b39dd8d70aa590677f7d3e95412c0709f0fbbc81..558fd14566a4b953b5140b59ad614b70e1855bc5 100644
index 5f29761ad8556e730dca6b076b87f6391313fb95..3e5f5a34150079bf74d612bff85b6875ad41d2e6 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -618,7 +618,7 @@ void RenderWidgetHostViewAura::HideImpl() {
@@ -605,7 +605,7 @@ void RenderWidgetHostViewAura::HideImpl() {
DCHECK(visibility_ == Visibility::HIDDEN ||
visibility_ == Visibility::OCCLUDED);

View File

@@ -24,10 +24,10 @@ This patch temporarily disables the metrics so we can have green CI, and we
should continue seeking for a real fix.
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc
index cd286b4925b3d2d9e74caecee759360488f2b8ba..0bc714a78e58719824ffeba8ced7854474fa6e92 100644
index c289c888bc9d74d3f696714650b65aa373be27b4..aad7ec5ed0b6f6ab5cdfe0d7902d952c7c9e36c6 100644
--- a/content/browser/renderer_host/navigator.cc
+++ b/content/browser/renderer_host/navigator.cc
@@ -1177,6 +1177,7 @@ void Navigator::RecordNavigationMetrics(
@@ -1286,6 +1286,7 @@ void Navigator::RecordNavigationMetrics(
.InMilliseconds());
}
@@ -35,7 +35,7 @@ index cd286b4925b3d2d9e74caecee759360488f2b8ba..0bc714a78e58719824ffeba8ced78544
// If this is a same-process navigation and we have timestamps for unload
// durations, fill those metrics out as well.
if (params.unload_start && params.unload_end &&
@@ -1223,6 +1224,7 @@ void Navigator::RecordNavigationMetrics(
@@ -1332,6 +1333,7 @@ void Navigator::RecordNavigationMetrics(
first_before_unload_start_time)
.InMilliseconds());
}

View File

@@ -19,10 +19,10 @@ index d871ceecd76e21b23c500643363ced2ca87e8013..e0a26a90ee38342aefdbdd76e9c56a93
using PCScan = internal::PCScan;
const auto invocation_mode = flags & PurgeFlags::kAggressiveReclaim
diff --git a/base/threading/platform_thread_posix.cc b/base/threading/platform_thread_posix.cc
index d1b71673ca79ea0f2293cda46564ceb8a018f4e5..ca70bb8fdf7fec2e0d5e2b3bf0ece86def72e21b 100644
index d51b37c8a2df11f71fa6056193100d00883db43d..b44002788cf4d4f5d754dd35dd193be233e6ebcb 100644
--- a/base/threading/platform_thread_posix.cc
+++ b/base/threading/platform_thread_posix.cc
@@ -43,6 +43,7 @@
@@ -44,6 +44,7 @@
#endif
#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
@@ -30,7 +30,7 @@ index d1b71673ca79ea0f2293cda46564ceb8a018f4e5..ca70bb8fdf7fec2e0d5e2b3bf0ece86d
#include "base/allocator/partition_allocator/starscan/pcscan.h"
#include "base/allocator/partition_allocator/starscan/stack/stack.h"
#endif
@@ -76,7 +77,7 @@ void* ThreadFunc(void* params) {
@@ -77,7 +78,7 @@ void* ThreadFunc(void* params) {
base::DisallowSingleton();
#if !BUILDFLAG(IS_NACL)
@@ -39,7 +39,7 @@ index d1b71673ca79ea0f2293cda46564ceb8a018f4e5..ca70bb8fdf7fec2e0d5e2b3bf0ece86d
internal::PCScan::NotifyThreadCreated(internal::GetStackPointer());
#endif
@@ -102,7 +103,7 @@ void* ThreadFunc(void* params) {
@@ -103,7 +104,7 @@ void* ThreadFunc(void* params) {
PlatformThread::CurrentHandle().platform_handle(),
PlatformThread::CurrentId());
@@ -49,10 +49,10 @@ index d1b71673ca79ea0f2293cda46564ceb8a018f4e5..ca70bb8fdf7fec2e0d5e2b3bf0ece86d
#endif
diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
index c965c9764ad38a8b52b727ca98fe41f00ab6707d..7d44c4e63b2b4ccf595b5e2a0212fb6c4eb2b5bd 100644
index 8542c0d0d49511298cca800a59796b1e4271a3d8..1d0eeff5800f2ccf3f1fb6b1356c8cd067cfd945 100644
--- a/base/threading/platform_thread_win.cc
+++ b/base/threading/platform_thread_win.cc
@@ -29,6 +29,7 @@
@@ -30,6 +30,7 @@
#include <windows.h>
#if BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
@@ -60,7 +60,7 @@ index c965c9764ad38a8b52b727ca98fe41f00ab6707d..7d44c4e63b2b4ccf595b5e2a0212fb6c
#include "base/allocator/partition_allocator/starscan/pcscan.h"
#include "base/allocator/partition_allocator/starscan/stack/stack.h"
#endif
@@ -105,7 +106,7 @@ DWORD __stdcall ThreadFunc(void* params) {
@@ -113,7 +114,7 @@ DWORD __stdcall ThreadFunc(void* params) {
FALSE,
DUPLICATE_SAME_ACCESS);
@@ -69,7 +69,7 @@ index c965c9764ad38a8b52b727ca98fe41f00ab6707d..7d44c4e63b2b4ccf595b5e2a0212fb6c
internal::PCScan::NotifyThreadCreated(internal::GetStackPointer());
#endif
@@ -125,7 +126,7 @@ DWORD __stdcall ThreadFunc(void* params) {
@@ -133,7 +134,7 @@ DWORD __stdcall ThreadFunc(void* params) {
PlatformThread::CurrentId());
}

View File

@@ -11,10 +11,10 @@ This regressed in https://chromium-review.googlesource.com/c/chromium/src/+/2572
Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2598393
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index bc8bdba3facba81c572d43b85881ec02ad7d2f00..3b12ab113f7c159beb74a09f95335977b4ee2b4f 100644
index 95966ce7f0eeb0a7f2822bef69b540ac6bfe298d..34c2bdc5d4dda2fb0bdf2a8c3e5f8f9a5e11b977 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2367,7 +2367,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const {
@@ -2398,7 +2398,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const {
}
const blink::web_pref::WebPreferences& RenderFrameImpl::GetBlinkPreferences() {

View File

@@ -6,7 +6,7 @@ Subject: feat: enable setting aspect ratio to 0
Make SetAspectRatio accept 0 as valid input, which would reset to null.
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index a1de50d6b0f699d0651c369cafafdd5bb542242d..65b9f5e5f81e8ef8b591ef2e027e095df11c0d7b 100644
index ece3dfbee04cf941689e4f21f5176db010fda564..9fd052c00a484cd1acd2031fda79e6307fd01b60 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -530,7 +530,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
@@ -19,7 +19,7 @@ index a1de50d6b0f699d0651c369cafafdd5bb542242d..65b9f5e5f81e8ef8b591ef2e027e095d
aspect_ratio.height());
}
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index b14fa0f41166a904991ec920cec2f45c3b71c953..37bb1e9788a251b3f2c79b5272d4a44c22b707b3 100644
index a2f053c3e2588451458682aa6e86da52a591e1e7..9e38d55d7156986e48ed6dcb3522d77358bfdb75 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -936,8 +936,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) {

View File

@@ -21,10 +21,10 @@ index c9b535eb083c250f4f874d8e6bd0c29ea9f3a10f..f220b8669507a4aea616b0dfbabda509
v8::ZoneBackingAllocator* GetZoneBackingAllocator() override;
#endif
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc
index 78b8a28eadf392422b55e441634e3161c8c1694c..af3ed7813d9ed5fb294b67a0da1237140b40abbf 100644
index 952023235d9f1905b64195f625dbb3b1af97f908..3d8b4cc17584e7ae8be0b77a073a0453bcd5b3ef 100644
--- a/gin/v8_platform.cc
+++ b/gin/v8_platform.cc
@@ -367,6 +367,10 @@ PageAllocator* V8Platform::GetPageAllocator() {
@@ -366,6 +366,10 @@ PageAllocator* V8Platform::GetPageAllocator() {
return g_page_allocator.Pointer();
}

View File

@@ -33,10 +33,10 @@ index 14c71cc69388da46f62d9835e2a06fef0870da02..9481ea08401ae29ae9c1d960491b05b3
} // namespace net
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index 4c8982a8ae3ae23fbeef244cd23b43c889d3fa94..13b48d5acadf5dcfb40a829751b089c1c29f9450 100644
index f06a04983571623b542dba11933c4c95c3dcf398..606573a33573884baa173b796e1870b8defcda2a 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -1350,6 +1350,13 @@ void NetworkContext::SetNetworkConditions(
@@ -1407,6 +1407,13 @@ void NetworkContext::SetNetworkConditions(
std::move(network_conditions));
}
@@ -51,10 +51,10 @@ index 4c8982a8ae3ae23fbeef244cd23b43c889d3fa94..13b48d5acadf5dcfb40a829751b089c1
// 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 eed05c05d1da28284af6ae0cef45dbbb47254058..f32671202010fa57901a09723feecacc72dbd5f9 100644
index 2cd8707b120deb41683e13def5d446fd3bf93afe..c654d54cbb1427e700d918a94390c022b5b1cb14 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -283,6 +283,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -302,6 +302,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 eed05c05d1da28284af6ae0cef45dbbb47254058..f32671202010fa57901a09723feecacc
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 c929eb10af5b8856debdc0d665eac767e9730714..c20bd2a2d6b989386ce7ef97e43f677e2c5291fa 100644
index b52e5a2230e96d55d7886bde331a505c58dd093a..757dd77b06cba44e832e86e729e44b1e9a427c49 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -1089,6 +1089,9 @@ interface NetworkContext {
@@ -1087,6 +1087,9 @@ interface NetworkContext {
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
NetworkConditions? conditions);

View File

@@ -12,18 +12,18 @@ 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 06d8ca44fb1dc3748d81b5c5a407dfdf7183f845..85e1772fbcbb190e32dd30996541cc2e9d19d057 100644
index f76a0ee0778d7b4e4df69a4c43b4a6bfdc89294d..45baa4d62cb4e5aebedebba993ddbc9f06711d35 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -159,6 +159,7 @@
#include "third_party/blink/renderer/core/timing/dom_window_performance.h"
#include "third_party/blink/renderer/core/timing/window_performance.h"
#include "third_party/blink/renderer/platform/fonts/font_cache.h"
#include "third_party/blink/renderer/platform/fonts/generic_font_family_settings.h"
+#include "third_party/blink/renderer/platform/graphics/color.h"
#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"
@@ -1774,6 +1775,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
@@ -1776,6 +1777,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
#if BUILDFLAG(IS_MAC)
web_view_impl->SetMaximumLegibleScale(
prefs.default_maximum_page_scale_factor);

View File

@@ -0,0 +1,348 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Raymond Zhao <raymondzhao@microsoft.com>
Date: Tue, 7 Sep 2021 14:54:25 -0700
Subject: feat: Add data parameter to ProcessSingleton
This patch adds an additional_data parameter to the constructor of
ProcessSingleton, so that the second instance can send additional
data over to the first instance while requesting the ProcessSingleton
lock.
On the Electron side, we then expose an extra parameter to the
app.requestSingleInstanceLock API so that users can pass in a JSON
object for the second instance to send to the first instance.
diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h
index 5a64220aaf1309832dc0ad543e353de67fe0a779..e75c4f0d7cf1cac2e5862eb858800359e2001eb6 100644
--- a/chrome/browser/process_singleton.h
+++ b/chrome/browser/process_singleton.h
@@ -18,6 +18,7 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/process/process.h"
+#include "base/containers/span.h"
#include "ui/gfx/native_widget_types.h"
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
@@ -99,22 +100,25 @@ class ProcessSingleton {
// handled within the current browser instance or false if the remote process
// should handle it (i.e., because the current process is shutting down).
using NotificationCallback =
- base::RepeatingCallback<bool(const base::CommandLine& command_line,
- const base::FilePath& current_directory)>;
+ base::RepeatingCallback<bool(const base::CommandLine& command_line,
+ const base::FilePath& current_directory,
+ const std::vector<const uint8_t> additional_data)>;
#if BUILDFLAG(IS_WIN)
ProcessSingleton(const std::string& program_name,
const base::FilePath& user_data_dir,
+ const base::span<const uint8_t> additional_data,
bool is_sandboxed,
const NotificationCallback& notification_callback);
#else
ProcessSingleton(const base::FilePath& user_data_dir,
+ const base::span<const uint8_t> additional_data,
const NotificationCallback& notification_callback);
+#endif
ProcessSingleton(const ProcessSingleton&) = delete;
ProcessSingleton& operator=(const ProcessSingleton&) = delete;
-#endif
~ProcessSingleton();
// Notify another process, if available. Otherwise sets ourselves as the
@@ -177,7 +181,10 @@ class ProcessSingleton {
#endif
private:
- NotificationCallback notification_callback_; // Handler for notifications.
+ // A callback to run when the first instance receives data from the second.
+ NotificationCallback notification_callback_;
+ // Custom data to pass to the other instance during notify.
+ base::span<const uint8_t> additional_data_;
#if BUILDFLAG(IS_WIN)
bool EscapeVirtualization(const base::FilePath& user_data_dir);
diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc
index be2c417c07a4206fac4a9a6c03e516fd0493c942..9a1f7b80e9ec538977f9b492829646a62d2a67cd 100644
--- a/chrome/browser/process_singleton_posix.cc
+++ b/chrome/browser/process_singleton_posix.cc
@@ -612,6 +612,7 @@ class ProcessSingleton::LinuxWatcher
// |reader| is for sending back ACK message.
void HandleMessage(const std::string& current_dir,
const std::vector<std::string>& argv,
+ const std::vector<const uint8_t> additional_data,
SocketReader* reader);
private:
@@ -666,13 +667,16 @@ void ProcessSingleton::LinuxWatcher::StartListening(int socket) {
}
void ProcessSingleton::LinuxWatcher::HandleMessage(
- const std::string& current_dir, const std::vector<std::string>& argv,
+ const std::string& current_dir,
+ const std::vector<std::string>& argv,
+ const std::vector<const uint8_t> additional_data,
SocketReader* reader) {
DCHECK(ui_task_runner_->BelongsToCurrentThread());
DCHECK(reader);
if (parent_->notification_callback_.Run(base::CommandLine(argv),
- base::FilePath(current_dir))) {
+ base::FilePath(current_dir),
+ std::move(additional_data))) {
// Send back "ACK" message to prevent the client process from starting up.
reader->FinishWithACK(kACKToken, std::size(kACKToken) - 1);
} else {
@@ -720,7 +724,8 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
}
}
- // Validate the message. The shortest message is kStartToken\0x\0x
+ // Validate the message. The shortest message kStartToken\0\00
+ // The shortest message with additional data is kStartToken\0\00\00\0.
const size_t kMinMessageLength = std::size(kStartToken) + 4;
if (bytes_read_ < kMinMessageLength) {
buf_[bytes_read_] = 0;
@@ -750,10 +755,28 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
tokens.erase(tokens.begin());
tokens.erase(tokens.begin());
+ size_t num_args;
+ base::StringToSizeT(tokens[0], &num_args);
+ std::vector<std::string> command_line(tokens.begin() + 1, tokens.begin() + 1 + num_args);
+
+ std::vector<const uint8_t> additional_data;
+ if (tokens.size() >= 3 + num_args) {
+ size_t additional_data_size;
+ base::StringToSizeT(tokens[1 + num_args], &additional_data_size);
+ std::string remaining_args = base::JoinString(
+ base::make_span(tokens.begin() + 2 + num_args, tokens.end()),
+ std::string(1, kTokenDelimiter));
+ const uint8_t* additional_data_bits =
+ reinterpret_cast<const uint8_t*>(remaining_args.c_str());
+ additional_data = std::vector<const uint8_t>(
+ additional_data_bits, additional_data_bits + additional_data_size);
+ }
+
// Return to the UI thread to handle opening a new browser tab.
ui_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&ProcessSingleton::LinuxWatcher::HandleMessage,
- parent_, current_dir, tokens, this));
+ parent_, current_dir, command_line,
+ std::move(additional_data), this));
fd_watch_controller_.reset();
// LinuxWatcher::HandleMessage() is in charge of destroying this SocketReader
@@ -782,8 +805,10 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK(
//
ProcessSingleton::ProcessSingleton(
const base::FilePath& user_data_dir,
+ const base::span<const uint8_t> additional_data,
const NotificationCallback& notification_callback)
: notification_callback_(notification_callback),
+ additional_data_(additional_data),
current_pid_(base::GetCurrentProcId()),
watcher_(new LinuxWatcher(this)) {
socket_path_ = user_data_dir.Append(chrome::kSingletonSocketFilename);
@@ -902,7 +927,8 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
sizeof(socket_timeout));
// Found another process, prepare our command line
- // format is "START\0<current dir>\0<argv[0]>\0...\0<argv[n]>".
+ // format is "START\0<current-dir>\0<n-args>\0<argv[0]>\0...\0<argv[n]>
+ // \0<additional-data-length>\0<additional-data>".
std::string to_send(kStartToken);
to_send.push_back(kTokenDelimiter);
@@ -912,11 +938,21 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
to_send.append(current_dir.value());
const std::vector<std::string>& argv = cmd_line.argv();
+ to_send.push_back(kTokenDelimiter);
+ to_send.append(base::NumberToString(argv.size()));
for (auto it = argv.begin(); it != argv.end(); ++it) {
to_send.push_back(kTokenDelimiter);
to_send.append(*it);
}
+ size_t data_to_send_size = additional_data_.size_bytes();
+ if (data_to_send_size) {
+ to_send.push_back(kTokenDelimiter);
+ to_send.append(base::NumberToString(data_to_send_size));
+ to_send.push_back(kTokenDelimiter);
+ to_send.append(reinterpret_cast<const char*>(additional_data_.data()), data_to_send_size);
+ }
+
// Send the message
if (!WriteToSocket(socket.fd(), to_send.data(), to_send.length())) {
// Try to kill the other process, because it might have been dead.
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index ec725b44296266bea1a51aea889463a0bba8449c..beb2925f2fd7a1a93435bf4b1a40b5c71b49e449 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -80,10 +80,12 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) {
bool ParseCommandLine(const COPYDATASTRUCT* cds,
base::CommandLine* parsed_command_line,
- base::FilePath* current_directory) {
+ base::FilePath* current_directory,
+ std::vector<const uint8_t>* parsed_additional_data) {
// We should have enough room for the shortest command (min_message_size)
// and also be a multiple of wchar_t bytes. The shortest command
- // possible is L"START\0\0" (empty current directory and command line).
+ // possible is L"START\0\0" (empty command line, current directory,
+ // and additional data).
static const int min_message_size = 7;
if (cds->cbData < min_message_size * sizeof(wchar_t) ||
cds->cbData % sizeof(wchar_t) != 0) {
@@ -133,6 +135,37 @@ bool ParseCommandLine(const COPYDATASTRUCT* cds,
const std::wstring cmd_line =
msg.substr(second_null + 1, third_null - second_null);
*parsed_command_line = base::CommandLine::FromString(cmd_line);
+
+ const std::wstring::size_type fourth_null =
+ msg.find_first_of(L'\0', third_null + 1);
+ if (fourth_null == std::wstring::npos ||
+ fourth_null == msg.length()) {
+ // No additional data was provided.
+ return true;
+ }
+
+ // Get length of the additional data.
+ const std::wstring additional_data_length_string =
+ msg.substr(third_null + 1, fourth_null - third_null);
+ size_t additional_data_length;
+ base::StringToSizeT(additional_data_length_string, &additional_data_length);
+
+ const std::wstring::size_type fifth_null =
+ msg.find_first_of(L'\0', fourth_null + 1);
+ if (fifth_null == std::wstring::npos ||
+ fifth_null == msg.length()) {
+ LOG(WARNING) << "Invalid format for start command, we need a string in 6 "
+ "parts separated by NULLs";
+ }
+
+ // Get the actual additional data.
+ const std::wstring additional_data =
+ msg.substr(fourth_null + 1, fifth_null - fourth_null);
+ const uint8_t* additional_data_bytes =
+ reinterpret_cast<const uint8_t*>(additional_data.c_str());
+ *parsed_additional_data = std::vector<const uint8_t>(additional_data_bytes,
+ additional_data_bytes + additional_data_length);
+
return true;
}
return false;
@@ -154,13 +187,14 @@ bool ProcessLaunchNotification(
base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM);
base::FilePath current_directory;
- if (!ParseCommandLine(cds, &parsed_command_line, &current_directory)) {
+ std::vector<const uint8_t> additional_data;
+ if (!ParseCommandLine(cds, &parsed_command_line, &current_directory, &additional_data)) {
*result = TRUE;
return true;
}
- *result = notification_callback.Run(parsed_command_line, current_directory) ?
- TRUE : FALSE;
+ *result = notification_callback.Run(parsed_command_line,
+ current_directory, std::move(additional_data)) ? TRUE : FALSE;
return true;
}
@@ -261,9 +295,11 @@ bool ProcessSingleton::EscapeVirtualization(
ProcessSingleton::ProcessSingleton(
const std::string& program_name,
const base::FilePath& user_data_dir,
+ const base::span<const uint8_t> additional_data,
bool is_app_sandboxed,
const NotificationCallback& notification_callback)
: notification_callback_(notification_callback),
+ additional_data_(additional_data),
program_name_(program_name),
is_app_sandboxed_(is_app_sandboxed),
is_virtualized_(false),
@@ -290,7 +326,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
return PROCESS_NONE;
}
- switch (chrome::AttemptToNotifyRunningChrome(remote_window_)) {
+ switch (chrome::AttemptToNotifyRunningChrome(remote_window_, additional_data_)) {
case chrome::NOTIFY_SUCCESS:
return PROCESS_NOTIFIED;
case chrome::NOTIFY_FAILED:
diff --git a/chrome/browser/win/chrome_process_finder.cc b/chrome/browser/win/chrome_process_finder.cc
index b64ed1d155a30582e48c9cdffcee9d0f25a53a6a..cfdb2d75532d270e3dd548eb7475a6cdbddf1016 100644
--- a/chrome/browser/win/chrome_process_finder.cc
+++ b/chrome/browser/win/chrome_process_finder.cc
@@ -36,7 +36,9 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) {
return base::win::MessageWindow::FindWindow(user_data_dir.value());
}
-NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) {
+NotifyChromeResult AttemptToNotifyRunningChrome(
+ HWND remote_window,
+ const base::span<const uint8_t> additional_data) {
TRACE_EVENT0("startup", "AttemptToNotifyRunningChrome");
DCHECK(remote_window);
@@ -50,7 +52,8 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) {
}
// Send the command line to the remote chrome window.
- // Format is "START\0<<<current directory>>>\0<<<commandline>>>".
+ // Format is
+ // "START\0<current-directory>\0<command-line>\0<additional-data-length>\0<additional-data>".
std::wstring to_send(L"START\0", 6); // want the NULL in the string.
base::FilePath cur_dir;
if (!base::GetCurrentDirectory(&cur_dir)) {
@@ -64,6 +67,22 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) {
base::CommandLine::ForCurrentProcess()->GetCommandLineString());
to_send.append(L"\0", 1); // Null separator.
+ size_t additional_data_size = additional_data.size_bytes();
+ if (additional_data_size) {
+ // Send over the size, because the reinterpret cast to wchar_t could
+ // add padding.
+ to_send.append(base::UTF8ToWide(base::NumberToString(additional_data_size)));
+ to_send.append(L"\0", 1); // Null separator.
+
+ size_t padded_size = additional_data_size / sizeof(wchar_t);
+ if (additional_data_size % sizeof(wchar_t) != 0) {
+ padded_size++;
+ }
+ to_send.append(reinterpret_cast<const wchar_t*>(additional_data.data()),
+ padded_size);
+ to_send.append(L"\0", 1); // Null separator.
+ }
+
// Allow the current running browser window to make itself the foreground
// window (otherwise it will just flash in the taskbar).
::AllowSetForegroundWindow(process_id);
diff --git a/chrome/browser/win/chrome_process_finder.h b/chrome/browser/win/chrome_process_finder.h
index 5516673cee019f6060077091e59498bf9038cd6e..8edea5079b46c2cba67833114eb9c21d85cfc22d 100644
--- a/chrome/browser/win/chrome_process_finder.h
+++ b/chrome/browser/win/chrome_process_finder.h
@@ -7,6 +7,7 @@
#include <windows.h>
+#include "base/containers/span.h"
#include "base/time/time.h"
namespace base {
@@ -27,7 +28,9 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir);
// Attempts to send the current command line to an already running instance of
// Chrome via a WM_COPYDATA message.
// Returns true if a running Chrome is found and successfully notified.
-NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window);
+NotifyChromeResult AttemptToNotifyRunningChrome(
+ HWND remote_window,
+ const base::span<const uint8_t> additional_data);
// Changes the notification timeout to |new_timeout|, returns the old timeout.
base::TimeDelta SetNotificationTimeoutForTesting(base::TimeDelta new_timeout);

View File

@@ -1,600 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Raymond Zhao <raymondzhao@microsoft.com>
Date: Tue, 7 Sep 2021 14:54:25 -0700
Subject: feat: Add data transfer mechanism to requestSingleInstanceLock flow
This patch adds code that allows for the second instance to send
additional data to the first instance, and for the first instance
to send additional data back to the second instance, during the
app.requestSingleInstanceLock call.
Firstly, this patch adds an additional_data parameter
to the constructor of ProcessSingleton, so that the second instance
can send additional data over to the first instance
while requesting the ProcessSingleton lock.
Then, we add additional processing to the second-instance event, both
so the first instance can receive additional data from the second
instance, but also so the second instance can send back additional
data to the first instance if needed.
diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h
index 5a64220aaf1309832dc0ad543e353de67fe0a779..5b701b1361707b610ed60c344e441e67ca701362 100644
--- a/chrome/browser/process_singleton.h
+++ b/chrome/browser/process_singleton.h
@@ -18,6 +18,7 @@
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
#include "base/process/process.h"
+#include "base/containers/span.h"
#include "ui/gfx/native_widget_types.h"
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
@@ -93,6 +94,9 @@ class ProcessSingleton {
static constexpr int kNumNotifyResults = LAST_VALUE + 1;
+ using NotificationAckCallback =
+ base::RepeatingCallback<void(const base::span<const uint8_t>* ack_data)>;
+
// Implement this callback to handle notifications from other processes. The
// callback will receive the command line and directory with which the other
// Chrome process was launched. Return true if the command line will be
@@ -100,21 +104,27 @@ class ProcessSingleton {
// should handle it (i.e., because the current process is shutting down).
using NotificationCallback =
base::RepeatingCallback<bool(const base::CommandLine& command_line,
- const base::FilePath& current_directory)>;
+ const base::FilePath& current_directory,
+ const std::vector<uint8_t> additional_data,
+ const NotificationAckCallback& ack_callback)>;
#if BUILDFLAG(IS_WIN)
ProcessSingleton(const std::string& program_name,
const base::FilePath& user_data_dir,
+ const base::span<const uint8_t> additional_data,
bool is_sandboxed,
- const NotificationCallback& notification_callback);
+ const NotificationCallback& notification_callback,
+ const NotificationAckCallback& ack_notification_callback);
#else
ProcessSingleton(const base::FilePath& user_data_dir,
- const NotificationCallback& notification_callback);
+ const base::span<const uint8_t> additional_data,
+ const NotificationCallback& notification_callback,
+ const NotificationAckCallback& ack_notification_callback);
+#endif
ProcessSingleton(const ProcessSingleton&) = delete;
ProcessSingleton& operator=(const ProcessSingleton&) = delete;
-#endif
~ProcessSingleton();
// Notify another process, if available. Otherwise sets ourselves as the
@@ -177,7 +187,13 @@ class ProcessSingleton {
#endif
private:
- NotificationCallback notification_callback_; // Handler for notifications.
+ // A callback to run when the first instance receives data from the second.
+ NotificationCallback notification_callback_;
+ // A callback to run when the second instance
+ // receives an acknowledgement from the first.
+ NotificationAckCallback notification_ack_callback_;
+ // Custom data to pass to the other instance during notify.
+ base::span<const uint8_t> additional_data_;
#if BUILDFLAG(IS_WIN)
bool EscapeVirtualization(const base::FilePath& user_data_dir);
@@ -190,6 +206,7 @@ class ProcessSingleton {
HANDLE lock_file_;
base::FilePath user_data_dir_;
ShouldKillRemoteProcessCallback should_kill_remote_process_callback_;
+ HANDLE ack_pipe_;
#elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
// Return true if the given pid is one of our child processes.
// Assumes that the current pid is the root of all pids of the current
diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc
index be2c417c07a4206fac4a9a6c03e516fd0493c942..78f74b0b21242553b6af98628dc48190f7d1137d 100644
--- a/chrome/browser/process_singleton_posix.cc
+++ b/chrome/browser/process_singleton_posix.cc
@@ -146,7 +146,7 @@ const char kACKToken[] = "ACK";
const char kShutdownToken[] = "SHUTDOWN";
const char kTokenDelimiter = '\0';
const int kMaxMessageLength = 32 * 1024;
-const int kMaxACKMessageLength = std::size(kShutdownToken) - 1;
+const int kMaxACKMessageLength = kMaxMessageLength;
bool g_disable_prompt = false;
bool g_skip_is_chrome_process_check = false;
@@ -612,6 +612,7 @@ class ProcessSingleton::LinuxWatcher
// |reader| is for sending back ACK message.
void HandleMessage(const std::string& current_dir,
const std::vector<std::string>& argv,
+ const std::vector<uint8_t> additional_data,
SocketReader* reader);
private:
@@ -636,6 +637,9 @@ class ProcessSingleton::LinuxWatcher
// The ProcessSingleton that owns us.
ProcessSingleton* const parent_;
+ bool ack_callback_called_ = false;
+ void AckCallback(SocketReader* reader, const base::span<const uint8_t>* response);
+
std::set<std::unique_ptr<SocketReader>, base::UniquePtrComparator> readers_;
};
@@ -666,16 +670,21 @@ void ProcessSingleton::LinuxWatcher::StartListening(int socket) {
}
void ProcessSingleton::LinuxWatcher::HandleMessage(
- const std::string& current_dir, const std::vector<std::string>& argv,
+ const std::string& current_dir,
+ const std::vector<std::string>& argv,
+ const std::vector<uint8_t> additional_data,
SocketReader* reader) {
DCHECK(ui_task_runner_->BelongsToCurrentThread());
DCHECK(reader);
- if (parent_->notification_callback_.Run(base::CommandLine(argv),
- base::FilePath(current_dir))) {
- // Send back "ACK" message to prevent the client process from starting up.
- reader->FinishWithACK(kACKToken, std::size(kACKToken) - 1);
- } else {
+ auto wrapped_ack_callback =
+ base::BindRepeating(&ProcessSingleton::LinuxWatcher::AckCallback,
+ base::Unretained(this), reader);
+ ack_callback_called_ = false;
+ if (!parent_->notification_callback_.Run(base::CommandLine(argv),
+ base::FilePath(current_dir),
+ std::move(additional_data),
+ wrapped_ack_callback)) {
LOG(WARNING) << "Not handling interprocess notification as browser"
" is shutting down";
// Send back "SHUTDOWN" message, so that the client process can start up
@@ -685,6 +694,22 @@ void ProcessSingleton::LinuxWatcher::HandleMessage(
}
}
+void ProcessSingleton::LinuxWatcher::AckCallback(
+ SocketReader* reader,
+ const base::span<const uint8_t>* response) {
+ // Send back "ACK" message to prevent the client process from starting up.
+ if (!ack_callback_called_) {
+ ack_callback_called_ = true;
+ std::string ack_message;
+ ack_message.append(kACKToken, std::size(kACKToken) - 1);
+ if (response && response->size_bytes()) {
+ ack_message.append(reinterpret_cast<const char*>(response->data()),
+ response->size_bytes());
+ }
+ reader->FinishWithACK(ack_message.c_str(), ack_message.size());
+ }
+}
+
void ProcessSingleton::LinuxWatcher::RemoveSocketReader(SocketReader* reader) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(reader);
@@ -720,7 +745,8 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
}
}
- // Validate the message. The shortest message is kStartToken\0x\0x
+ // Validate the message. The shortest message kStartToken\0\00
+ // The shortest message with additional data is kStartToken\0\00\00\0.
const size_t kMinMessageLength = std::size(kStartToken) + 4;
if (bytes_read_ < kMinMessageLength) {
buf_[bytes_read_] = 0;
@@ -750,10 +776,28 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
tokens.erase(tokens.begin());
tokens.erase(tokens.begin());
+ size_t num_args;
+ base::StringToSizeT(tokens[0], &num_args);
+ std::vector<std::string> command_line(tokens.begin() + 1, tokens.begin() + 1 + num_args);
+
+ std::vector<uint8_t> additional_data;
+ if (tokens.size() >= 3 + num_args) {
+ size_t additional_data_size;
+ base::StringToSizeT(tokens[1 + num_args], &additional_data_size);
+ std::string remaining_args = base::JoinString(
+ base::make_span(tokens.begin() + 2 + num_args, tokens.end()),
+ std::string(1, kTokenDelimiter));
+ const uint8_t* additional_data_bits =
+ reinterpret_cast<const uint8_t*>(remaining_args.c_str());
+ additional_data = std::vector<uint8_t>(additional_data_bits,
+ additional_data_bits + additional_data_size);
+ }
+
// Return to the UI thread to handle opening a new browser tab.
ui_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&ProcessSingleton::LinuxWatcher::HandleMessage,
- parent_, current_dir, tokens, this));
+ parent_, current_dir, command_line,
+ std::move(additional_data), this));
fd_watch_controller_.reset();
// LinuxWatcher::HandleMessage() is in charge of destroying this SocketReader
@@ -782,8 +826,12 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK(
//
ProcessSingleton::ProcessSingleton(
const base::FilePath& user_data_dir,
- const NotificationCallback& notification_callback)
+ const base::span<const uint8_t> additional_data,
+ const NotificationCallback& notification_callback,
+ const NotificationAckCallback& notification_ack_callback)
: notification_callback_(notification_callback),
+ notification_ack_callback_(notification_ack_callback),
+ additional_data_(additional_data),
current_pid_(base::GetCurrentProcId()),
watcher_(new LinuxWatcher(this)) {
socket_path_ = user_data_dir.Append(chrome::kSingletonSocketFilename);
@@ -902,7 +950,8 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
sizeof(socket_timeout));
// Found another process, prepare our command line
- // format is "START\0<current dir>\0<argv[0]>\0...\0<argv[n]>".
+ // format is "START\0<current-dir>\0<n-args>\0<argv[0]>\0...\0<argv[n]>
+ // \0<additional-data-length>\0<additional-data>".
std::string to_send(kStartToken);
to_send.push_back(kTokenDelimiter);
@@ -912,11 +961,21 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
to_send.append(current_dir.value());
const std::vector<std::string>& argv = cmd_line.argv();
+ to_send.push_back(kTokenDelimiter);
+ to_send.append(base::NumberToString(argv.size()));
for (auto it = argv.begin(); it != argv.end(); ++it) {
to_send.push_back(kTokenDelimiter);
to_send.append(*it);
}
+ size_t data_to_send_size = additional_data_.size_bytes();
+ if (data_to_send_size) {
+ to_send.push_back(kTokenDelimiter);
+ to_send.append(base::NumberToString(data_to_send_size));
+ to_send.push_back(kTokenDelimiter);
+ to_send.append(reinterpret_cast<const char*>(additional_data_.data()), data_to_send_size);
+ }
+
// Send the message
if (!WriteToSocket(socket.fd(), to_send.data(), to_send.length())) {
// Try to kill the other process, because it might have been dead.
@@ -958,6 +1017,17 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
linux_ui->NotifyWindowManagerStartupComplete();
#endif
+ size_t ack_data_len = len - (std::size(kACKToken) - 1);
+ if (ack_data_len) {
+ const uint8_t* raw_ack_data =
+ reinterpret_cast<const uint8_t*>(buf + std::size(kACKToken) - 1);
+ base::span<const uint8_t> ack_data =
+ base::make_span(raw_ack_data, raw_ack_data + ack_data_len);
+ notification_ack_callback_.Run(&ack_data);
+ } else {
+ notification_ack_callback_.Run(nullptr);
+ }
+
// Assume the other process is handling the request.
return PROCESS_NOTIFIED;
}
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index ec725b44296266bea1a51aea889463a0bba8449c..a3d4dd1efc950033855a1f2783f941384b249a5d 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -21,6 +21,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
+#include "base/timer/timer.h"
#include "base/trace_event/base_tracing.h"
#include "base/win/registry.h"
#include "base/win/scoped_handle.h"
@@ -45,6 +46,14 @@
namespace {
const char kLockfile[] = "lockfile";
+const LPCWSTR kPipeName = L"\\\\.\\pipe\\electronAckPipe";
+const DWORD kPipeTimeout = 10000;
+const DWORD kMaxMessageLength = 32 * 1024;
+
+std::unique_ptr<std::vector<uint8_t>> g_ack_data;
+base::OneShotTimer g_ack_timer;
+HANDLE g_write_ack_pipe;
+bool g_write_ack_callback_called = false;
// A helper class that acquires the given |mutex| while the AutoLockMutex is in
// scope.
@@ -80,10 +89,12 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) {
bool ParseCommandLine(const COPYDATASTRUCT* cds,
base::CommandLine* parsed_command_line,
- base::FilePath* current_directory) {
+ base::FilePath* current_directory,
+ std::vector<uint8_t>* parsed_additional_data) {
// We should have enough room for the shortest command (min_message_size)
// and also be a multiple of wchar_t bytes. The shortest command
- // possible is L"START\0\0" (empty current directory and command line).
+ // possible is L"START\0\0" (empty command line, current directory,
+ // and additional data).
static const int min_message_size = 7;
if (cds->cbData < min_message_size * sizeof(wchar_t) ||
cds->cbData % sizeof(wchar_t) != 0) {
@@ -133,11 +144,82 @@ bool ParseCommandLine(const COPYDATASTRUCT* cds,
const std::wstring cmd_line =
msg.substr(second_null + 1, third_null - second_null);
*parsed_command_line = base::CommandLine::FromString(cmd_line);
+
+ const std::wstring::size_type fourth_null =
+ msg.find_first_of(L'\0', third_null + 1);
+ if (fourth_null == std::wstring::npos ||
+ fourth_null == msg.length()) {
+ // No additional data was provided.
+ return true;
+ }
+
+ // Get length of the additional data.
+ const std::wstring additional_data_length_string =
+ msg.substr(third_null + 1, fourth_null - third_null);
+ size_t additional_data_length;
+ base::StringToSizeT(additional_data_length_string, &additional_data_length);
+
+ const std::wstring::size_type fifth_null =
+ msg.find_first_of(L'\0', fourth_null + 1);
+ if (fifth_null == std::wstring::npos ||
+ fifth_null == msg.length()) {
+ LOG(WARNING) << "Invalid format for start command, we need a string in 6 "
+ "parts separated by NULLs";
+ }
+
+ // Get the actual additional data.
+ const std::wstring additional_data =
+ msg.substr(fourth_null + 1, fifth_null - fourth_null);
+ const uint8_t* additional_data_bytes =
+ reinterpret_cast<const uint8_t*>(additional_data.c_str());
+ *parsed_additional_data = std::vector<uint8_t>(additional_data_bytes,
+ additional_data_bytes + additional_data_length);
+
return true;
}
return false;
}
+void StoreAck(const base::span<const uint8_t>* ack_data) {
+ if (ack_data) {
+ g_ack_data = std::make_unique<std::vector<uint8_t>>(ack_data->begin(),
+ ack_data->end());
+ } else {
+ g_ack_data = nullptr;
+ }
+}
+
+void SendBackAck() {
+ // This is the first instance sending the ack back to the second instance.
+ if (!g_write_ack_callback_called) {
+ g_write_ack_callback_called = true;
+ const uint8_t* data_buffer = nullptr;
+ DWORD data_to_send_size = 0;
+ if (g_ack_data) {
+ data_buffer = g_ack_data->data();
+ DWORD ack_data_size = g_ack_data->size() * sizeof(uint8_t);
+ data_to_send_size = (ack_data_size < kMaxMessageLength) ? ack_data_size : kMaxMessageLength;
+ }
+
+ ::ConnectNamedPipe(g_write_ack_pipe, NULL);
+
+ DWORD bytes_written = 0;
+ ::WriteFile(g_write_ack_pipe,
+ (LPCVOID)data_buffer,
+ data_to_send_size,
+ &bytes_written,
+ NULL);
+ DCHECK(bytes_written == data_to_send_size);
+
+ ::FlushFileBuffers(g_write_ack_pipe);
+ ::DisconnectNamedPipe(g_write_ack_pipe);
+
+ if (g_ack_data) {
+ g_ack_data.reset();
+ }
+ }
+}
+
bool ProcessLaunchNotification(
const ProcessSingleton::NotificationCallback& notification_callback,
UINT message,
@@ -151,16 +233,23 @@ bool ProcessLaunchNotification(
// Handle the WM_COPYDATA message from another process.
const COPYDATASTRUCT* cds = reinterpret_cast<COPYDATASTRUCT*>(lparam);
-
base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM);
base::FilePath current_directory;
- if (!ParseCommandLine(cds, &parsed_command_line, &current_directory)) {
+ std::vector<uint8_t> additional_data;
+ if (!ParseCommandLine(cds, &parsed_command_line, &current_directory,
+ &additional_data)) {
*result = TRUE;
return true;
}
- *result = notification_callback.Run(parsed_command_line, current_directory) ?
- TRUE : FALSE;
+ g_write_ack_callback_called = false;
+ *result = notification_callback.Run(parsed_command_line, current_directory,
+ std::move(additional_data),
+ base::BindRepeating(&StoreAck))
+ ? TRUE
+ : FALSE;
+ g_ack_timer.Start(FROM_HERE, base::Seconds(0),
+ base::BindOnce(&SendBackAck));
return true;
}
@@ -261,9 +350,13 @@ bool ProcessSingleton::EscapeVirtualization(
ProcessSingleton::ProcessSingleton(
const std::string& program_name,
const base::FilePath& user_data_dir,
+ const base::span<const uint8_t> additional_data,
bool is_app_sandboxed,
- const NotificationCallback& notification_callback)
+ const NotificationCallback& notification_callback,
+ const NotificationAckCallback& notification_ack_callback)
: notification_callback_(notification_callback),
+ notification_ack_callback_(notification_ack_callback),
+ additional_data_(additional_data),
program_name_(program_name),
is_app_sandboxed_(is_app_sandboxed),
is_virtualized_(false),
@@ -278,6 +371,37 @@ ProcessSingleton::~ProcessSingleton() {
::CloseHandle(lock_file_);
}
+void ReadAck(const ProcessSingleton::NotificationAckCallback& ack_callback) {
+ // We are reading the ack from the first instance.
+ // First, wait for the pipe.
+ ::WaitNamedPipe(kPipeName, NMPWAIT_USE_DEFAULT_WAIT);
+
+ HANDLE read_ack_pipe = ::CreateFile(kPipeName,
+ GENERIC_READ,
+ FILE_SHARE_READ,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL);
+ CHECK(read_ack_pipe != INVALID_HANDLE_VALUE);
+
+ DWORD bytes_read;
+ uint8_t read_ack_buffer[kMaxMessageLength];
+ ::ReadFile(read_ack_pipe,
+ (LPVOID)read_ack_buffer,
+ kMaxMessageLength,
+ &bytes_read,
+ NULL);
+
+ if (!bytes_read) {
+ ack_callback.Run(nullptr);
+ } else {
+ base::span<const uint8_t> out_span(read_ack_buffer, read_ack_buffer + bytes_read);
+ ack_callback.Run(&out_span);
+ }
+ ::CloseHandle(read_ack_pipe);
+}
+
// Code roughly based on Mozilla.
ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
TRACE_EVENT0("startup", "ProcessSingleton::NotifyOtherProcess");
@@ -290,8 +414,9 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
return PROCESS_NONE;
}
- switch (chrome::AttemptToNotifyRunningChrome(remote_window_)) {
+ switch (chrome::AttemptToNotifyRunningChrome(remote_window_, additional_data_)) {
case chrome::NOTIFY_SUCCESS:
+ ReadAck(notification_ack_callback_);
return PROCESS_NOTIFIED;
case chrome::NOTIFY_FAILED:
remote_window_ = NULL;
@@ -429,6 +554,18 @@ bool ProcessSingleton::Create() {
<< "Lock file can not be created! Error code: " << error;
if (lock_file_ != INVALID_HANDLE_VALUE) {
+ // We are the first instance. Create a pipe to send out ack data.
+ ack_pipe_ = ::CreateNamedPipe(kPipeName,
+ PIPE_ACCESS_OUTBOUND,
+ PIPE_TYPE_BYTE | PIPE_REJECT_REMOTE_CLIENTS,
+ PIPE_UNLIMITED_INSTANCES,
+ kMaxMessageLength,
+ 0,
+ kPipeTimeout,
+ NULL);
+ CHECK(ack_pipe_ != INVALID_HANDLE_VALUE);
+ g_write_ack_pipe = ack_pipe_;
+
// Set the window's title to the path of our user data directory so
// other Chrome instances can decide if they should forward to us.
TRACE_EVENT0("startup", "ProcessSingleton::Create:CreateWindow");
@@ -456,6 +593,7 @@ bool ProcessSingleton::Create() {
}
void ProcessSingleton::Cleanup() {
+ ::CloseHandle(ack_pipe_);
}
void ProcessSingleton::OverrideShouldKillRemoteProcessCallbackForTesting(
diff --git a/chrome/browser/win/chrome_process_finder.cc b/chrome/browser/win/chrome_process_finder.cc
index b64ed1d155a30582e48c9cdffcee9d0f25a53a6a..ce851d09d501ebcc6d6c4065e746e869d5275b2b 100644
--- a/chrome/browser/win/chrome_process_finder.cc
+++ b/chrome/browser/win/chrome_process_finder.cc
@@ -36,9 +36,10 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir) {
return base::win::MessageWindow::FindWindow(user_data_dir.value());
}
-NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) {
+NotifyChromeResult AttemptToNotifyRunningChrome(
+ HWND remote_window,
+ const base::span<const uint8_t> additional_data) {
TRACE_EVENT0("startup", "AttemptToNotifyRunningChrome");
-
DCHECK(remote_window);
DWORD process_id = 0;
DWORD thread_id = GetWindowThreadProcessId(remote_window, &process_id);
@@ -50,7 +51,8 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) {
}
// Send the command line to the remote chrome window.
- // Format is "START\0<<<current directory>>>\0<<<commandline>>>".
+ // Format is
+ // "START\0<current-directory>\0<command-line>\0<additional-data-length>\0<additional-data>".
std::wstring to_send(L"START\0", 6); // want the NULL in the string.
base::FilePath cur_dir;
if (!base::GetCurrentDirectory(&cur_dir)) {
@@ -64,6 +66,22 @@ NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window) {
base::CommandLine::ForCurrentProcess()->GetCommandLineString());
to_send.append(L"\0", 1); // Null separator.
+ size_t additional_data_size = additional_data.size_bytes();
+ if (additional_data_size) {
+ // Send over the size, because the reinterpret cast to wchar_t could
+ // add padding.
+ to_send.append(base::UTF8ToWide(base::NumberToString(additional_data_size)));
+ to_send.append(L"\0", 1); // Null separator.
+
+ size_t padded_size = additional_data_size / sizeof(wchar_t);
+ if (additional_data_size % sizeof(wchar_t) != 0) {
+ padded_size++;
+ }
+ to_send.append(reinterpret_cast<const wchar_t*>(additional_data.data()),
+ padded_size);
+ to_send.append(L"\0", 1); // Null separator.
+ }
+
// Allow the current running browser window to make itself the foreground
// window (otherwise it will just flash in the taskbar).
::AllowSetForegroundWindow(process_id);
diff --git a/chrome/browser/win/chrome_process_finder.h b/chrome/browser/win/chrome_process_finder.h
index 5516673cee019f6060077091e59498bf9038cd6e..8edea5079b46c2cba67833114eb9c21d85cfc22d 100644
--- a/chrome/browser/win/chrome_process_finder.h
+++ b/chrome/browser/win/chrome_process_finder.h
@@ -7,6 +7,7 @@
#include <windows.h>
+#include "base/containers/span.h"
#include "base/time/time.h"
namespace base {
@@ -27,7 +28,9 @@ HWND FindRunningChromeWindow(const base::FilePath& user_data_dir);
// Attempts to send the current command line to an already running instance of
// Chrome via a WM_COPYDATA message.
// Returns true if a running Chrome is found and successfully notified.
-NotifyChromeResult AttemptToNotifyRunningChrome(HWND remote_window);
+NotifyChromeResult AttemptToNotifyRunningChrome(
+ HWND remote_window,
+ const base::span<const uint8_t> additional_data);
// Changes the notification timeout to |new_timeout|, returns the old timeout.
base::TimeDelta SetNotificationTimeoutForTesting(base::TimeDelta new_timeout);

View File

@@ -9,10 +9,10 @@ production use cases. This is unlikely to be upstreamed as the change
is entirely in //chrome.
diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
index c1821235df8abd9c0991efeb1d82f8b6075e48e7..a35fc3aa63e6d57ef78ee4690f761060b074ec85 100644
index ff5ee1d7a0f4e333498bf25acbbf49d1ce53b7a1..e98084036c04e9910779670497b1a431d4fee48a 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -52,6 +52,9 @@ namespace {
@@ -51,6 +51,9 @@ namespace {
base::LazyInstance<GURL>::Leaky g_download_url_for_testing =
LAZY_INSTANCE_INITIALIZER;
@@ -22,7 +22,7 @@ index c1821235df8abd9c0991efeb1d82f8b6075e48e7..a35fc3aa63e6d57ef78ee4690f761060
// Close the file.
void CloseDictionary(base::File file) {
base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
@@ -272,6 +275,10 @@ void SpellcheckHunspellDictionary::SetDownloadURLForTesting(const GURL url) {
@@ -271,6 +274,10 @@ void SpellcheckHunspellDictionary::SetDownloadURLForTesting(const GURL url) {
g_download_url_for_testing.Get() = url;
}
@@ -33,7 +33,7 @@ index c1821235df8abd9c0991efeb1d82f8b6075e48e7..a35fc3aa63e6d57ef78ee4690f761060
GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
if (g_download_url_for_testing.Get() != GURL())
return g_download_url_for_testing.Get();
@@ -279,6 +286,9 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
@@ -278,6 +285,9 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
std::string bdict_file = dictionary_file_.path.BaseName().MaybeAsASCII();
DCHECK(!bdict_file.empty());

View File

@@ -7,10 +7,10 @@ Subject: feat: allow embedders to add observers on created hunspell
This patch is used by Electron to implement spellchecker events.
diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
index 80e5807fecbca3d3d3105522418c5f4b4d103f57..002204dbe0b9598b61141cab33b7befdfac077f8 100644
index fb1ce87c18a72deb815b78b2f989fe0a8ebaf0bc..417e89f3ba808d9e599d391d57df0e481afb5522 100644
--- a/chrome/browser/spellchecker/spellcheck_service.cc
+++ b/chrome/browser/spellchecker/spellcheck_service.cc
@@ -469,6 +469,9 @@ void SpellcheckService::LoadDictionaries() {
@@ -468,6 +468,9 @@ void SpellcheckService::LoadDictionaries() {
std::make_unique<SpellcheckHunspellDictionary>(
dictionary, platform_spellcheck_language, context_, this));
hunspell_dictionaries_.back()->AddObserver(this);
@@ -20,7 +20,7 @@ index 80e5807fecbca3d3d3105522418c5f4b4d103f57..002204dbe0b9598b61141cab33b7befd
hunspell_dictionaries_.back()->Load();
}
@@ -521,6 +524,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const {
@@ -520,6 +523,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const {
(!hunspell_dictionaries_.empty() || enable_if_uninitialized);
}

View File

@@ -503,7 +503,7 @@ index 583e3e2525c753a0962d481fc67a3582df75d0e9..9416ec929bebcff7f07088e635376ef2
waiting_on_draw_ack_ = true;
diff --git a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
index df92bab44402330869b44aa76bb40fc20e33b16a..2b3fbaee17c0a8bb7b04cd4c4edb13626dd1bb27 100644
index 4e38e0f49054cef3fd1a712c89608ce39003edeb..427882f8ed0d85c6e4170b213c3a3678b60a62df 100644
--- a/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
+++ b/components/viz/service/frame_sinks/root_compositor_frame_sink_impl.cc
@@ -84,7 +84,8 @@ RootCompositorFrameSinkImpl::Create(
@@ -573,10 +573,10 @@ index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a28549
+ Draw(gfx.mojom.Rect damage_rect) => ();
};
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index b30b9460889b9bb3862f4e28b5f1292a118f2a09..d8f1f921d3e6e74c99d6a22c902f81dfc5bb646e 100644
index 80bff73a5886e8e79d7d91de5e27bc747fcfce02..8bc43d1359fa2551713992d6ccb73949743dde2e 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -81,6 +81,7 @@ class DisplayPrivate;
@@ -83,6 +83,7 @@ class DisplayPrivate;
class ExternalBeginFrameController;
} // namespace mojom
class ContextProvider;
@@ -584,7 +584,7 @@ index b30b9460889b9bb3862f4e28b5f1292a118f2a09..d8f1f921d3e6e74c99d6a22c902f81df
class HostFrameSinkManager;
class LocalSurfaceId;
class RasterContextProvider;
@@ -137,6 +138,16 @@ class COMPOSITOR_EXPORT ContextFactory {
@@ -139,6 +140,16 @@ class COMPOSITOR_EXPORT ContextFactory {
virtual viz::HostFrameSinkManager* GetHostFrameSinkManager() = 0;
};
@@ -601,7 +601,7 @@ index b30b9460889b9bb3862f4e28b5f1292a118f2a09..d8f1f921d3e6e74c99d6a22c902f81df
// Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an
@@ -178,6 +189,9 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
@@ -180,6 +191,9 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();
@@ -611,7 +611,7 @@ index b30b9460889b9bb3862f4e28b5f1292a118f2a09..d8f1f921d3e6e74c99d6a22c902f81df
// Sets the root of the layer tree drawn by this Compositor. The root layer
// must have no parent. The compositor's root layer is reset if the root layer
// is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -466,6 +480,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
@@ -476,6 +490,8 @@ class COMPOSITOR_EXPORT Compositor : public base::PowerSuspendObserver,
std::unique_ptr<PendingBeginFrameArgs> pending_begin_frame_args_;
@@ -621,7 +621,7 @@ index b30b9460889b9bb3862f4e28b5f1292a118f2a09..d8f1f921d3e6e74c99d6a22c902f81df
raw_ptr<Layer> root_layer_ = nullptr;
diff --git a/ui/gfx/ca_layer_params.h b/ui/gfx/ca_layer_params.h
index c5fb29b30b9c5b7483998c567ed9a479d8743939..dc10d78315f76a3914ccd6e2e99af97fa909918b 100644
index 12e115cd6a128d8d150abc786d4d38b1d5119d91..b6320de28750333bee7ee83393849f4eb0a956ac 100644
--- a/ui/gfx/ca_layer_params.h
+++ b/ui/gfx/ca_layer_params.h
@@ -6,6 +6,7 @@
@@ -632,7 +632,7 @@ index c5fb29b30b9c5b7483998c567ed9a479d8743939..dc10d78315f76a3914ccd6e2e99af97f
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gfx_export.h"
@@ -41,6 +42,8 @@ struct GFX_EXPORT CALayerParams {
@@ -51,6 +52,8 @@ struct GFX_EXPORT CALayerParams {
gfx::ScopedRefCountedIOSurfaceMachPort io_surface_mach_port;
#endif

View File

@@ -17,43 +17,43 @@ headers, moving forward we should find a way in upstream to provide
access to these headers for loader clients created on the browser process.
diff --git a/services/network/public/cpp/resource_request.cc b/services/network/public/cpp/resource_request.cc
index 87868727a78223baef9ffd2591f49fced240ef4e..f6a6ff28f33e2d1c065f2abeb96733b2d28a6ea1 100644
index a15e3c4bed344364f9c43e3f0b5c494d58dff789..24e3b291f8c25de2a0b82184fd731538b6586f86 100644
--- a/services/network/public/cpp/resource_request.cc
+++ b/services/network/public/cpp/resource_request.cc
@@ -233,6 +233,7 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const {
do_not_prompt_for_login == request.do_not_prompt_for_login &&
is_main_frame == request.is_main_frame &&
is_outermost_main_frame == request.is_outermost_main_frame &&
transition_type == request.transition_type &&
+ report_raw_headers == request.report_raw_headers &&
previews_state == request.previews_state &&
upgrade_if_insecure == request.upgrade_if_insecure &&
is_revalidating == request.is_revalidating &&
diff --git a/services/network/public/cpp/resource_request.h b/services/network/public/cpp/resource_request.h
index 8b9a7b36f53a4cfcd159ac18c06d1724072013c8..ef0191bae8a07e531ae129cf32b22f4930c5e266 100644
index 2ff43cc1ef683707001bf22c9b030bf6e7223e0f..cfaf9170666f04407adb5738ce6723900d234735 100644
--- a/services/network/public/cpp/resource_request.h
+++ b/services/network/public/cpp/resource_request.h
@@ -156,6 +156,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
@@ -158,6 +158,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
bool do_not_prompt_for_login = false;
bool is_main_frame = false;
bool is_outermost_main_frame = false;
int transition_type = 0;
+ bool report_raw_headers = false;
int previews_state = 0;
bool upgrade_if_insecure = false;
bool is_revalidating = false;
diff --git a/services/network/public/cpp/url_request_mojom_traits.cc b/services/network/public/cpp/url_request_mojom_traits.cc
index 1fcf54cac11c38352e14774cd08bcaa162443e9c..5356da11391d52a8f9aaa57a27616cee6dc0f2b6 100644
index 4f2740ebf2dc4bee423cdbb72cae128f28a03f12..d3f531429598b3666aaba655356155c470e8b645 100644
--- a/services/network/public/cpp/url_request_mojom_traits.cc
+++ b/services/network/public/cpp/url_request_mojom_traits.cc
@@ -209,6 +209,7 @@ bool StructTraits<
out->do_not_prompt_for_login = data.do_not_prompt_for_login();
out->is_main_frame = data.is_main_frame();
out->is_outermost_main_frame = data.is_outermost_main_frame();
out->transition_type = data.transition_type();
+ out->report_raw_headers = data.report_raw_headers();
out->previews_state = data.previews_state();
out->upgrade_if_insecure = data.upgrade_if_insecure();
out->is_revalidating = data.is_revalidating();
diff --git a/services/network/public/cpp/url_request_mojom_traits.h b/services/network/public/cpp/url_request_mojom_traits.h
index 1b8dbc0538d0af843e40edc41505d08f9034f97b..270822eb756090f8a74f34823009942ed21e8616 100644
index 069768e7ca727fc2ad8f5379900ad4a959a87f4f..3e6bc18564e2a3cdbac9af686636f75d64082464 100644
--- a/services/network/public/cpp/url_request_mojom_traits.h
+++ b/services/network/public/cpp/url_request_mojom_traits.h
@@ -269,6 +269,9 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
@@ -67,7 +67,7 @@ index 1b8dbc0538d0af843e40edc41505d08f9034f97b..270822eb756090f8a74f34823009942e
return request.previews_state;
}
diff --git a/services/network/public/mojom/url_request.mojom b/services/network/public/mojom/url_request.mojom
index 79b5d03ded03ced9e6ff4d17d10935004bfb0062..923883fd010f9621c790dd5381a7e1f0cb36e740 100644
index ef3e8e68621402db5a97977f49ac74c438b0a563..aa1c1bcf7ca30adde4c25ed9bd8ed8a70eb919e0 100644
--- a/services/network/public/mojom/url_request.mojom
+++ b/services/network/public/mojom/url_request.mojom
@@ -312,6 +312,9 @@ struct URLRequest {
@@ -103,10 +103,10 @@ index 4c4cc16db82d7434573f7740855fbe72d68815e6..f71290800b6bb51a39b1f86be36f02d6
string mime_type;
diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
index 1530c51f9090ce51de1f3bc495ca83590d6430ab..d053aa813ab53092dcefb81116ff850318f439c2 100644
index c79ad06ecb80ea431bf48c16e413286c768e2316..2a5cce5b467e79df1f34d7318862fd16134b74c3 100644
--- a/services/network/url_loader.cc
+++ b/services/network/url_loader.cc
@@ -470,6 +470,7 @@ URLLoader::URLLoader(
@@ -469,6 +469,7 @@ URLLoader::URLLoader(
mojo::SimpleWatcher::ArmingPolicy::MANUAL,
base::SequencedTaskRunnerHandle::Get()),
per_factory_corb_state_(context.GetMutableCorbState()),
@@ -114,7 +114,7 @@ index 1530c51f9090ce51de1f3bc495ca83590d6430ab..d053aa813ab53092dcefb81116ff8503
devtools_request_id_(request.devtools_request_id),
request_mode_(request.mode),
request_credentials_mode_(request.credentials_mode),
@@ -637,7 +638,7 @@ URLLoader::URLLoader(
@@ -636,7 +637,7 @@ URLLoader::URLLoader(
url_request_->SetRequestHeadersCallback(base::BindRepeating(
&URLLoader::SetRawRequestHeadersAndNotify, base::Unretained(this)));
@@ -123,7 +123,7 @@ index 1530c51f9090ce51de1f3bc495ca83590d6430ab..d053aa813ab53092dcefb81116ff8503
url_request_->SetResponseHeadersCallback(base::BindRepeating(
&URLLoader::SetRawResponseHeaders, base::Unretained(this)));
}
@@ -1408,6 +1409,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
@@ -1427,6 +1428,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
}
response_ = BuildResponseHead();
@@ -144,7 +144,7 @@ index 1530c51f9090ce51de1f3bc495ca83590d6430ab..d053aa813ab53092dcefb81116ff8503
// 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 53822d17b20f4e6d163d0dc84eea6c455254a5f7..c494a63b0c1dcb39120e8aabc84a60ebbf2ff224 100644
index e235b3cc8657e081063709f6d2cd6e0b2e99f2b2..15b77b8648b905711df8551b1645b14dd7d6fd87 100644
--- a/services/network/url_loader.h
+++ b/services/network/url_loader.h
@@ -502,6 +502,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader

View File

@@ -0,0 +1,874 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: VerteDinde <keeleymhammond@gmail.com>
Date: Sun, 8 May 2022 17:21:12 -0700
Subject: feat: replace ad-hoc SetPublicFirstPartySets calls with method in
ContentBrowserClient
Cherry-picked from upstream Chromium. This patch can be removed when the
fix is inherited from the next Chromium roll backport.
This essentially requires
embedders to indicate whether they will
(maybe asynchronously) call SetPublicFirstPartySets during startup, or
not. This makes it easier to initialize First-Party Sets properly, since
it is now done via a pull-based interface rather than a push-based
interface (which would require code in every embedder in order to
set up the First-Party Sets backend). Now, there is a single place (in
content) that handles every embedder that won't need to explicitly call
SetPublicFirstPartySets at some point (e.g. after initializing
Component Updater, in Chrome's case).
Bug: 1321908
Change-Id: I47eaaaf77e548079e1bd6360fd573e877aa79b32
Reviewed-on:
https://chromium-review.googlesource.com/c/chromium/src/+/3623985
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Chris Fredrickson <cfredric@chromium.org>
Cr-Commit-Position: refs/heads/main@{#999047}
Patch-Filename:
feat_move_firstpartysets_to_content_browser_client.patch
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index e07874dc5a2fab83dff0a07d35aeb0cad7a1a67c..9f635870282f0f2a9b8bfaaa59e34f91675dcda3 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1601,10 +1601,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// called inside PostProfileInit and depends on it.
if (!parsed_command_line().HasSwitch(switches::kDisableComponentUpdate)) {
component_updater::RegisterComponentsForUpdate();
- } else {
- // Initialize First-Party Sets even if component updater is disabled.
- content::FirstPartySetsHandler::GetInstance()->SetPublicFirstPartySets(
- base::File());
}
// TODO(stevenjb): Move WIN and MACOSX specific code to appropriate Parts.
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 3943c32ab29e785f401c2a5b31f1f6ed832514f0..939c28a029418bc353795aa1a007508680f42e57 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -6462,6 +6462,12 @@ bool ChromeContentBrowserClient::IsFirstPartySetsEnabled() {
return local_state->GetBoolean(first_party_sets::kFirstPartySetsEnabled);
}
+bool ChromeContentBrowserClient::WillProvidePublicFirstPartySets() {
+ return !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableComponentUpdate) &&
+ base::FeatureList::IsEnabled(features::kFirstPartySets);
+}
+
base::Value::Dict ChromeContentBrowserClient::GetFirstPartySetsOverrides() {
if (!g_browser_process) {
// If browser process doesn't exist (e.g. in minimal mode on Android),
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h
index f0415a5099cdf181ab620fb6400db4f524c2c892..016b8276feeb6c35c88bc779ae84eea38d66f57d 100644
--- a/chrome/browser/chrome_content_browser_client.h
+++ b/chrome/browser/chrome_content_browser_client.h
@@ -772,6 +772,7 @@ class ChromeContentBrowserClient : public content::ContentBrowserClient {
bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override;
bool IsFirstPartySetsEnabled() override;
+ bool WillProvidePublicFirstPartySets() override;
base::Value::Dict GetFirstPartySetsOverrides() override;
bool ShouldPreconnectNavigation(
diff --git a/content/browser/first_party_sets/first_party_set_parser.cc b/content/browser/first_party_sets/first_party_set_parser.cc
index b03570f072f407a1d2c6a58646db0f48a845429d..3ac5c0d206c7910e5ae653004e96780c14c8315d 100644
--- a/content/browser/first_party_sets/first_party_set_parser.cc
+++ b/content/browser/first_party_sets/first_party_set_parser.cc
@@ -323,4 +323,4 @@ FirstPartySetParser::ParseSetsFromEnterprisePolicy(
return absl::nullopt;
}
-} // namespace content
+} // namespace content
\ No newline at end of file
diff --git a/content/browser/first_party_sets/first_party_set_parser.h b/content/browser/first_party_sets/first_party_set_parser.h
index 491a8b508ef0d093f37608d2fde615427b9319df..3f33b1604fecbff0d4db8739ad138d95223b579c 100644
--- a/content/browser/first_party_sets/first_party_set_parser.h
+++ b/content/browser/first_party_sets/first_party_set_parser.h
@@ -102,4 +102,4 @@ class CONTENT_EXPORT FirstPartySetParser {
} // namespace content
-#endif // CONTENT_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SET_PARSER_H_
+#endif // CONTENT_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SET_PARSER_H_
\ No newline at end of file
diff --git a/content/browser/first_party_sets/first_party_sets_handler_impl.cc b/content/browser/first_party_sets/first_party_sets_handler_impl.cc
index e5d277236b6393d35e8cf5a69c7f6d16f3394582..bb6840eecabfab9e9f0ae6b0fdc4e4436d1ea3b1 100644
--- a/content/browser/first_party_sets/first_party_sets_handler_impl.cc
+++ b/content/browser/first_party_sets/first_party_sets_handler_impl.cc
@@ -74,7 +74,8 @@ FirstPartySetsHandler* FirstPartySetsHandler::GetInstance() {
// static
FirstPartySetsHandlerImpl* FirstPartySetsHandlerImpl::GetInstance() {
static base::NoDestructor<FirstPartySetsHandlerImpl> instance(
- GetContentClient()->browser()->IsFirstPartySetsEnabled());
+ GetContentClient()->browser()->IsFirstPartySetsEnabled(),
+ GetContentClient()->browser()->WillProvidePublicFirstPartySets());
return instance.get();
}
@@ -89,8 +90,12 @@ FirstPartySetsHandler::ValidateEnterprisePolicy(
policy, /*out_sets=*/nullptr);
}
-FirstPartySetsHandlerImpl::FirstPartySetsHandlerImpl(bool enabled)
- : enabled_(enabled) {
+FirstPartySetsHandlerImpl::FirstPartySetsHandlerImpl(
+ bool enabled,
+ bool embedder_will_provide_public_sets)
+ : enabled_(enabled),
+ embedder_will_provide_public_sets_(enabled &&
+ embedder_will_provide_public_sets) {
sets_loader_ = std::make_unique<FirstPartySetsLoader>(
base::BindOnce(&FirstPartySetsHandlerImpl::SetCompleteSets,
// base::Unretained(this) is safe here because
@@ -112,12 +117,23 @@ void FirstPartySetsHandlerImpl::Init(const base::FilePath& user_data_dir,
const std::string& flag_value,
SetsReadyOnceCallback on_sets_ready) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(!initialized_);
+ DCHECK(persisted_sets_path_.empty());
+ DCHECK(on_sets_ready_.is_null());
+
+ initialized_ = true;
on_sets_ready_ = std::move(on_sets_ready);
SetPersistedSets(user_data_dir);
- SetManuallySpecifiedSet(flag_value);
- if (!IsEnabled())
+ if (IsEnabled()) {
+ DCHECK(!on_sets_ready_.is_null());
+ sets_loader_->SetManuallySpecifiedSet(flag_value);
+ if (!embedder_will_provide_public_sets_) {
+ sets_loader_->SetComponentSets(base::File());
+ }
+ } else {
SetCompleteSets({});
+ }
}
bool FirstPartySetsHandlerImpl::IsEnabled() const {
@@ -127,16 +143,17 @@ bool FirstPartySetsHandlerImpl::IsEnabled() const {
void FirstPartySetsHandlerImpl::SetPublicFirstPartySets(base::File sets_file) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- if (!IsEnabled()) {
- sets_loader_->DisposeFile(std::move(sets_file));
- return;
- }
+ DCHECK(enabled_);
+ DCHECK(embedder_will_provide_public_sets_);
sets_loader_->SetComponentSets(std::move(sets_file));
}
void FirstPartySetsHandlerImpl::ResetForTesting() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ initialized_ = false;
enabled_ = GetContentClient()->browser()->IsFirstPartySetsEnabled();
+ embedder_will_provide_public_sets_ =
+ GetContentClient()->browser()->WillProvidePublicFirstPartySets();
// Initializes the `sets_loader_` member with a callback to SetCompleteSets
// and the result of content::GetFirstPartySetsOverrides.
@@ -153,19 +170,16 @@ void FirstPartySetsHandlerImpl::ResetForTesting() {
raw_persisted_sets_ = absl::nullopt;
}
-void FirstPartySetsHandlerImpl::SetManuallySpecifiedSet(
- const std::string& flag_value) {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- if (!IsEnabled())
- return;
- sets_loader_->SetManuallySpecifiedSet(flag_value);
-}
-
void FirstPartySetsHandlerImpl::SetPersistedSets(
const base::FilePath& user_data_dir) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(!raw_persisted_sets_.has_value());
+ DCHECK(persisted_sets_path_.empty());
if (user_data_dir.empty()) {
VLOG(1) << "Empty path. Failed loading serialized First-Party Sets file.";
+ // We have to continue, in case the embedder has enabled FPS but has not
+ // provided a directory to store persisted sets.
+ OnReadPersistedSetsFile("");
return;
}
persisted_sets_path_ = user_data_dir.Append(kPersistedFirstPartySetsFileName);
@@ -184,19 +198,36 @@ void FirstPartySetsHandlerImpl::SetPersistedSets(
void FirstPartySetsHandlerImpl::OnReadPersistedSetsFile(
const std::string& raw_persisted_sets) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- DCHECK(!persisted_sets_path_.empty());
+ DCHECK(!raw_persisted_sets_.has_value());
raw_persisted_sets_ = raw_persisted_sets;
UmaHistogramTimes(
- "Cookie.FirstPartySets.InitializationDuration.ReadPersistedSets",
+ "Cookie.FirstPartySets.InitializationDuration.ReadPersistedSets2",
construction_timer_.Elapsed());
- ClearSiteDataOnChangedSetsIfReady();
+
+ if (sets_.has_value()) {
+ ClearSiteDataOnChangedSets();
+
+ if (IsEnabled()) {
+ DCHECK(!on_sets_ready_.is_null());
+ std::move(on_sets_ready_).Run(sets_.value());
+ }
+ }
}
void FirstPartySetsHandlerImpl::SetCompleteSets(
base::flat_map<net::SchemefulSite, net::SchemefulSite> sets) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(!sets_.has_value());
sets_ = std::move(sets);
- ClearSiteDataOnChangedSetsIfReady();
+
+ if (raw_persisted_sets_.has_value()) {
+ ClearSiteDataOnChangedSets();
+
+ if (IsEnabled()) {
+ DCHECK(!on_sets_ready_.is_null());
+ std::move(on_sets_ready_).Run(sets_.value());
+ }
+ }
}
// static
@@ -229,10 +260,10 @@ base::flat_set<net::SchemefulSite> FirstPartySetsHandlerImpl::ComputeSetsDiff(
return result;
}
-void FirstPartySetsHandlerImpl::ClearSiteDataOnChangedSetsIfReady() {
+void FirstPartySetsHandlerImpl::ClearSiteDataOnChangedSets() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- if (!raw_persisted_sets_.has_value() || !sets_.has_value())
- return;
+ DCHECK(sets_.has_value());
+ DCHECK(raw_persisted_sets_.has_value());
base::flat_set<net::SchemefulSite> diff =
ComputeSetsDiff(FirstPartySetParser::DeserializeFirstPartySets(
@@ -241,14 +272,13 @@ void FirstPartySetsHandlerImpl::ClearSiteDataOnChangedSetsIfReady() {
// TODO(shuuran@chromium.org): Implement site state clearing.
- if (!on_sets_ready_.is_null() && IsEnabledAndReady())
- std::move(on_sets_ready_).Run(sets_.value());
-
- base::ThreadPool::PostTask(
- FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
- base::BindOnce(
- &MaybeWriteSetsToDisk, persisted_sets_path_,
- FirstPartySetParser::SerializeFirstPartySets(sets_.value())));
+ if (!persisted_sets_path_.empty()) {
+ base::ThreadPool::PostTask(
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
+ base::BindOnce(
+ &MaybeWriteSetsToDisk, persisted_sets_path_,
+ FirstPartySetParser::SerializeFirstPartySets(sets_.value())));
+ }
}
bool FirstPartySetsHandlerImpl::IsEnabledAndReady() const {
@@ -256,4 +286,4 @@ bool FirstPartySetsHandlerImpl::IsEnabledAndReady() const {
return IsEnabled() && sets_.has_value();
}
-} // namespace content
+} // namespace content
\ No newline at end of file
diff --git a/content/browser/first_party_sets/first_party_sets_handler_impl.h b/content/browser/first_party_sets/first_party_sets_handler_impl.h
index a60adcd16b5b8911965f9a22c2e70b5044150758..829cd96245cbe39eeddecf2e0403f2ba1ab88793 100644
--- a/content/browser/first_party_sets/first_party_sets_handler_impl.h
+++ b/content/browser/first_party_sets/first_party_sets_handler_impl.h
@@ -55,10 +55,9 @@ class CONTENT_EXPORT FirstPartySetsHandlerImpl : public FirstPartySetsHandler {
// persisted sets, since we may still need to clear data from a previous
// invocation of Chromium which had First-Party Sets enabled.
//
- // TODO(https://crbug.com/1309188): Init() should be called in the
- // BrowserMainLoop::PreMainMessageLoopRun(). But just in case it's
- // accidentally called from other places, make sure it's no-op for the
- // following calls.
+ // If First-Party Sets is enabled, `on_sets_ready` must not be null.
+ //
+ // Must be called exactly once.
void Init(const base::FilePath& user_data_dir,
const std::string& flag_value,
SetsReadyOnceCallback on_sets_ready);
@@ -78,6 +77,11 @@ class CONTENT_EXPORT FirstPartySetsHandlerImpl : public FirstPartySetsHandler {
enabled_ = enabled;
}
+ void SetEmbedderWillProvidePublicSetsForTesting(bool will_provide) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ embedder_will_provide_public_sets_ = enabled_ && will_provide;
+ }
+
// Compares the map `old_sets` to `current_sets` and returns the set of sites
// that: 1) were in `old_sets` but are no longer in `current_sets`, i.e. leave
// the FPSs; or, 2) mapped to a different owner site.
@@ -92,41 +96,38 @@ class CONTENT_EXPORT FirstPartySetsHandlerImpl : public FirstPartySetsHandler {
private:
friend class base::NoDestructor<FirstPartySetsHandlerImpl>;
- explicit FirstPartySetsHandlerImpl(bool enabled);
+ FirstPartySetsHandlerImpl(bool enabled,
+ bool embedder_will_provide_public_sets);
// This method reads the persisted First-Party Sets from the file under
- // `user_data_dir`.
+ // `user_data_dir`. Must be called exactly once.
void SetPersistedSets(const base::FilePath& user_data_dir);
- // Stores the read persisted sets in `raw_persisted_sets_`.
+ // Stores the read persisted sets in `raw_persisted_sets_`. Must be called
+ // exactly once.
void OnReadPersistedSetsFile(const std::string& raw_persisted_sets);
- // Parses and sets the First-Party Set that was provided via the
- // `kUseFirstPartySet` flag/switch.
- //
- // Has no effect if `kFirstPartySets` is disabled, or
- // `SetPublicFirstPartySets` is not called.
- void SetManuallySpecifiedSet(const std::string& flag_value);
-
- // Sets the current First-Party Sets data.
+ // Sets the current First-Party Sets data. Must be called exactly once.
void SetCompleteSets(FlattenedSets sets);
- // Checks the required inputs have been received, and if so:
+ // Does the following:
// 1) computes the diff between the `sets_` and the parsed
// `raw_persisted_sets_`;
// 2) clears the site data of the set of sites based on the diff;
- // 3) calls `on_sets_ready_` if conditions are met;
- // 4) writes the current First-Party Sets to the file in
+ // 3) writes the current First-Party Sets to the file in
// `persisted_sets_path_`.
//
// TODO(shuuran@chromium.org): Implement the code to clear site state.
- void ClearSiteDataOnChangedSetsIfReady();
+ void ClearSiteDataOnChangedSets() const;
// Returns true if:
// * First-Party Sets are enabled;
// * `sets_` is ready to be used.
bool IsEnabledAndReady() const;
+ // Whether Init has been called already or not.
+ bool initialized_ = false;
+
// Represents the mapping of site -> site, where keys are members of sets, and
// values are owners of the sets. Owners are explicitly represented as members
// of the set.
@@ -144,6 +145,7 @@ class CONTENT_EXPORT FirstPartySetsHandlerImpl : public FirstPartySetsHandler {
base::FilePath persisted_sets_path_ GUARDED_BY_CONTEXT(sequence_checker_);
bool enabled_ GUARDED_BY_CONTEXT(sequence_checker_);
+ bool embedder_will_provide_public_sets_ GUARDED_BY_CONTEXT(sequence_checker_);
// We use a OnceCallback to ensure we only pass along the sets once
// during Chrome's lifetime (modulo reconfiguring the network service).
@@ -160,4 +162,4 @@ class CONTENT_EXPORT FirstPartySetsHandlerImpl : public FirstPartySetsHandler {
} // namespace content
-#endif // CONTENT_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_HANDLER_IMPL_H_
+#endif // CONTENT_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_HANDLER_IMPL_H_
\ No newline at end of file
diff --git a/content/browser/first_party_sets/first_party_sets_handler_impl_unittest.cc b/content/browser/first_party_sets/first_party_sets_handler_impl_unittest.cc
index 0c0eeda67a8a4bdc9876f5ad3fe78c06c4f18b5d..3e92801eb25e339e6b3a43b5fadab8f1b78b23f9 100644
--- a/content/browser/first_party_sets/first_party_sets_handler_impl_unittest.cc
+++ b/content/browser/first_party_sets/first_party_sets_handler_impl_unittest.cc
@@ -367,14 +367,6 @@ TEST_F(FirstPartySetsHandlerImplDisabledTest, IgnoresValid) {
FAIL(); // Should not be called.
}));
- // Set required inputs to be able to receive the merged sets from
- // FirstPartySetsLoader.
- const std::string input =
- "{\"owner\": \"https://example.test\",\"members\": "
- "[\"https://aaaa.test\"]}";
- ASSERT_TRUE(base::JSONReader::Read(input));
- SetPublicFirstPartySetsAndWait(input);
-
env().RunUntilIdle();
// TODO(shuuran@chromium.org): test site state is cleared.
@@ -397,9 +389,6 @@ TEST_F(FirstPartySetsHandlerImplDisabledTest,
FAIL(); // Should not be called.
}));
- SetPublicFirstPartySetsAndWait(R"({"owner": "https://example.test", )"
- R"("members": ["https://member.test"]})");
-
EXPECT_EQ(
FirstPartySetsHandlerImpl::GetInstance()->GetSetsIfEnabledAndReady(),
absl::nullopt);
@@ -413,11 +402,6 @@ class FirstPartySetsHandlerImplEnabledTest
};
TEST_F(FirstPartySetsHandlerImplEnabledTest, PersistedSetsNotReady) {
- const std::string input = R"({"owner": "https://foo.test", )"
- R"("members": ["https://member2.test"]})";
- ASSERT_TRUE(base::JSONReader::Read(input));
- SetPublicFirstPartySetsAndWait(input);
-
// Empty `user_data_dir` will fail loading persisted sets.
FirstPartySetsHandlerImpl::GetInstance()->Init(
/*user_data_dir=*/{},
@@ -431,6 +415,8 @@ TEST_F(FirstPartySetsHandlerImplEnabledTest, PersistedSetsNotReady) {
}
TEST_F(FirstPartySetsHandlerImplEnabledTest, PublicFirstPartySetsNotReady) {
+ FirstPartySetsHandlerImpl::GetInstance()
+ ->SetEmbedderWillProvidePublicSetsForTesting(true);
ASSERT_TRUE(base::WriteFile(persisted_sets_path_, "{}"));
// Persisted sets are expected to be loaded with the provided path.
@@ -447,6 +433,8 @@ TEST_F(FirstPartySetsHandlerImplEnabledTest, PublicFirstPartySetsNotReady) {
TEST_F(FirstPartySetsHandlerImplEnabledTest,
Successful_PersistedSetsFileNotExist) {
+ FirstPartySetsHandlerImpl::GetInstance()
+ ->SetEmbedderWillProvidePublicSetsForTesting(true);
const std::string input = R"({"owner": "https://foo.test", )"
R"("members": ["https://member2.test"]})";
ASSERT_TRUE(base::JSONReader::Read(input));
@@ -479,6 +467,8 @@ TEST_F(FirstPartySetsHandlerImplEnabledTest,
}
TEST_F(FirstPartySetsHandlerImplEnabledTest, Successful_PersistedSetsEmpty) {
+ FirstPartySetsHandlerImpl::GetInstance()
+ ->SetEmbedderWillProvidePublicSetsForTesting(true);
ASSERT_TRUE(base::WriteFile(persisted_sets_path_, "{}"));
const std::string input = R"({"owner": "https://foo.test", )"
@@ -514,6 +504,8 @@ TEST_F(FirstPartySetsHandlerImplEnabledTest, Successful_PersistedSetsEmpty) {
TEST_F(FirstPartySetsHandlerImplEnabledTest,
GetSetsIfEnabledAndReady_AfterSetsReady) {
+ FirstPartySetsHandlerImpl::GetInstance()
+ ->SetEmbedderWillProvidePublicSetsForTesting(true);
ASSERT_TRUE(base::WriteFile(persisted_sets_path_, "{}"));
const std::string input = R"({"owner": "https://example.test", )"
@@ -549,6 +541,8 @@ TEST_F(FirstPartySetsHandlerImplEnabledTest,
TEST_F(FirstPartySetsHandlerImplEnabledTest,
GetSetsIfEnabledAndReady_BeforeSetsReady) {
+ FirstPartySetsHandlerImpl::GetInstance()
+ ->SetEmbedderWillProvidePublicSetsForTesting(true);
ASSERT_TRUE(base::WriteFile(persisted_sets_path_, "{}"));
// Call GetSetsIfEnabledAndReady before the sets are ready.
diff --git a/content/browser/first_party_sets/first_party_sets_loader.cc b/content/browser/first_party_sets/first_party_sets_loader.cc
index 52acedfde41b85acfc9246121ccfd6e63290270e..c229815ff14160c4f325fb51473e3b4baf5a9891 100644
--- a/content/browser/first_party_sets/first_party_sets_loader.cc
+++ b/content/browser/first_party_sets/first_party_sets_loader.cc
@@ -20,6 +20,7 @@
#include "base/strings/string_split.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
+#include "content/browser/first_party_sets/addition_overlaps_union_find.h"
#include "content/browser/first_party_sets/first_party_set_parser.h"
#include "net/base/schemeful_site.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@@ -66,6 +67,37 @@ std::string ReadSetsFile(base::File sets_file) {
return base::ReadStreamToString(file.get(), &raw_sets) ? raw_sets : "";
}
+// Creates a set of SchemefulSites present with the given list of SingleSets.
+base::flat_set<net::SchemefulSite> FlattenSingleSetList(
+ const std::vector<content::FirstPartySetsLoader::SingleSet>& sets) {
+ std::vector<net::SchemefulSite> sites;
+ for (const content::FirstPartySetsLoader::SingleSet& set : sets) {
+ sites.push_back(set.first);
+ sites.insert(sites.end(), set.second.begin(), set.second.end());
+ }
+ return sites;
+}
+
+// Populates the `policy_set_overlaps` out-parameter by checking
+// `existing_sets`. If `site` is equal to an existing site e in `sets`, then
+// `policy_set_index` will be added to the list of set indices at
+// `policy_set_overlaps`[e].
+void AddIfPolicySetOverlaps(
+ const net::SchemefulSite& site,
+ size_t policy_set_index,
+ FirstPartySetsLoader::FlattenedSets existing_sets,
+ base::flat_map<net::SchemefulSite, base::flat_set<size_t>>&
+ policy_set_overlaps) {
+ // Check `site` for membership in `existing_sets`.
+ if (auto it = existing_sets.find(site); it != existing_sets.end()) {
+ // Add the index of `site`'s policy set to the list of policy set indices
+ // that also overlap with site_owner.
+ auto [site_and_sets, inserted] =
+ policy_set_overlaps.insert({it->second, {}});
+ site_and_sets->second.insert(policy_set_index);
+ }
+}
+
} // namespace
FirstPartySetsLoader::FirstPartySetsLoader(
@@ -89,7 +121,7 @@ void FirstPartySetsLoader::SetManuallySpecifiedSet(
manually_specified_set_ = {CanonicalizeSet(base::SplitString(
flag_value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY))};
UmaHistogramTimes(
- "Cookie.FirstPartySets.InitializationDuration.ReadCommandLineSet",
+ "Cookie.FirstPartySets.InitializationDuration.ReadCommandLineSet2",
construction_timer_.Elapsed());
MaybeFinishLoading();
@@ -127,7 +159,7 @@ void FirstPartySetsLoader::OnReadSetsFile(const std::string& raw_sets) {
component_sets_parse_progress_ = Progress::kFinished;
UmaHistogramTimes(
- "Cookie.FirstPartySets.InitializationDuration.ReadComponentSets",
+ "Cookie.FirstPartySets.InitializationDuration.ReadComponentSets2",
construction_timer_.Elapsed());
MaybeFinishLoading();
}
@@ -144,33 +176,141 @@ void FirstPartySetsLoader::DisposeFile(base::File sets_file) {
}
}
+std::vector<FirstPartySetsLoader::SingleSet>
+FirstPartySetsLoader::NormalizeAdditionSets(
+ const FlattenedSets& existing_sets,
+ const std::vector<SingleSet>& addition_sets) {
+ // Create a mapping from an owner site in `existing_sets` to all policy sets
+ // that intersect with the set that it owns.
+ base::flat_map<net::SchemefulSite, base::flat_set<size_t>>
+ policy_set_overlaps;
+ for (size_t set_idx = 0; set_idx < addition_sets.size(); set_idx++) {
+ const net::SchemefulSite& owner = addition_sets[set_idx].first;
+ AddIfPolicySetOverlaps(owner, set_idx, existing_sets, policy_set_overlaps);
+ for (const net::SchemefulSite& member : addition_sets[set_idx].second) {
+ AddIfPolicySetOverlaps(member, set_idx, existing_sets,
+ policy_set_overlaps);
+ }
+ }
+
+ AdditionOverlapsUnionFind union_finder(addition_sets.size());
+ for (auto& [public_site, policy_set_indices] : policy_set_overlaps) {
+ // Union together all overlapping policy sets to determine which one will
+ // take ownership.
+ for (size_t representative : policy_set_indices) {
+ union_finder.Union(*policy_set_indices.begin(), representative);
+ }
+ }
+
+ // The union-find data structure now knows which policy set should be given
+ // the role of representative for each entry in policy_set_overlaps.
+ // AdditionOverlapsUnionFind::SetsMapping returns a map from representative
+ // index to list of its children.
+ std::vector<SingleSet> normalized_additions;
+ for (auto& [rep, children] : union_finder.SetsMapping()) {
+ SingleSet normalized = addition_sets[rep];
+ for (size_t child_set_idx : children) {
+ // Update normalized to absorb the child_set_idx-th addition set.
+ const SingleSet& child_set = addition_sets[child_set_idx];
+ normalized.second.insert(child_set.first);
+ normalized.second.insert(child_set.second.begin(),
+ child_set.second.end());
+ }
+ normalized_additions.push_back(normalized);
+ }
+ return normalized_additions;
+}
+
void FirstPartySetsLoader::ApplyManuallySpecifiedSet() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- DCHECK_EQ(component_sets_parse_progress_, Progress::kFinished);
- DCHECK(manually_specified_set_.has_value());
+ DCHECK(HasAllInputs());
if (!manually_specified_set_.value().has_value())
return;
+ ApplyReplacementOverrides({manually_specified_set_->value()});
+ RemoveAllSingletons();
+}
+
+void FirstPartySetsLoader::ApplyReplacementOverrides(
+ const std::vector<SingleSet>& override_sets) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(HasAllInputs());
+
+ base::flat_set<net::SchemefulSite> all_override_sites =
+ FlattenSingleSetList(override_sets);
+
+ // Erase the intersection between |sets_| and the list of |override_sets| and
+ // any members whose owner was in the intersection.
+ base::EraseIf(
+ sets_, [&all_override_sites](
+ const std::pair<net::SchemefulSite, net::SchemefulSite>& p) {
+ return all_override_sites.contains(p.first) ||
+ all_override_sites.contains(p.second);
+ });
+
+ // Next, we must add each site in the override_sets to |sets_|.
+ for (auto& [owner, members] : override_sets) {
+ sets_.emplace(owner, owner);
+ for (const net::SchemefulSite& member : members) {
+ sets_.emplace(member, owner);
+ }
+ }
+}
+
+void FirstPartySetsLoader::ApplyAdditionOverrides(
+ const std::vector<SingleSet>& new_sets) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(HasAllInputs());
+
+ if (new_sets.empty())
+ return;
- const net::SchemefulSite& manual_owner =
- manually_specified_set_.value()->first;
- const base::flat_set<net::SchemefulSite>& manual_members =
- manually_specified_set_.value()->second;
+ std::vector<SingleSet> normalized_additions =
+ NormalizeAdditionSets(sets_, new_sets);
- const auto was_manually_provided =
- [&manual_members, &manual_owner](const net::SchemefulSite& site) {
- return site == manual_owner || manual_members.contains(site);
- };
+ FlattenedSets flattened_additions;
+ for (const auto& [owner, members] : normalized_additions) {
+ for (const net::SchemefulSite& member : members)
+ flattened_additions.emplace(member, owner);
+ flattened_additions.emplace(owner, owner);
+ }
- // Erase the intersection between the manually-specified set and the
- // CU-supplied set, and any members whose owner was in the intersection.
- base::EraseIf(sets_, [&was_manually_provided](const auto& p) {
- return was_manually_provided(p.first) || was_manually_provided(p.second);
- });
+ // Identify intersections between addition sets and existing sets. This will
+ // be used to reparent existing sets if they intersect with an addition set.
+ //
+ // Since we reparent every member of an existing set (regardless of whether
+ // the intersection was via one of its members or its owner), we just keep
+ // track of the set itself, via its owner.
+ base::flat_map<net::SchemefulSite, net::SchemefulSite> owners_in_intersection;
+ for (const auto& [site, owner] : flattened_additions) {
+ // Found an overlap with an existing set. Add the existing owner to the
+ // map.
+ if (auto it = sets_.find(site); it != sets_.end()) {
+ owners_in_intersection[it->second] = owner;
+ }
+ }
+
+ // Update the (site, owner) mappings in sets_ such that if owner is in the
+ // intersection, then the site is mapped to owners_in_intersection[owner].
+ //
+ // This reparents existing sets to their owner given by the normalized
+ // addition sets.
+ for (auto& [site, owner] : sets_) {
+ if (auto owner_entry = owners_in_intersection.find(owner);
+ owner_entry != owners_in_intersection.end()) {
+ owner = owner_entry->second;
+ }
+ }
- // Now remove singleton sets. We already removed any sites that were part
- // of the intersection, or whose owner was part of the intersection. This
- // leaves sites that *are* owners, which no longer have any (other)
- // members.
+ // Since the intersection between sets_ and flattened_additions has already
+ // been updated above, we can insert flattened_additions into sets_ without
+ // affecting any existing mappings in sets_.
+ sets_.insert(flattened_additions.begin(), flattened_additions.end());
+}
+
+void FirstPartySetsLoader::RemoveAllSingletons() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ // Now remove singleton sets, which are sets that just contain sites that
+ // *are* owners, but no longer have any (other) members.
std::set<net::SchemefulSite> owners_with_members;
for (const auto& it : sets_) {
if (it.first != it.second)
@@ -179,21 +319,29 @@ void FirstPartySetsLoader::ApplyManuallySpecifiedSet() {
base::EraseIf(sets_, [&owners_with_members](const auto& p) {
return p.first == p.second && !base::Contains(owners_with_members, p.first);
});
+}
- // Next, we must add the manually-added set to the parsed value.
- for (const net::SchemefulSite& member : manual_members) {
- sets_.emplace(member, manual_owner);
- }
- sets_.emplace(manual_owner, manual_owner);
+void FirstPartySetsLoader::ApplyAllPolicyOverrides() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(HasAllInputs());
+ ApplyReplacementOverrides(policy_overrides_.replacements);
+ ApplyAdditionOverrides(policy_overrides_.additions);
+ RemoveAllSingletons();
}
void FirstPartySetsLoader::MaybeFinishLoading() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- if (component_sets_parse_progress_ != Progress::kFinished ||
- !manually_specified_set_.has_value())
+ if (!HasAllInputs())
return;
ApplyManuallySpecifiedSet();
+ ApplyAllPolicyOverrides();
std::move(on_load_complete_).Run(std::move(sets_));
}
-} // namespace content
+bool FirstPartySetsLoader::HasAllInputs() const {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ return component_sets_parse_progress_ == Progress::kFinished &&
+ manually_specified_set_.has_value();
+}
+
+} // namespace content
\ No newline at end of file
diff --git a/content/browser/first_party_sets/first_party_sets_loader.h b/content/browser/first_party_sets/first_party_sets_loader.h
index c27d2300c4c3533df91a8e814e89827bbd7d72ae..8588fe5f9922b36c9fe8e16ac16d02ccf00c8723 100644
--- a/content/browser/first_party_sets/first_party_sets_loader.h
+++ b/content/browser/first_party_sets/first_party_sets_loader.h
@@ -57,6 +57,19 @@ class CONTENT_EXPORT FirstPartySetsLoader {
// Close the file on thread pool that allows blocking.
void DisposeFile(base::File sets_file);
+ // Handles addition sets which overlap by intersecting with the same existing
+ // set, known as a transitive-overlap.
+ //
+ // This uses a Union-Find algorithm to select the earliest-provided addition
+ // set as the representative of all other addition sets that
+ // transitively-overlap with it.
+ //
+ // The "earliest-provided" tie-breaker is determined using a set's index in
+ // `addition_sets`.
+ static std::vector<SingleSet> NormalizeAdditionSets(
+ const FlattenedSets& existing_sets,
+ const std::vector<SingleSet>& addition_sets);
+
private:
// Parses the contents of `raw_sets` as a collection of First-Party Set
// declarations, and assigns to `sets_`.
@@ -67,10 +80,42 @@ class CONTENT_EXPORT FirstPartySetsLoader {
// `SetManuallySpecifiedSet`, and the public sets via `SetComponentSets`.
void ApplyManuallySpecifiedSet();
+ // Removes the intersection between `sets_` and `override_sets` from the
+ // `sets_` member variable, and then adds the `override_sets` into `sets_`.
+ void ApplyReplacementOverrides(const std::vector<SingleSet>& override_sets);
+
+ // Updates the intersection between `sets_` and `override_sets` within the
+ // `sets_` member variable, and then adds the `override_sets` into
+ // `sets_`.
+ //
+ // The applied update ensures that invariants of First-Party Sets are
+ // maintained, and that all sets in sets_ are disjoint.
+ //
+ // This will add in the `override_sets` into `sets_` without removing
+ // any existing sites from the list of First-Party Sets.
+ void ApplyAdditionOverrides(const std::vector<SingleSet>& override_sets);
+
+ // Removes all singletons (owners that have no members) from sets_.
+ void RemoveAllSingletons();
+
+ // Applies the First-Party Sets overrides provided by policy.
+ //
+ // Must not be called until the loader has already received the public sets
+ // via `SetComponentSets` and the CLI-provided sets have been applied to
+ // `sets_`.
+ //
+ // Applies "Replacement" overrides before applying "Addition" overrides.
+ void ApplyAllPolicyOverrides();
+
// Checks the required inputs have been received, and if so, invokes the
// callback `on_load_complete_`, after merging sets appropriately.
void MaybeFinishLoading();
+ // Returns true if all sources are present (Component Updater sets, CLI set,
+ // and Policy sets). The Policy sets are provided at construction time, so
+ // this effectively checks that the other two sources are ready.
+ bool HasAllInputs() const;
+
// Represents the mapping of site -> site, where keys are members of sets,
// and values are owners of the sets (explicitly including an entry of owner
// -> owner).
@@ -117,4 +162,4 @@ class CONTENT_EXPORT FirstPartySetsLoader {
} // namespace content
-#endif // CONTENT_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_LOADER_H_
+#endif // CONTENT_BROWSER_FIRST_PARTY_SETS_FIRST_PARTY_SETS_LOADER_H_
\ No newline at end of file
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
index 16fb4946cb3ea2d097e8ed05bb340cc3f0782ed6..b751bf43d41a149579047faeec958646ecc3a5e0 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -1327,6 +1327,10 @@ bool ContentBrowserClient::IsFirstPartySetsEnabled() {
return base::FeatureList::IsEnabled(features::kFirstPartySets);
}
+bool ContentBrowserClient::WillProvidePublicFirstPartySets() {
+ return false;
+}
+
base::Value::Dict ContentBrowserClient::GetFirstPartySetsOverrides() {
return base::Value::Dict();
}
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 4db1e6c2dbea27249ca15d5660b7fcd8c6736ad1..8aac2a95a3ac66f0b0c180f46ec29ca7341a1d4c 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -2227,6 +2227,16 @@ class CONTENT_EXPORT ContentBrowserClient {
// should not change in a single browser session.
virtual bool IsFirstPartySetsEnabled();
+ // Returns true iff the embedder will provide a list of First-Party Sets via
+ // content::FirstPartySetsHandler::SetPublicFirstPartySets during startup, at
+ // some point. If `IsFirstPartySetsEnabled()` returns false, this method will
+ // still be called, but its return value will be ignored.
+ //
+ // If this method returns false but `IsFirstPartySetsEnabled()` returns true
+ // (e.g. in tests), an empty list will be used instead of waiting for the
+ // embedder to call content::FirstPartySetsHandler::SetPublicFirstPartySets.
+ virtual bool WillProvidePublicFirstPartySets();
+
// Returns a base::Value::Dict containing the value of the First-Party Sets
// Overrides enterprise policy.
// If the policy was not present or it was invalid, this returns an empty
diff --git a/content/public/browser/first_party_sets_handler.h b/content/public/browser/first_party_sets_handler.h
index 8bd62717732a4afe1e8c02fd5ceb39bd1790e3e0..3ff5dea5612fe3329c7c612818f1436a980ea9e3 100644
--- a/content/public/browser/first_party_sets_handler.h
+++ b/content/public/browser/first_party_sets_handler.h
@@ -72,7 +72,9 @@ class CONTENT_EXPORT FirstPartySetsHandler {
//
// Embedder should call this method as early as possible during browser
// startup if First-Party Sets are enabled, since no First-Party Sets queries
- // are answered until initialization is complete.
+ // are answered until initialization is complete. Must not be called if
+ // `ContentBrowserClient::WillProvidePublicFirstPartySets` returns false or
+ // `ContentBrowserClient::IsFrstpartySetsEnabled` returns false.
virtual void SetPublicFirstPartySets(base::File sets_file) = 0;
// Resets the state on the instance for testing.
diff --git a/content/shell/browser/shell_browser_main_parts.cc b/content/shell/browser/shell_browser_main_parts.cc
index 89040432c9f56d8285d8e9f59e1e0280abc25199..bd412789695f49253f67f237b2a92b8dee298e7a 100644
--- a/content/shell/browser/shell_browser_main_parts.cc
+++ b/content/shell/browser/shell_browser_main_parts.cc
@@ -189,8 +189,6 @@ int ShellBrowserMainParts::PreMainMessageLoopRun() {
net::NetModule::SetResourceProvider(PlatformResourceProvider);
ShellDevToolsManagerDelegate::StartHttpHandler(browser_context_.get());
InitializeMessageLoopContext();
- // The First-Party Sets feature always expects to be initialized
- FirstPartySetsHandler::GetInstance()->SetPublicFirstPartySets(base::File());
return 0;
}

View File

@@ -0,0 +1,149 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Mon, 25 Oct 2021 21:45:57 +0200
Subject: fix: adapt exclusive_access for electron needs
This patch is necessary in order to properly enable
navigator.keyboard.{(un)?lock}() functionality. We don't have a concept
of PermissionManager nor of a Profile, so this would not affect usage of
the API.
We also need to ensure that NotifyExclusiveTabAccessLost is called
on all platforms in FullscreenController::ExitFullscreenModeInternal()
and not just macOS, since Electron's native window impls report state
change fairly instantly as well, and so pressing escape won't work on
Linux or Windows to un-fullscreen in some circumstances without this
change.
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
index 467fed776d390e1a10075d62dab75fd8a6789627..d6f3c20fabee755373add6ee1e5722c106204e42 100644
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
@@ -16,12 +16,16 @@
#include "build/build_config.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
#include "chrome/browser/profiles/profile.h"
+#if 0
#include "chrome/browser/ui/blocked_content/popunder_preventer.h"
+#endif
#include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
#include "chrome/browser/ui/exclusive_access/fullscreen_within_tab_helper.h"
+#if 0
#include "chrome/browser/ui/status_bubble.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
+#endif
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
@@ -164,6 +168,7 @@ void FullscreenController::EnterFullscreenModeForTab(
return;
}
+#if 0
if (base::FeatureList::IsEnabled(
blink::features::kWindowPlacementFullscreenCompanionWindow)) {
if (!popunder_preventer_)
@@ -171,6 +176,7 @@ void FullscreenController::EnterFullscreenModeForTab(
else
popunder_preventer_->WillActivateWebContents(web_contents);
}
+#endif
// Keep the current state. |SetTabWithExclusiveAccess| may change the return
// value of |IsWindowFullscreenForTabOrPending|.
@@ -220,7 +226,9 @@ void FullscreenController::EnterFullscreenModeForTab(
}
void FullscreenController::ExitFullscreenModeForTab(WebContents* web_contents) {
+#if 0
popunder_preventer_.reset();
+#endif
if (MaybeToggleFullscreenWithinTab(web_contents, false)) {
// During tab capture of fullscreen-within-tab views, the browser window
@@ -275,11 +283,13 @@ void FullscreenController::ExitFullscreenModeForTab(WebContents* web_contents) {
void FullscreenController::FullscreenTabOpeningPopup(
content::WebContents* opener,
content::WebContents* popup) {
+#if 0
DCHECK(base::FeatureList::IsEnabled(
blink::features::kWindowPlacementFullscreenCompanionWindow));
DCHECK_EQ(exclusive_access_tab(), opener);
DCHECK(popunder_preventer_);
popunder_preventer_->AddPotentialPopunder(popup);
+#endif
}
void FullscreenController::OnTabDeactivated(
@@ -429,17 +439,15 @@ void FullscreenController::EnterFullscreenModeInternal(
// Do not enter fullscreen mode if disallowed by pref. This prevents the user
// from manually entering fullscreen mode and also disables kiosk mode on
// desktop platforms.
- if (!exclusive_access_manager()
- ->context()
- ->GetProfile()
- ->GetPrefs()
- ->GetBoolean(prefs::kFullscreenAllowed)) {
+ auto* profile = exclusive_access_manager()->context()->GetProfile();
+ if (!profile || !profile->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed))
return;
- }
#endif
toggled_into_fullscreen_ = true;
+#if 0
bool entering_tab_fullscreen = option == TAB && !tab_fullscreen_;
+#endif
GURL url;
if (option == TAB) {
url = GetRequestingOrigin();
@@ -449,6 +457,7 @@ void FullscreenController::EnterFullscreenModeInternal(
url = extension_caused_fullscreen_;
}
+#if 0
if (option == TAB && display_id != display::kInvalidDisplayId) {
// Check, but do not prompt, for permission to request a specific screen.
// Sites generally need permission to get the display id in the first place.
@@ -466,6 +475,7 @@ void FullscreenController::EnterFullscreenModeInternal(
GetDisplayId(WebContents::FromRenderFrameHost(requesting_frame));
}
}
+#endif
if (option == BROWSER)
base::RecordAction(base::UserMetricsAction("ToggleFullscreen"));
@@ -492,12 +502,12 @@ void FullscreenController::ExitFullscreenModeInternal() {
RecordExitingUMA();
toggled_into_fullscreen_ = false;
-#if BUILDFLAG(IS_MAC)
- // Mac windows report a state change instantly, and so we must also clear
+
+ // Electron native windows report a state change instantly, and so we must also clear
// state_prior_to_tab_fullscreen_ to match them else other logic using
// state_prior_to_tab_fullscreen_ will be incorrect.
NotifyTabExclusiveAccessLost();
-#endif
+
exclusive_access_manager()->context()->ExitFullscreen();
extension_caused_fullscreen_ = GURL();
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.h b/chrome/browser/ui/exclusive_access/fullscreen_controller.h
index 58a1ff5fb9fecd8c85905045ba43f43f0c63c2bb..15f868ac651c05eae6505adb80f2b4573a1166ef 100644
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.h
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.h
@@ -224,10 +224,12 @@ class FullscreenController : public ExclusiveAccessControllerBase {
// Used in testing to set the state to tab fullscreen.
bool is_tab_fullscreen_for_testing_ = false;
+#if 0
// Tracks related popups that lost activation or were shown without activation
// during content fullscreen sessions. This also activates the popups when
// fullscreen exits, to prevent sites from creating persisent popunders.
std::unique_ptr<PopunderPreventer> popunder_preventer_;
+#endif
base::ObserverList<FullscreenObserver> observer_list_;

View File

@@ -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 37bb1e9788a251b3f2c79b5272d4a44c22b707b3..29c3104308e9e64d0ab99bdfae00479f8e1bfaa1 100644
index 9e38d55d7156986e48ed6dcb3522d77358bfdb75..01ff95be00b3911749f66a136b2b5a6c02156bd3 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -3597,6 +3597,21 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
@@ -3596,6 +3596,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);

View File

@@ -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 2e370bf7fd61d75677cfc84798ba543a48f3bc19..fc8f471745c8daf30679df1ffb994febe62cfbea 100644
index 22f7a86817fe4a2dc39913db349e81d93eef4874..c9509d84e25fd88d6ef13933099d582561fe5660 100644
--- a/chrome/browser/resources/pdf/pdf_viewer.ts
+++ b/chrome/browser/resources/pdf/pdf_viewer.ts
@@ -855,26 +855,12 @@ export class PDFViewerElement extends PDFViewerBaseElement {
@@ -858,26 +858,12 @@ export class PDFViewerElement extends PDFViewerBaseElement {
dataArray = [result.dataToSave];
}
@@ -48,7 +48,7 @@ index 2e370bf7fd61d75677cfc84798ba543a48f3bc19..fc8f471745c8daf30679df1ffb994feb
}
/**
@@ -982,30 +968,12 @@ export class PDFViewerElement extends PDFViewerBaseElement {
@@ -985,30 +971,12 @@ export class PDFViewerElement extends PDFViewerBaseElement {
fileName = fileName + '.pdf';
}

View File

@@ -50,10 +50,10 @@ 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 11a7b2902490986ba2462f92c3b3e5ae1b1a127f..32d591621c7206affab50ef061aa565527d5952f 100644
index 1f18714dd0c79359173f8e9204b9314a92e3b2a8..068570dba8673d2b0af674f556465abda2ed16f5 100644
--- a/services/device/device_service.cc
+++ b/services/device/device_service.cc
@@ -159,7 +159,7 @@ DeviceService::~DeviceService() {
@@ -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.

View File

@@ -8,10 +8,10 @@ we invoke it in order to expose contents.decrementCapturerCount([stayHidden, sta
to users. We should try to upstream this.
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 55224f960151b0cae23b2a49d755eace630e9e3a..86ab5a5e5e3e881fdaf3528640f097493123da74 100644
index 2a29af8d9aa67768ec521e87190174397a25b722..7a5ce3038427756c26e38c91c5b3211a9a8999dd 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -1827,7 +1827,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
@@ -1828,7 +1828,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
// IncrementCapturerCount() is destructed.
void DecrementCapturerCount(bool stay_hidden,
bool stay_awake,
@@ -21,7 +21,7 @@ index 55224f960151b0cae23b2a49d755eace630e9e3a..86ab5a5e5e3e881fdaf3528640f09749
// Calculates the PageVisibilityState for |visibility|, taking the capturing
// state into account.
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index d159f44dc855fee799f7b97b59a2a4e64631e7b4..b583fb7ff191d5dfce4b8fee5f06e074b3a6ea4f 100644
index 2f14f906b51ce73a69cd780d70ad6264285138ac..b14695646fe75d213b4affa60a6d775ce2474238 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -673,6 +673,10 @@ class WebContents : public PageNavigator,

View File

@@ -1,51 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Mon, 25 Oct 2021 21:45:57 +0200
Subject: fix: patch out permissions checks in exclusive_access
This patch is necessary in order to properly enable
navigator.keyboard.{(un)?lock}() functionality. We don't have a concept
of PermissionManager nor of a Profile, so this would not affect usage of
the API.
We might consider potentially using our own permissions handler,
but it's not strictly necessary for this API to work to spec.
Profile check has been upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3247196
diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
index 8d6f8aedab475c1a553949bfcba3753ebed87778..e379e4995b0812be5970cf9741a00e4f99dea3f1 100644
--- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
+++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
@@ -384,13 +384,9 @@ void FullscreenController::EnterFullscreenModeInternal(
// Do not enter fullscreen mode if disallowed by pref. This prevents the user
// from manually entering fullscreen mode and also disables kiosk mode on
// desktop platforms.
- if (!exclusive_access_manager()
- ->context()
- ->GetProfile()
- ->GetPrefs()
- ->GetBoolean(prefs::kFullscreenAllowed)) {
+ auto* profile = exclusive_access_manager()->context()->GetProfile();
+ if (!profile || !profile->GetPrefs()->GetBoolean(prefs::kFullscreenAllowed))
return;
- }
#endif
toggled_into_fullscreen_ = true;
@@ -403,6 +399,7 @@ void FullscreenController::EnterFullscreenModeInternal(
url = extension_caused_fullscreen_;
}
+#if 0
if (display_id != display::kInvalidDisplayId) {
// Check, but do not prompt, for permission to request a specific screen.
// Sites generally need permission to get the display id in the first place.
@@ -415,6 +412,7 @@ void FullscreenController::EnterFullscreenModeInternal(
display_id = display::kInvalidDisplayId;
}
}
+#endif
if (option == BROWSER)
base::RecordAction(base::UserMetricsAction("ToggleFullscreen"));

View File

@@ -7,10 +7,10 @@ This tweaks Chrome's Accessibility support at chrome://accessibility
to make it usable from Electron by removing Profile references.
diff --git a/chrome/browser/accessibility/accessibility_ui.cc b/chrome/browser/accessibility/accessibility_ui.cc
index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b90008d9b 100644
index ee30fddfeb034d14ae05cb5957026f65f32a4fd4..aa38a6e0cc4c0ac57469bb67c85dae3b8ce19bc2 100644
--- a/chrome/browser/accessibility/accessibility_ui.cc
+++ b/chrome/browser/accessibility/accessibility_ui.cc
@@ -20,7 +20,10 @@
@@ -21,7 +21,10 @@
#include "base/values.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@@ -21,7 +21,7 @@ index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/dev_ui_browser_resources.h"
@@ -49,9 +52,11 @@
@@ -50,9 +53,11 @@
#include "ui/views/accessibility/view_accessibility.h"
#if !BUILDFLAG(IS_ANDROID)
@@ -33,7 +33,7 @@ index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b
#include "ui/views/accessibility/widget_ax_tree_id_map.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
@@ -163,7 +168,7 @@ std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(
@@ -164,7 +169,7 @@ std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(
accessibility_mode);
}
@@ -42,7 +42,7 @@ index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b
std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(Browser* browser) {
std::unique_ptr<base::DictionaryValue> target_data(
new base::DictionaryValue());
@@ -202,7 +207,9 @@ void HandleAccessibilityRequestCallback(
@@ -203,7 +208,9 @@ void HandleAccessibilityRequestCallback(
DCHECK(ShouldHandleAccessibilityRequestCallback(path));
base::DictionaryValue data;
@@ -52,7 +52,7 @@ index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b
ui::AXMode mode =
content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode();
bool is_native_enabled = content::BrowserAccessibilityState::GetInstance()
@@ -236,7 +243,7 @@ void HandleAccessibilityRequestCallback(
@@ -237,7 +244,7 @@ void HandleAccessibilityRequestCallback(
data.SetBoolKey(kViewsAccessibility,
features::IsAccessibilityTreeForViewsEnabled());
@@ -61,7 +61,7 @@ index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b
data.SetStringKey(kInternal, show_internal ? kOn : kOff);
std::unique_ptr<base::ListValue> rvh_list(new base::ListValue());
@@ -271,12 +278,12 @@ void HandleAccessibilityRequestCallback(
@@ -272,12 +279,12 @@ void HandleAccessibilityRequestCallback(
data.Set(kPagesField, std::move(rvh_list));
std::unique_ptr<base::ListValue> browser_list(new base::ListValue());
@@ -76,7 +76,7 @@ index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b
data.Set(kBrowsersField, std::move(browser_list));
std::unique_ptr<base::ListValue> widgets_list(new base::ListValue());
@@ -493,8 +500,10 @@ void AccessibilityUIMessageHandler::SetGlobalFlag(const base::ListValue* args) {
@@ -494,8 +501,10 @@ void AccessibilityUIMessageHandler::SetGlobalFlag(const base::ListValue* args) {
AllowJavascript();
if (flag_name_str == kInternal) {
@@ -87,7 +87,7 @@ index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b
return;
}
@@ -601,10 +610,12 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
@@ -602,10 +611,12 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
AXPropertyFilter::ALLOW_EMPTY);
AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
@@ -101,7 +101,7 @@ index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b
result->SetStringKey(kTreeField, accessibility_contents);
FireWebUIListener(request_type, *(result.get()));
}
@@ -629,6 +640,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
@@ -630,6 +641,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
AXPropertyFilter::ALLOW_EMPTY);
AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
@@ -109,7 +109,7 @@ index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b
for (Browser* browser : *BrowserList::GetInstance()) {
if (browser->session_id().id() == session_id) {
std::unique_ptr<base::DictionaryValue> result(
@@ -643,6 +655,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
@@ -644,6 +656,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
return;
}
}
@@ -117,7 +117,7 @@ index b9fd875b26d64e84201605978f897b234b998f6f..20ac941733b0b1f9e14954fde1c17b7b
#endif // !BUILDFLAG(IS_ANDROID)
// No browser with the specified |session_id| was found.
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
@@ -759,5 +772,7 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
@@ -760,5 +773,7 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
// static
void AccessibilityUIMessageHandler::RegisterProfilePrefs(
user_prefs::PrefRegistrySyncable* registry) {

View File

@@ -62,10 +62,10 @@ index 9e351c7e80a135adf0ebe011763f5164e51981bb..b9fcb4d2a8c7a22ebc7cd8434636454e
PMPrintSettings print_settings =
static_cast<PMPrintSettings>([print_info_.get() PMPrintSettings]);
diff --git a/printing/printing_context_system_dialog_win.cc b/printing/printing_context_system_dialog_win.cc
index ba604d33cc0601276320f3f81f20e98cb2811f74..1da667c66b75ab44727c5029c02d44379f924007 100644
index b7ba6ba4446963b08bce9fe416379169bd880378..7c621ea7a60725d08ee9ade68b65fd5bc88b0c2d 100644
--- a/printing/printing_context_system_dialog_win.cc
+++ b/printing/printing_context_system_dialog_win.cc
@@ -53,14 +53,28 @@ void PrintingContextSystemDialogWin::AskUserForSettings(
@@ -75,14 +75,28 @@ void PrintingContextSystemDialogWin::AskUserForSettings(
PRINTPAGERANGE ranges[32];
dialog_options.nStartPage = START_PAGE_GENERAL;
if (max_pages) {
@@ -100,10 +100,10 @@ index ba604d33cc0601276320f3f81f20e98cb2811f74..1da667c66b75ab44727c5029c02d4437
} else {
// No need to bother, we don't know how many pages are available.
diff --git a/ui/gtk/printing/print_dialog_gtk.cc b/ui/gtk/printing/print_dialog_gtk.cc
index aca31e17a90f95d6a4616fec5b33ce55cd136af0..e340cfae256797b7683fad8b32776a95889a8f46 100644
index 804166d8844da5bd889f014e79d59d0cd75f5490..35ef412756a2c63394e5f2587b5bc73eadae4d60 100644
--- a/ui/gtk/printing/print_dialog_gtk.cc
+++ b/ui/gtk/printing/print_dialog_gtk.cc
@@ -240,6 +240,24 @@ void PrintDialogGtk::UpdateSettings(
@@ -239,6 +239,24 @@ void PrintDialogGtk::UpdateSettings(
gtk_print_settings_set_n_copies(gtk_settings_, settings->copies());
gtk_print_settings_set_collate(gtk_settings_, settings->collate());

View File

@@ -12,7 +12,7 @@ as they will loaded as empty strings.
* IDS_UTILITY_PROCESS_PRINTING_SERVICE_NAME on Windows
diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc
index ccb9d3fb018b4153cfebad8b87579dd5005398e9..5ee9583dddcceed80c7a6e0fa6a0365dbd6c9a6a 100644
index 441c28828328b72b625db10c5dca85f1f2349482..17973b511994cf32da051d144fc893a87fbb1d0c 100644
--- a/chrome/browser/pdf/pdf_extension_util.cc
+++ b/chrome/browser/pdf/pdf_extension_util.cc
@@ -11,8 +11,7 @@

View File

@@ -6,7 +6,7 @@ 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 6ecce70efe2d63259f8de512de276a49da1ee9c0..3068a27d60c109156d91dee68715d00aaf5f972d 100644
index b17180351e6e693352fcda973bdc23da79d8bfac..307ea58a72fe05f283b2cdfd6027625f96c5a99b 100644
--- a/content/browser/renderer_host/render_frame_host_manager.cc
+++ b/content/browser/renderer_host/render_frame_host_manager.cc
@@ -3167,6 +3167,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
@@ -20,10 +20,10 @@ index 6ecce70efe2d63259f8de512de276a49da1ee9c0..3068a27d60c109156d91dee68715d00a
}
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
index 8573ea54135e363f83bd786db3483d1c539e4bb1..11036e52affafe46bab3146184b8d89696d4163c 100644
index 9b988bb631ab759739ae01c918efb1d563d5aafc..4db1e6c2dbea27249ca15d5660b7fcd8c6736ad1 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -276,6 +276,11 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -272,6 +272,11 @@ class CONTENT_EXPORT ContentBrowserClient {
virtual ~ContentBrowserClient() = default;

View File

@@ -7,51 +7,51 @@ 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 00190da513499e6275d19bd99b6502db246cd33d..f273749bd026abb287ba33e03208a286e80a57a1 100644
index 7b4b42449a60e9309135aae38213cb3b003337e0..7d9068b87eee4dbc3435ed6f67285d428dc85f52 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -121,9 +121,10 @@ IsolateHolder::~IsolateHolder() {
void IsolateHolder::Initialize(ScriptMode mode,
v8::ArrayBuffer::Allocator* allocator,
@@ -123,9 +123,10 @@ void IsolateHolder::Initialize(ScriptMode mode,
const intptr_t* reference_table,
- const std::string js_command_line_flags) {
+ const std::string js_command_line_flags,
const std::string js_command_line_flags,
v8::FatalErrorCallback fatal_error_callback,
- v8::OOMErrorCallback oom_error_callback) {
+ v8::OOMErrorCallback oom_error_callback,
+ bool create_v8_platform) {
CHECK(allocator);
- V8Initializer::Initialize(mode, js_command_line_flags);
+ V8Initializer::Initialize(mode, js_command_line_flags, create_v8_platform);
- V8Initializer::Initialize(mode, js_command_line_flags, oom_error_callback);
+ V8Initializer::Initialize(mode, js_command_line_flags, oom_error_callback, create_v8_platform);
g_array_buffer_allocator = allocator;
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 1e36669dfb275b8a7c4913c8465bd299c548ed3a..178023d52c9e8ef716ee215e7a243b1800357818 100644
index 20cfc2257e9ba25ec3f39f19db952ba6b6036c72..4efc13c79ae742fa1925d064318627452ba852b2 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -102,7 +102,8 @@ class GIN_EXPORT IsolateHolder {
static void Initialize(ScriptMode mode,
v8::ArrayBuffer::Allocator* allocator,
const intptr_t* reference_table = nullptr,
- const std::string js_command_line_flags = {});
+ const std::string js_command_line_flags = {},
const std::string js_command_line_flags = {},
v8::FatalErrorCallback fatal_error_callback = nullptr,
- v8::OOMErrorCallback oom_error_callback = nullptr);
+ v8::OOMErrorCallback oom_error_callback = nullptr,
+ bool create_v8_platform = true);
// 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 b123e69bf6a57b1a4041c79c1cddd0117ed3851c..a8a23ccd0837866c1cb0657e0b8713d484042f38 100644
index 9dddcdf88d56b32a9b8b9be529f0f13a03bd6e06..f4e5be79c1d3b92f6723f7b0c4d9a7f38c81ff99 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -348,7 +348,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
@@ -352,7 +352,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
// static
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
- const std::string js_command_line_flags) {
+ const std::string js_command_line_flags,
const std::string js_command_line_flags,
- v8::OOMErrorCallback oom_error_callback) {
+ v8::OOMErrorCallback oom_error_callback,
+ bool create_v8_platform) {
static bool v8_is_initialized = false;
if (v8_is_initialized)
return;
@@ -358,7 +359,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
@@ -362,7 +363,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
// See https://crbug.com/v8/11043
SetFlags(mode, js_command_line_flags);
@@ -59,18 +59,18 @@ index b123e69bf6a57b1a4041c79c1cddd0117ed3851c..a8a23ccd0837866c1cb0657e0b8713d4
+ if (create_v8_platform)
+ v8::V8::InitializePlatform(V8Platform::Get());
// Set this early on as some initialization steps, such as the initialization
// of the virtual memory cage, already use V8's random number generator.
// Set this as early as possible in order to ensure OOM errors are reported
// correctly.
diff --git a/gin/v8_initializer.h b/gin/v8_initializer.h
index beeedc5737f6e60dde123200fbb6430a40366577..17ee4c894e89b7d2d12377475a5dd01910b61312 100644
index da5b4017b4a8128bf620d4b43d4c2d183719265b..13a120c7fe8e69a44793473f3124c33d572a07a3 100644
--- a/gin/v8_initializer.h
+++ b/gin/v8_initializer.h
@@ -29,7 +29,8 @@ class GIN_EXPORT V8Initializer {
public:
@@ -31,7 +31,8 @@ class GIN_EXPORT V8Initializer {
// This should be called by IsolateHolder::Initialize().
static void Initialize(IsolateHolder::ScriptMode mode,
- const std::string js_command_line_flags = {});
+ const std::string js_command_line_flags = {},
const std::string js_command_line_flags = {},
- v8::OOMErrorCallback oom_error_callback = nullptr);
+ v8::OOMErrorCallback oom_error_callback = nullptr,
+ bool create_v8_platform = true);
// Get address and size information for currently loaded snapshot.

View File

@@ -12,7 +12,7 @@ rendering and there is no signal from browser process on this event
to identify it.
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index b26a3c72aa63b81f8f4558b28b404faf138a897b..335dc385eb03bc9634387af44dfd1aa3bfa71cb6 100644
index e9c3f3dee36a44d40844a88dbb899f593d03c907..c8dc226ce7c87fa84da5c99760f12538e367bbc9 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -230,6 +230,11 @@ void GpuDataManagerImpl::TerminateInfoCollectionGpuProcess() {
@@ -28,7 +28,7 @@ index b26a3c72aa63b81f8f4558b28b404faf138a897b..335dc385eb03bc9634387af44dfd1aa3
void GpuDataManagerImpl::UpdateDawnInfo(
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
index 4364da656ac02f2f717e713f37d29ce44c14242b..ba044aee23db495e1da69c5bc0a807e96783faa9 100644
index 4ed951d5829e87431a1f9f84f0317978cb673e31..82f9a2f97e71848ece8d04effc083db94a45d495 100644
--- a/content/browser/gpu/gpu_data_manager_impl.h
+++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -124,6 +124,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
@@ -40,10 +40,10 @@ index 4364da656ac02f2f717e713f37d29ce44c14242b..ba044aee23db495e1da69c5bc0a807e9
void UpdateDawnInfo(const std::vector<std::string>& dawn_info_list);
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index 972bb4e8ba2d1470ed5f24c125551e3e627d79e4..d3b15d35eb458c00e470569904924c28c7a3957d 100644
index 53402e4d706f58c26498015c1a5c33b4f7ceabc7..c14ce99ec72881133a5bf2bd90369ee0211f6ca1 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -1211,6 +1211,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
@@ -1215,6 +1215,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
if (host)
host->ForceShutdown();
}
@@ -57,10 +57,10 @@ index 972bb4e8ba2d1470ed5f24c125551e3e627d79e4..d3b15d35eb458c00e470569904924c28
void GpuDataManagerImplPrivate::UpdateDawnInfo(
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
index 81f6abb91a3fdefc1b0128f3224c7b82bfcbd0d2..99980e3528f4660bf1205e44326645d97e762cb9 100644
index ac0afe687650da564187127dc7ea93a47acde719..237e3f00b1451be43949a797ef1b35885b958a5d 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.h
+++ b/content/browser/gpu/gpu_data_manager_impl_private.h
@@ -89,6 +89,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
@@ -90,6 +90,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {
bool VulkanRequested() const;
void PostCreateThreads();
void TerminateInfoCollectionGpuProcess();

View File

@@ -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 22896db086972ff3865df9cbb4d904f1e00b7321..8e23293f8cd7f0a4203b3d5fdae24aa5e26fc2ec 100644
index 6a91282809a76ca60dd1b329c683705b127eb22a..a2672faad7c39c3d938c1c31abb6fd0d37582fbf 100644
--- a/tools/gritsettings/resource_ids.spec
+++ b/tools/gritsettings/resource_ids.spec
@@ -955,6 +955,11 @@
@@ -954,6 +954,11 @@
"includes": [4960],
},

View File

@@ -18,7 +18,7 @@ index 349043f8a3cfc9f91cbae951e74258799a4fd126..0f7e3e544f524a7ad6660b54912cb119
# on GTK.
"//examples:peerconnection_client",
diff --git a/ui/ozone/platform/x11/BUILD.gn b/ui/ozone/platform/x11/BUILD.gn
index 27d6cc30cad2dffed0a2587fdd49199248e006e1..f6c0974ca21e6b83faf81e5d11add0eb534645d1 100644
index b1180a85530a7dd65022e174fe335ede0c7c55ca..c12133d82b111d37c8bac92980c22e406125c8df 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")

View File

@@ -8,7 +8,7 @@ require a largeish patch to get working, so just redirect it to our
implementation instead.
diff --git a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
index b5c0e1c131351a51e3c03918dfc10e92ca1bace1..c6fe2e473a9d8a5ed2854a69909eb360d052147a 100644
index 9d7479bff662ca3c482e4672a9129e1f83100ebd..cfcc14087d9d5d9ab08ff9a5349a096ec75f4b6a 100644
--- a/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
+++ b/chrome/browser/plugins/plugin_response_interceptor_url_loader_throttle.cc
@@ -10,8 +10,8 @@

View File

@@ -11,7 +11,7 @@ If removing this patch causes no sync failures, it's safe to delete :+1:
Ref https://chromium-review.googlesource.com/c/chromium/src/+/2953903
diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
index 8cf820d7d1f5d9e85156a18e9ec573dbeb63d41a..a7d6ea676aaba90220761fa7ecc4569012806581 100755
index 6bd25626dc999438316c2084442a29389d4154fb..bc27370e73d3061dfacbd96a3b8cf576b94e3d9b 100755
--- a/tools/clang/scripts/update.py
+++ b/tools/clang/scripts/update.py
@@ -298,6 +298,8 @@ def GetDefaultHostOs():

View File

@@ -15,15 +15,15 @@ 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 f273749bd026abb287ba33e03208a286e80a57a1..0159cd61a8e95d6cca51cdc855f1dea3ec965d6b 100644
index 7d9068b87eee4dbc3435ed6f67285d428dc85f52..c0b8c6e5b49390b8a87d6a9d19605f6b6a1c3562 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -59,7 +59,8 @@ IsolateHolder::IsolateHolder(
IsolateType isolate_type,
IsolateCreationMode isolate_creation_mode,
v8::CreateHistogramCallback create_histogram_callback,
v8::AddHistogramSampleCallback add_histogram_sample_callback,
v8::FatalErrorCallback fatal_error_callback,
- v8::OOMErrorCallback oom_error_callback)
+ v8::OOMErrorCallback oom_error_callback,
- v8::AddHistogramSampleCallback add_histogram_sample_callback)
+ v8::AddHistogramSampleCallback add_histogram_sample_callback,
+ v8::Isolate* isolate)
: access_mode_(access_mode), isolate_type_(isolate_type) {
CHECK(Initialized())
@@ -38,15 +38,15 @@ index f273749bd026abb287ba33e03208a286e80a57a1..0159cd61a8e95d6cca51cdc855f1dea3
access_mode_, task_runner);
if (isolate_creation_mode == IsolateCreationMode::kCreateSnapshot) {
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index 178023d52c9e8ef716ee215e7a243b1800357818..979fdc27efbe69c276894e0dc82e53ac2c4db7b4 100644
index 4efc13c79ae742fa1925d064318627452ba852b2..978c0d144370162e65038cf8a2e125fbfd0f7ebf 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -84,7 +84,8 @@ class GIN_EXPORT IsolateHolder {
@@ -82,7 +82,8 @@ class GIN_EXPORT IsolateHolder {
IsolateType isolate_type,
IsolateCreationMode isolate_creation_mode = IsolateCreationMode::kNormal,
v8::CreateHistogramCallback create_histogram_callback = nullptr,
v8::AddHistogramSampleCallback add_histogram_sample_callback = nullptr,
v8::FatalErrorCallback fatal_error_callback = nullptr,
- v8::OOMErrorCallback oom_error_callback = nullptr);
+ v8::OOMErrorCallback oom_error_callback = nullptr,
- v8::AddHistogramSampleCallback add_histogram_sample_callback = nullptr);
+ v8::AddHistogramSampleCallback add_histogram_sample_callback = nullptr,
+ v8::Isolate* isolate = nullptr);
IsolateHolder(const IsolateHolder&) = delete;
IsolateHolder& operator=(const IsolateHolder&) = delete;

View File

@@ -9,10 +9,10 @@ but due to the nature of electron, we need to load the v8 snapshot
in the browser process.
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index 7074141f95253587ae3ca156118ac6b10dd60e26..0476d00de005060c991cd6fa9ccd323ef5d56ea3 100644
index 85a55e9bbb7403b031c512fa5e010cbb0487d9c6..31c83eab4781725540f57e1e66c6f7e7c0b85d8b 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -248,11 +248,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
@@ -247,11 +247,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
const std::string& process_type) {

View File

@@ -0,0 +1,52 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: deepak1556 <hop2deep@gmail.com>
Date: Thu, 7 Apr 2022 20:30:16 +0900
Subject: Make gtk::GetLibGtk public
Allows embedders to get a handle to the gtk library
already loaded in the process.
diff --git a/ui/gtk/gtk_compat.cc b/ui/gtk/gtk_compat.cc
index 0ed04582106639911d9a4e0284ff880be9c3bc74..bfda81b08be52406048be9b96d2de59223d56ee7 100644
--- a/ui/gtk/gtk_compat.cc
+++ b/ui/gtk/gtk_compat.cc
@@ -86,12 +86,6 @@ void* GetLibGtk4(bool check = true) {
return libgtk4;
}
-void* GetLibGtk() {
- if (GtkCheckVersion(4))
- return GetLibGtk4();
- return GetLibGtk3();
-}
-
bool LoadGtk3() {
if (!GetLibGtk3(false))
return false;
@@ -134,6 +128,12 @@ gfx::Insets InsetsFromGtkBorder(const GtkBorder& border) {
} // namespace
+void* GetLibGtk() {
+ if (GtkCheckVersion(4))
+ return GetLibGtk4();
+ return GetLibGtk3();
+}
+
bool LoadGtk() {
static bool loaded = LoadGtkImpl();
return loaded;
diff --git a/ui/gtk/gtk_compat.h b/ui/gtk/gtk_compat.h
index 72981270fe26579211afcaf3c596a412f69f5fac..b5dbfde5b011d57d26960d245e0dc61cac9341e4 100644
--- a/ui/gtk/gtk_compat.h
+++ b/ui/gtk/gtk_compat.h
@@ -37,6 +37,9 @@ using SkColor = uint32_t;
namespace gtk {
+// Get handle to the currently loaded gtk library in the process.
+void* GetLibGtk();
+
// Loads libgtk and related libraries and returns true on success.
bool LoadGtk();

View File

@@ -6,7 +6,7 @@ Subject: mas: avoid usage of AudioDeviceDuck
Removes usage of the AudioDeviceDuck private API.
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index e28d37435da00153e34132f49ce8f6b240e70a65..77ce459d969022b7c5a4d1e57bb1f7e6fa7a9898 100644
index 0e842caf7b6487d94978c7b68fb5b222e330581f..5eafcd163ee1a05203a5eb76592a449f5a84e71f 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -34,19 +34,23 @@

View File

@@ -114,7 +114,7 @@ index 2b99d6a9f13f12a2a470fb6a5aa98c05f26a54c7..46d735add749d76c32f80512d00373b4
// 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 14fec4b1b39d995553b029ca7ec780ce29b27162..54a1142f17e2a63b86e1fab52ea90276091c85a4 100644
index 961c759eca96ffc0ffcf40cfdaf42388f47d9c2b..18c77a5520ea2ae7cfee4eea3ed01fa8a588829d 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -252,8 +252,10 @@
@@ -167,7 +167,7 @@ index 14fec4b1b39d995553b029ca7ec780ce29b27162..54a1142f17e2a63b86e1fab52ea90276
///////////////////////////////////////////////////////////////////////////////
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
index be753e5ea42cc8757b0e7f9a21aa12b40f1928f2..83f3ef36e17b484d838c9338ae6ad0073b42283c 100644
index 028a97becd88fb12481b1de0395c7c81857d3af3..4491be85cb82f050cc70c24e933e841a08b9123f 100644
--- a/ui/base/BUILD.gn
+++ b/ui/base/BUILD.gn
@@ -319,6 +319,13 @@ component("base") {
@@ -205,7 +205,7 @@ index e7adfee3210ec723c687adfcc4bee8827ef643e7..25a924a47eeb30d783ef83dbb4896c4b
+
#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 d4051a7a8755c7b10d4df3746cb2857471f07c45..de04616893d1c97e3607eb5a4b942733ae597b05 100644
index c93aedbce83c398a55c478df60d5ba6dd5324a0b..dfa1983e5605d14e44efae3c1418b4e53c392333 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
@@ -31,7 +31,9 @@
@@ -218,7 +218,7 @@ index d4051a7a8755c7b10d4df3746cb2857471f07c45..de04616893d1c97e3607eb5a4b942733
@class NSView;
namespace remote_cocoa {
@@ -449,11 +451,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
@@ -452,11 +454,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
mojo::AssociatedRemote<remote_cocoa::mojom::NativeWidgetNSWindow>
remote_ns_window_remote_;
@@ -233,7 +233,7 @@ index d4051a7a8755c7b10d4df3746cb2857471f07c45..de04616893d1c97e3607eb5a4b942733
// 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 7ed5041b0625a98be269b4f4daeef33c3bc1f8b6..803d8bc43fa57c8e49d33d4be618d51a408ffe47 100644
index 1c4c4a774e4d5e199ae50e8df4499a497d3b0674..b2265079021d10e2944b9474fafe32ccca95d3de 100644
--- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
+++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
@@ -296,14 +296,22 @@ void HandleAccelerator(const ui::Accelerator& accelerator,

View File

@@ -40,10 +40,10 @@ index 1b84c9df5990d0905d068ca822d5173313a74edd..89a90a5c8e0c3ede1b0fe63d45c5768b
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 224542e2a70e980684d5d882af7fe3988c5ee96b..7a726eea86f21fe31077aaa447cccc05007d5eaa 100644
index 767d3f6454ef3150354911ed683f5485bb83fbbb..f273b56276c1b277b307f6c4c061e08d12daea42 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -59,7 +59,7 @@
@@ -60,7 +60,7 @@
ca_layer_tree_coordinator_ = std::make_unique<ui::CALayerTreeCoordinator>(
use_remote_layer_api_, allow_av_sample_buffer_display_layer);
@@ -52,7 +52,7 @@ index 224542e2a70e980684d5d882af7fe3988c5ee96b..7a726eea86f21fe31077aaa447cccc05
// Create the CAContext to send this to the GPU process, and the layer for
// the context.
if (use_remote_layer_api_) {
@@ -68,6 +68,7 @@
@@ -69,6 +69,7 @@
options:@{}] retain]);
[ca_context_ setLayer:ca_layer_tree_coordinator_->GetCALayerForDisplay()];
}
@@ -60,7 +60,7 @@ index 224542e2a70e980684d5d882af7fe3988c5ee96b..7a726eea86f21fe31077aaa447cccc05
}
template <typename BaseClass>
@@ -148,7 +149,9 @@
@@ -149,7 +150,9 @@
"GLImpl", static_cast<int>(gl::GetGLImplementation()),
"width", pixel_size_.width());
if (use_remote_layer_api_) {

View File

@@ -6,6 +6,33 @@ Subject: mas: avoid some private APIs
Guard usages in blink 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/base/process/process_info_mac.cc b/base/process/process_info_mac.cc
index 368405f29313d51a6eee16517b634c6d0ea95281..2553a7fbf1e8b4dea796dec3b3e906d265d3ad76 100644
--- a/base/process/process_info_mac.cc
+++ b/base/process/process_info_mac.cc
@@ -5,18 +5,22 @@
#include <stdlib.h>
#include <unistd.h>
+#ifndef MAS_BUILD
extern "C" {
pid_t responsibility_get_pid_responsible_for_pid(pid_t)
API_AVAILABLE(macosx(10.12));
}
+#endif
namespace base {
bool IsProcessSelfResponsible() {
+#ifndef MAS_BUILD
if (__builtin_available(macOS 10.14, *)) {
const pid_t pid = getpid();
return responsibility_get_pid_responsible_for_pid(pid) == pid;
}
+#endif
return true;
}
diff --git a/content/common/pseudonymization_salt.cc b/content/common/pseudonymization_salt.cc
index 28e003bef910abff022def659fe18d4cd0549f8a..530bcbdb5d350f6486dc1e8536f7b279be69e241 100644
--- a/content/common/pseudonymization_salt.cc
@@ -95,7 +122,7 @@ index c15f3a631292b538698625328fb429ee3c9964f5..37e038753ecf1b82ec92c06b2c0729b5
}
diff --git a/device/bluetooth/bluetooth_adapter_mac.mm b/device/bluetooth/bluetooth_adapter_mac.mm
index 3f7dce0281f7b5a540d7b9377ef14a8a6aa9a2fa..11d8419791f3e45d5242081422d452d4fc703833 100644
index d342eb4e9fc94de4365d86c2d1af4b85a8bf63a3..012f9ce97d9ed6b00deb718a88f432e053cb3bd1 100644
--- a/device/bluetooth/bluetooth_adapter_mac.mm
+++ b/device/bluetooth/bluetooth_adapter_mac.mm
@@ -42,6 +42,7 @@
@@ -156,10 +183,10 @@ index ebe37172d254e8441fe2b8c290bd5a59af38d754..6a131f5c41f3e43a1467efeec2ce63f6
"AudioToolbox.framework",
"AudioUnit.framework",
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
index ebdc6364312ee710d416318836c03aeec9bfb65c..aa9b50de7efaf0e1b64effea93204984c91790b5 100644
index b8805f9174818ac086a5d6542c9962050f00aee8..5491b62a2e180b2f6e48e243e2ac78c3b1a16892 100644
--- a/media/audio/mac/audio_manager_mac.cc
+++ b/media/audio/mac/audio_manager_mac.cc
@@ -886,7 +886,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
@@ -887,7 +887,7 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters(
void AudioManagerMac::InitializeOnAudioThread() {
DCHECK(GetTaskRunner()->BelongsToCurrentThread());

View File

@@ -7,10 +7,10 @@ This adds a callback from the network service that's used to implement
session.setCertificateVerifyCallback.
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index 54b5a281161187f887032d9445f21c541b9691e5..4c8982a8ae3ae23fbeef244cd23b43c889d3fa94 100644
index ecc38d1584570c46826084054f0a3249f9e2eb92..f06a04983571623b542dba11933c4c95c3dcf398 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -127,6 +127,11 @@
@@ -128,6 +128,11 @@
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
@@ -22,7 +22,7 @@ index 54b5a281161187f887032d9445f21c541b9691e5..4c8982a8ae3ae23fbeef244cd23b43c8
#if BUILDFLAG(IS_CT_SUPPORTED)
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
#include "components/certificate_transparency/chrome_require_ct_delegate.h"
@@ -434,6 +439,91 @@ bool GetFullDataFilePath(
@@ -436,6 +441,91 @@ bool GetFullDataFilePath(
} // namespace
@@ -114,7 +114,7 @@ index 54b5a281161187f887032d9445f21c541b9691e5..4c8982a8ae3ae23fbeef244cd23b43c8
constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
NetworkContext::PendingCertVerify::PendingCertVerify() = default;
@@ -678,6 +768,13 @@ void NetworkContext::SetClient(
@@ -733,6 +823,13 @@ void NetworkContext::SetClient(
client_.Bind(std::move(client));
}
@@ -128,7 +128,7 @@ index 54b5a281161187f887032d9445f21c541b9691e5..4c8982a8ae3ae23fbeef244cd23b43c8
void NetworkContext::CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) {
@@ -2242,6 +2339,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
@@ -2301,6 +2398,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
std::move(cert_verifier));
cert_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_);
#endif // BUILDFLAG(IS_CHROMEOS)
@@ -139,10 +139,10 @@ index 54b5a281161187f887032d9445f21c541b9691e5..4c8982a8ae3ae23fbeef244cd23b43c8
builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
diff --git a/services/network/network_context.h b/services/network/network_context.h
index 3fd4c43562aa5de00d8698096f154522420c8f24..eed05c05d1da28284af6ae0cef45dbbb47254058 100644
index 994712b56fb25fbfa7559ac034cfd7e1c76597de..2cd8707b120deb41683e13def5d446fd3bf93afe 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -105,6 +105,7 @@ class URLMatcher;
@@ -109,6 +109,7 @@ class URLMatcher;
namespace network {
class CertVerifierWithTrustAnchors;
@@ -150,7 +150,7 @@ index 3fd4c43562aa5de00d8698096f154522420c8f24..eed05c05d1da28284af6ae0cef45dbbb
class CookieManager;
class ExpectCTReporter;
class HostResolver;
@@ -221,6 +222,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -240,6 +241,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
void CreateURLLoaderFactory(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
mojom::URLLoaderFactoryParamsPtr params) override;
@@ -159,9 +159,9 @@ index 3fd4c43562aa5de00d8698096f154522420c8f24..eed05c05d1da28284af6ae0cef45dbbb
void ResetURLLoaderFactories() override;
void GetCookieManager(
mojo::PendingReceiver<mojom::CookieManager> receiver) override;
@@ -796,6 +799,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
CertVerifierWithTrustAnchors* cert_verifier_with_trust_anchors_ = nullptr;
#endif
@@ -827,6 +830,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
std::vector<base::OnceClosure> dismount_closures_;
#endif // BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED)
+ RemoteCertVerifier* remote_cert_verifier_ = nullptr;
+
@@ -169,10 +169,10 @@ index 3fd4c43562aa5de00d8698096f154522420c8f24..eed05c05d1da28284af6ae0cef45dbbb
// CertNetFetcher is not used by the current platform, or if the actual
// net::CertVerifier is instantiated outside of the network service.
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 64199b44316ab4671941c734444d207591512d0a..c929eb10af5b8856debdc0d665eac767e9730714 100644
index b2beaa762bfe88b56ac24d35646b6e6cbc630816..b52e5a2230e96d55d7886bde331a505c58dd093a 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -280,6 +280,17 @@ struct NetworkContextFilePaths {
@@ -281,6 +281,17 @@ struct NetworkContextFilePaths {
bool trigger_migration = false;
};
@@ -190,7 +190,7 @@ index 64199b44316ab4671941c734444d207591512d0a..c929eb10af5b8856debdc0d665eac767
// Parameters for constructing a network context.
struct NetworkContextParams {
// The user agent string.
@@ -829,6 +840,9 @@ interface NetworkContext {
@@ -830,6 +841,9 @@ interface NetworkContext {
// Sets a client for this network context.
SetClient(pending_remote<NetworkContextClient> client);

View File

@@ -7,10 +7,10 @@ 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 225609e52130d4113c8ae667f3ffa565bbde5b73..b33d27ce4fc6222146255cf4c0e7342751c75c9b 100644
index 83b33e3f521aa79942ba3446a8b161a4e4e23da1..24f409f673797b6e8bb1da680343ea1ddc083e4f 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -196,6 +196,7 @@ bool PlatformNotificationServiceImpl::WasClosedProgrammatically(
@@ -195,6 +195,7 @@ bool PlatformNotificationServiceImpl::WasClosedProgrammatically(
// TODO(awdf): Rename to DisplayNonPersistentNotification (Similar for Close)
void PlatformNotificationServiceImpl::DisplayNotification(
@@ -31,13 +31,13 @@ index b0e64049d411305d58802fd290bb0480e9b36fee..4afcf3b7a5b841409b0e1c4c2f32fd48
const GURL& origin,
const GURL& document_url,
diff --git a/content/browser/notifications/blink_notification_service_impl.cc b/content/browser/notifications/blink_notification_service_impl.cc
index fd2c2d72ebc3cab0cc824bb091da32d4be635dd9..8bcd6a87c38413a5281d164e3c0fcfd23c3fa04b 100644
index 32a61e73658d33dcd0fe1640094c8b79dde0be37..3c3650e0f8364a5c86bd11a6f11ca559a97f5900 100644
--- a/content/browser/notifications/blink_notification_service_impl.cc
+++ b/content/browser/notifications/blink_notification_service_impl.cc
@@ -81,10 +81,12 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl(
PlatformNotificationContextImpl* notification_context,
@@ -82,10 +82,12 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl(
BrowserContext* browser_context,
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
RenderProcessHost* render_process_host,
+ RenderFrameHost* render_frame_host,
const url::Origin& origin,
const GURL& document_url,
@@ -46,8 +46,8 @@ index fd2c2d72ebc3cab0cc824bb091da32d4be635dd9..8bcd6a87c38413a5281d164e3c0fcfd2
+ render_frame_host_(render_frame_host),
browser_context_(browser_context),
service_worker_context_(std::move(service_worker_context)),
origin_(origin),
@@ -147,7 +149,7 @@ void BlinkNotificationServiceImpl::DisplayNonPersistentNotification(
render_process_host_id_(render_process_host->GetID()),
@@ -149,7 +151,7 @@ void BlinkNotificationServiceImpl::DisplayNonPersistentNotification(
notification_id, std::move(event_listener_remote));
browser_context_->GetPlatformNotificationService()->DisplayNotification(
@@ -57,18 +57,18 @@ index fd2c2d72ebc3cab0cc824bb091da32d4be635dd9..8bcd6a87c38413a5281d164e3c0fcfd2
}
diff --git a/content/browser/notifications/blink_notification_service_impl.h b/content/browser/notifications/blink_notification_service_impl.h
index cb2b09912dbe426611e944316841ee2a9c2e373f..4d2603c29b2d89fa296b1aad40c2132a9c7498aa 100644
index dc8de24c86f1769680ce7830844d35dfef7eb7e7..fcd99361fa8c895d6bd89bacb9fb94e76969e7b2 100644
--- a/content/browser/notifications/blink_notification_service_impl.h
+++ b/content/browser/notifications/blink_notification_service_impl.h
@@ -41,6 +41,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
PlatformNotificationContextImpl* notification_context,
@@ -42,6 +42,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
BrowserContext* browser_context,
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
RenderProcessHost* render_process_host,
+ RenderFrameHost* render_frame_host,
const url::Origin& origin,
const GURL& document_url,
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
@@ -101,6 +102,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
@@ -102,6 +103,7 @@ class CONTENT_EXPORT BlinkNotificationServiceImpl
// The notification context that owns this service instance.
raw_ptr<PlatformNotificationContextImpl> notification_context_;
@@ -77,69 +77,69 @@ index cb2b09912dbe426611e944316841ee2a9c2e373f..4d2603c29b2d89fa296b1aad40c2132a
scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
diff --git a/content/browser/notifications/blink_notification_service_impl_unittest.cc b/content/browser/notifications/blink_notification_service_impl_unittest.cc
index f0d5ea365cf09d2dc06de88fc03e4bf5ddfdf4a6..b68666813ab231a3d4233d3ed2f9655b18d8a280 100644
index 7461d5079f9cb0f257fbb93248c98be9409d38e7..4ddb9e40f0441b378d73ac75d99ae64c90d32b58 100644
--- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
+++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
@@ -126,7 +126,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
@@ -129,7 +129,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
notification_service_ = std::make_unique<BlinkNotificationServiceImpl>(
notification_context_.get(), &browser_context_,
- embedded_worker_helper_->context_wrapper(),
+ embedded_worker_helper_->context_wrapper(), nullptr,
url::Origin::Create(GURL(kTestOrigin)),
embedded_worker_helper_->context_wrapper(), &render_process_host_,
- url::Origin::Create(GURL(kTestOrigin)),
+ nullptr, url::Origin::Create(GURL(kTestOrigin)),
/*document_url=*/GURL(),
notification_service_remote_.BindNewPipeAndPassReceiver());
diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
index 5580c415a1e8a45327147861d7c71cebd1ecbd5a..d37711f83be7566ec5ad2078942aaca1948a77c5 100644
index 1195296c6f925e6c4f52f61866cf4b7f824af4e9..d3142bef0856c5cd7f4822ee9dcaedaef74a12d3 100644
--- a/content/browser/notifications/platform_notification_context_impl.cc
+++ b/content/browser/notifications/platform_notification_context_impl.cc
@@ -281,13 +281,14 @@ void PlatformNotificationContextImpl::Shutdown() {
}
@@ -282,13 +282,14 @@ void PlatformNotificationContextImpl::Shutdown() {
void PlatformNotificationContextImpl::CreateService(
RenderProcessHost* render_process_host,
+ RenderFrameHost* render_frame_host,
const url::Origin& origin,
const GURL& document_url,
mojo::PendingReceiver<blink::mojom::NotificationService> receiver) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
services_.push_back(std::make_unique<BlinkNotificationServiceImpl>(
- this, browser_context_, service_worker_context_, origin, document_url,
- std::move(receiver)));
+ this, browser_context_, service_worker_context_, render_frame_host,
+ origin, document_url, std::move(receiver)));
this, browser_context_, service_worker_context_, render_process_host,
- origin, document_url, std::move(receiver)));
+ render_frame_host, origin, document_url, std::move(receiver)));
}
void PlatformNotificationContextImpl::RemoveService(
diff --git a/content/browser/notifications/platform_notification_context_impl.h b/content/browser/notifications/platform_notification_context_impl.h
index 951075749b24814606f494c5a89ee2adf527f512..7036323ff8ee38ae92790dfd2e216df61181bc55 100644
index 69f000e5cd25c6d89c88238873f638923bafdf0e..4f0068a92a0e99e2b34f105954689c7b5c19f436 100644
--- a/content/browser/notifications/platform_notification_context_impl.h
+++ b/content/browser/notifications/platform_notification_context_impl.h
@@ -47,6 +47,7 @@ class BrowserContext;
struct NotificationDatabaseData;
@@ -48,6 +48,7 @@ struct NotificationDatabaseData;
class PlatformNotificationServiceProxy;
class RenderProcessHost;
class ServiceWorkerContextWrapper;
+class RenderFrameHost;
// Implementation of the Web Notification storage context. The public methods
// defined in this interface must only be called on the UI thread.
@@ -76,6 +77,7 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
// Creates a BlinkNotificationServiceImpl that is owned by this context.
@@ -78,6 +79,7 @@ class CONTENT_EXPORT PlatformNotificationContextImpl
// |document_url| is empty when originating from a worker.
void CreateService(
RenderProcessHost* render_process_host,
+ RenderFrameHost* render_frame_host,
const url::Origin& origin,
const GURL& document_url,
mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index cc5f7c8d616ec9a433da428f180483da60736a9d..fb25a7c19f20ca690963c5a15bd09224687b5f57 100644
index b74b4c2028ccb22349253960b9aa6c5bfe87579c..396377fd4041cced3c68f8d57c8f868098bb8923 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -2083,7 +2083,7 @@ void RenderProcessHostImpl::CreateNotificationService(
@@ -2088,7 +2088,8 @@ void RenderProcessHostImpl::CreateNotificationService(
document_url = rfh->GetLastCommittedURL();
storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
- origin, document_url, std::move(receiver));
+ RenderFrameHost::FromID(GetID(), render_frame_id), origin, document_url, std::move(receiver));
- this, origin, document_url, std::move(receiver));
+ this, RenderFrameHost::FromID(GetID(), render_frame_id),
+ origin, document_url, std::move(receiver));
}
void RenderProcessHostImpl::CreateWebSocketConnector(

View File

@@ -22,7 +22,7 @@ index 7bc8d118f87b91baf1c3bd1d34374996ab1d3638..2d2c1c86f311b07f0c2b09d5a4c082cc
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/image_model.h"
diff --git a/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc b/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc
index 7d0e39968bf34cdc99549cb48f6bf0a11c182565..f21c1672abf34dc9d19cd39c5d09083a60ef6978 100644
index d566dbf99ea1164c6a8407026a9839218a6ba1fb..239cd53d70c547c79214988a82efdc8c472d553c 100644
--- a/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc
+++ b/chrome/browser/ui/views/overlay/back_to_tab_label_button.cc
@@ -5,7 +5,7 @@
@@ -35,7 +35,7 @@ index 7d0e39968bf34cdc99549cb48f6bf0a11c182565..f21c1672abf34dc9d19cd39c5d09083a
#include "ui/base/cursor/cursor.h"
#include "ui/base/l10n/l10n_util.h"
diff --git a/chrome/browser/ui/views/overlay/close_image_button.cc b/chrome/browser/ui/views/overlay/close_image_button.cc
index d3400d7b02edc9cffba4cb53ec601b6e4cfea3b2..8e620ad6172a650ea96f80c0b44035932471d88b 100644
index a3d9c0f03c8ade2553bad5721d4e15e6fd658074..b3b043cbf9144013bf7903121575b31b348ea87e 100644
--- a/chrome/browser/ui/views/overlay/close_image_button.cc
+++ b/chrome/browser/ui/views/overlay/close_image_button.cc
@@ -6,7 +6,7 @@
@@ -150,10 +150,10 @@ index 3309906bcae27ba89d73ce4fba49843a10cd31f6..9f828f70606238186b35b5e1ca875113
web_view->SetWebContents(pip_contents);
diff --git a/chrome/browser/ui/views/overlay/document_overlay_window_views.h b/chrome/browser/ui/views/overlay/document_overlay_window_views.h
index 86d385842501d28b5eb42f841822294eb597e6ed..43c19dfa6ec6b48f8694636cc184dd616e5d6aca 100644
index b2b178ccadce82f8d4ec8e5a6dafe1c67bcecd74..603d82a461c4c443ac26c85a46fbd866a42237e6 100644
--- a/chrome/browser/ui/views/overlay/document_overlay_window_views.h
+++ b/chrome/browser/ui/views/overlay/document_overlay_window_views.h
@@ -55,7 +55,6 @@ class DocumentOverlayWindowViews : public OverlayWindowViews,
@@ -56,7 +56,6 @@ class DocumentOverlayWindowViews : public OverlayWindowViews,
bool IsVisible() const override;
void OnNativeWidgetMove() override;
void OnNativeWidgetDestroyed() override;
@@ -162,13 +162,13 @@ index 86d385842501d28b5eb42f841822294eb597e6ed..43c19dfa6ec6b48f8694636cc184dd61
// OverlayWindowViews
bool ControlsHitTestContainsPoint(const gfx::Point& point) override;
diff --git a/chrome/browser/ui/views/overlay/hang_up_button.cc b/chrome/browser/ui/views/overlay/hang_up_button.cc
index 26f8f5ffa444d874b229b5e8debf087e4469dfd1..10149e812a43e3d5c92701e9b2ae8d68ed8395c7 100644
index 75bfe0f7a4d759f677cad5c365fa7f98121d54de..cb251381f1c77ad01d4906132f3d68865aaace10 100644
--- a/chrome/browser/ui/views/overlay/hang_up_button.cc
+++ b/chrome/browser/ui/views/overlay/hang_up_button.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/ui/views/overlay/hang_up_button.h"
@@ -6,7 +6,7 @@
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/overlay/constants.h"
-#include "chrome/grit/generated_resources.h"
+#include "electron/grit/electron_resources.h"
#include "components/vector_icons/vector_icons.h"
@@ -205,13 +205,13 @@ index 850b34e3b40f7ff1848c66158976db079e0853bd..105dbc3661eb2710b2f10ca6584e85c3
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
diff --git a/chrome/browser/ui/views/overlay/playback_image_button.cc b/chrome/browser/ui/views/overlay/playback_image_button.cc
index bcd3b2e1038786b660a4b91fbc20d9d8b4afffb4..a953c9d0ee0b49d6cc096e3eb236296b57cbc6c0 100644
index cb1621a9deefcec601d7537e2cc2fbd24e5f7f64..2d74ab12e1eaf77a6f9dde13e894172d6835e061 100644
--- a/chrome/browser/ui/views/overlay/playback_image_button.cc
+++ b/chrome/browser/ui/views/overlay/playback_image_button.cc
@@ -6,7 +6,7 @@
@@ -7,7 +7,7 @@
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/overlay/constants.h"
-#include "chrome/grit/generated_resources.h"
+#include "electron/grit/electron_resources.h"
#include "components/vector_icons/vector_icons.h"
@@ -244,26 +244,26 @@ index 51c7db1bfbd3c03b9cb2786c8c7482b33e3aca0b..2890f7420d2fd258f84019963eab6c96
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/gfx/color_palette.h"
diff --git a/chrome/browser/ui/views/overlay/toggle_camera_button.cc b/chrome/browser/ui/views/overlay/toggle_camera_button.cc
index 46ec4441ddb227325b319359f9d33a80aa856d85..57957d72310c0a232c78489fba5a07cdf475dc53 100644
index 20b82ff4dcf7fef3315b2b47bb480446509c6541..244a50e57b6c12680405c92f0ecbdbdb8bcfcb4f 100644
--- a/chrome/browser/ui/views/overlay/toggle_camera_button.cc
+++ b/chrome/browser/ui/views/overlay/toggle_camera_button.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/ui/views/overlay/toggle_camera_button.h"
@@ -6,7 +6,7 @@
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/overlay/constants.h"
-#include "chrome/grit/generated_resources.h"
+#include "electron/grit/electron_resources.h"
#include "components/vector_icons/vector_icons.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
diff --git a/chrome/browser/ui/views/overlay/toggle_microphone_button.cc b/chrome/browser/ui/views/overlay/toggle_microphone_button.cc
index 59b9a5442185bfb9efd8ed571ec63d56e3bc3326..34d58bf54019e0b8001c29cb301861d045c60214 100644
index 1a1edb6321490fdbf5cd347cb3d2cb9a6a5b1080..1e959cf1c8fe356ab4427e4bf4f8da1028f4575f 100644
--- a/chrome/browser/ui/views/overlay/toggle_microphone_button.cc
+++ b/chrome/browser/ui/views/overlay/toggle_microphone_button.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/ui/views/overlay/toggle_microphone_button.h"
@@ -6,7 +6,7 @@
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/overlay/constants.h"
-#include "chrome/grit/generated_resources.h"
+#include "electron/grit/electron_resources.h"
#include "components/vector_icons/vector_icons.h"
@@ -283,7 +283,7 @@ index 5e136488b37887e9523ac04a9ff4ccdfaf96c104..24899f4c2b6fe66b96a6728bf747f1aa
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
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 b2e281840f48592eb773c16042fb6b56a0fa132b..d5156bab0c81ca508733a8d3ba95f052ff6d83e6 100644
index c24fdd1360e582293a8b21b2f29dc6bc02b564c9..24bb07ae2efaad2e7f5957a73585885168349109 100644
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
@@ -15,9 +15,11 @@
@@ -319,7 +319,7 @@ index b2e281840f48592eb773c16042fb6b56a0fa132b..d5156bab0c81ca508733a8d3ba95f052
#include "chrome/browser/shell_integration_win.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
@@ -148,7 +150,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
@@ -167,7 +169,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
overlay_window->Init(std::move(params));
overlay_window->OnRootViewReady();

View File

@@ -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 d9db2d705c88e828383e81efd8f8c6d28e1520bb..7f0e1672af0fef134fc637324e366e9e8d985054 100644
index 13c1a8c9760fa0f286c6c5adc8f74fdae910ab50..b7a967642ff059c97f55002a9a0962709d806959 100644
--- a/ui/color/color_id.h
+++ b/ui/color/color_id.h
@@ -122,6 +122,16 @@
@@ -128,6 +128,16 @@
E_CPONLY(kColorOverlayScrollbarStrokeHoveredDark) \
E_CPONLY(kColorOverlayScrollbarStrokeHoveredLight) \
E_CPONLY(kColorProgressBar) \
@@ -28,7 +28,7 @@ index d9db2d705c88e828383e81efd8f8c6d28e1520bb..7f0e1672af0fef134fc637324e366e9e
E_CPONLY(kColorSeparator) \
E_CPONLY(kColorShadowBase) \
E_CPONLY(kColorShadowValueAmbientShadowElevationSixteen) \
@@ -174,6 +184,7 @@
@@ -180,6 +190,7 @@
E_CPONLY(kColorTreeNodeForeground) \
E_CPONLY(kColorTreeNodeForegroundSelectedFocused) \
E_CPONLY(kColorTreeNodeForegroundSelectedUnfocused) \
@@ -37,10 +37,10 @@ index d9db2d705c88e828383e81efd8f8c6d28e1520bb..7f0e1672af0fef134fc637324e366e9e
#if BUILDFLAG(IS_CHROMEOS)
diff --git a/ui/color/ui_color_mixer.cc b/ui/color/ui_color_mixer.cc
index a89f393da6c06ba21d5303a925dd9e907bde5e03..e0106610831ca36544161672f3663e54b2585228 100644
index 3e44d34fe1317822c340ebbcc895d7d8b55bed0b..be1737a96058c29d03645cc00999b6d7fc315f48 100644
--- a/ui/color/ui_color_mixer.cc
+++ b/ui/color/ui_color_mixer.cc
@@ -138,6 +138,17 @@ void AddUiColorMixer(ColorProvider* provider,
@@ -148,6 +148,17 @@ void AddUiColorMixer(ColorProvider* provider,
SetAlpha(GetColorWithMaxContrast(kColorOverlayScrollbarFillHoveredLight),
gfx::kGoogleGreyAlpha500);
mixer[kColorProgressBar] = {kColorAccent};
@@ -58,7 +58,7 @@ index a89f393da6c06ba21d5303a925dd9e907bde5e03..e0106610831ca36544161672f3663e54
mixer[kColorSeparator] = {kColorMidground};
mixer[kColorShadowBase] = {dark_mode ? SK_ColorBLACK : gfx::kGoogleGrey800};
mixer[kColorShadowValueAmbientShadowElevationThree] =
@@ -213,6 +224,7 @@ void AddUiColorMixer(ColorProvider* provider,
@@ -223,6 +234,7 @@ void AddUiColorMixer(ColorProvider* provider,
mixer[kColorTreeNodeForegroundSelectedFocused] = {kColorTreeNodeForeground};
mixer[kColorTreeNodeForegroundSelectedUnfocused] = {
kColorTreeNodeForegroundSelectedFocused};

View File

@@ -10,8 +10,21 @@ majority of changes originally come from these PRs:
This patch also fixes callback for manual user cancellation and success.
diff --git a/chrome/browser/printing/print_backend_service_manager.cc b/chrome/browser/printing/print_backend_service_manager.cc
index 27eb7cf1480e7a56ab6b7d010cdee65c72e62c10..76d265b8de17244ed9d3727f1bebe730a224cd56 100644
--- a/chrome/browser/printing/print_backend_service_manager.cc
+++ b/chrome/browser/printing/print_backend_service_manager.cc
@@ -18,7 +18,7 @@
#include "base/unguessable_token.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
-#include "chrome/grit/generated_resources.h"
+#include "electron/grit/electron_resources.h"
#include "chrome/services/printing/public/mojom/print_backend_service.mojom.h"
#include "components/crash/core/common/crash_keys.h"
#include "content/public/browser/browser_thread.h"
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
index 8d40bbf98d4d58704f118cb42039b0956a9f6639..06196c0fa02012a5faa82471bd39fac087918f54 100644
index 6408cbee8b5a8e45c4276ed966b57c1e61ad1137..e951c41a1bd92a33e32f6835841d3935a05dde53 100644
--- a/chrome/browser/printing/print_job.cc
+++ b/chrome/browser/printing/print_job.cc
@@ -89,6 +89,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
@@ -30,7 +43,7 @@ index 8d40bbf98d4d58704f118cb42039b0956a9f6639..06196c0fa02012a5faa82471bd39fac0
#endif // BUILDFLAG(IS_WIN)
@@ -356,8 +358,10 @@ void PrintJob::StartPdfToEmfConversion(
@@ -360,8 +362,10 @@ void PrintJob::StartPdfToEmfConversion(
const PrintSettings& settings = document()->settings();
@@ -42,7 +55,7 @@ index 8d40bbf98d4d58704f118cb42039b0956a9f6639..06196c0fa02012a5faa82471bd39fac0
using RenderMode = PdfRenderSettings::Mode;
RenderMode mode = print_with_reduced_rasterization
@@ -447,8 +451,10 @@ void PrintJob::StartPdfToPostScriptConversion(
@@ -451,8 +455,10 @@ void PrintJob::StartPdfToPostScriptConversion(
if (ps_level2) {
mode = PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2;
} else {
@@ -54,22 +67,8 @@ index 8d40bbf98d4d58704f118cb42039b0956a9f6639..06196c0fa02012a5faa82471bd39fac0
? PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3_WITH_TYPE42_FONTS
: PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
}
diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h
index 650c78f16c812170aeda99d75300ff88f47347a0..c33ce445a23f97a744db3a4ac30ef471c359553b 100644
--- a/chrome/browser/printing/print_job.h
+++ b/chrome/browser/printing/print_job.h
@@ -261,6 +261,9 @@ class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> {
public:
// Event type.
enum Type {
+ // Print... dialog box has been closed with CANCEL button.
+ USER_INIT_CANCELED,
+
// A new document started printing.
NEW_DOC,
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index 27305997182f0a669291d2f36dd6b0b98c43f314..cbb83e1f5661852d84468ec9d342af1b2d05ae45 100644
index 86770178101d411bdf84617678c65a4a29ddbb5c..16e1fe8fc650fba441bcc7e467d58e0071dbc945 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -20,7 +20,6 @@
@@ -88,7 +87,7 @@ index 27305997182f0a669291d2f36dd6b0b98c43f314..cbb83e1f5661852d84468ec9d342af1b
#include "printing/backend/print_backend.h"
#include "printing/buildflags/buildflags.h"
#include "printing/mojom/print.mojom.h"
@@ -234,16 +234,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
@@ -229,16 +229,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value::Dict new_settings,
#endif // BUILDFLAG(IS_LINUX) && defined(USE_CUPS)
}
@@ -114,10 +113,10 @@ index 27305997182f0a669291d2f36dd6b0b98c43f314..cbb83e1f5661852d84468ec9d342af1b
#if BUILDFLAG(IS_CHROMEOS)
diff --git a/chrome/browser/printing/print_job_worker_oop.cc b/chrome/browser/printing/print_job_worker_oop.cc
index 52a13c0c47f7f3f18c4f552806add67291ce8726..765bde402fec094b51faea68e67d3782bbc06564 100644
index dd27bbf387718d6abda5080e7d2c609cd0eaff17..8837cf2aeaa2f87d51be8d00aa356c8a2c5e15c7 100644
--- a/chrome/browser/printing/print_job_worker_oop.cc
+++ b/chrome/browser/printing/print_job_worker_oop.cc
@@ -226,7 +226,7 @@ void PrintJobWorkerOop::OnFailure() {
@@ -345,7 +345,7 @@ void PrintJobWorkerOop::OnFailure() {
}
void PrintJobWorkerOop::ShowErrorDialog() {
@@ -127,7 +126,7 @@ index 52a13c0c47f7f3f18c4f552806add67291ce8726..765bde402fec094b51faea68e67d3782
void PrintJobWorkerOop::UnregisterServiceManagerClient() {
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521e01702ac 100644
index fb69efbfa8e355f8389abf9490cf338e70f16c7b..52099b2312b042b0afdd5ee3d2df5c66ea25df8b 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -30,10 +30,10 @@
@@ -143,15 +142,15 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
#include "components/prefs/pref_service.h"
#include "components/printing/browser/print_composite_client.h"
#include "components/printing/browser/print_manager_utils.h"
@@ -49,6 +49,7 @@
@@ -48,6 +48,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "electron/grit/electron_resources.h"
#include "mojo/public/cpp/system/buffer.h"
#include "printing/buildflags/buildflags.h"
#include "printing/metafile_skia.h"
@@ -86,6 +87,8 @@ using PrintSettingsCallback =
@@ -87,6 +88,8 @@ using PrintSettingsCallback =
base::OnceCallback<void(std::unique_ptr<PrinterQuery>)>;
void ShowWarningMessageBox(const std::u16string& message) {
@@ -160,7 +159,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
// Runs always on the UI thread.
static bool is_dialog_shown = false;
if (is_dialog_shown)
@@ -94,6 +97,7 @@ void ShowWarningMessageBox(const std::u16string& message) {
@@ -95,6 +98,7 @@ void ShowWarningMessageBox(const std::u16string& message) {
base::AutoReset<bool> auto_reset(&is_dialog_shown, true);
chrome::ShowWarningMessageBox(nullptr, std::u16string(), message);
@@ -168,7 +167,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
}
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -191,7 +195,9 @@ void UpdatePrintSettingsReplyOnIO(
@@ -192,7 +196,9 @@ void UpdatePrintSettingsReplyOnIO(
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
DCHECK(printer_query);
mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
@@ -179,7 +178,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
RenderParamsFromPrintSettings(printer_query->settings(),
params->params.get());
params->params->document_cookie = printer_query->cookie();
@@ -244,6 +250,7 @@ void ScriptedPrintReplyOnIO(
@@ -245,6 +251,7 @@ void ScriptedPrintReplyOnIO(
mojom::PrintManagerHost::ScriptedPrintCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
@@ -187,7 +186,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
if (printer_query->last_status() == mojom::ResultCode::kSuccess &&
printer_query->settings().dpi()) {
RenderParamsFromPrintSettings(printer_query->settings(),
@@ -253,8 +260,9 @@ void ScriptedPrintReplyOnIO(
@@ -254,8 +261,9 @@ void ScriptedPrintReplyOnIO(
}
bool has_valid_cookie = params->params->document_cookie;
bool has_dpi = !params->params->dpi.IsEmpty();
@@ -198,7 +197,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
if (has_dpi && has_valid_cookie) {
queue->QueuePrinterQuery(std::move(printer_query));
@@ -292,12 +300,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
@@ -293,12 +301,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
: PrintManager(web_contents),
queue_(g_browser_process->print_job_manager()->queue()) {
DCHECK(queue_);
@@ -213,30 +212,29 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
}
PrintViewManagerBase::~PrintViewManagerBase() {
@@ -305,7 +315,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
@@ -306,7 +316,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
DisconnectFromCurrentPrintJob();
}
-bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
+bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh,
+ bool silent,
+ base::Value settings,
+ base::Value::Dict settings,
+ CompletionCallback callback) {
// Remember the ID for `rfh`, to enable checking that the `RenderFrameHost`
// is still valid after a possible inner message loop runs in
// `DisconnectFromCurrentPrintJob()`.
@@ -328,7 +341,9 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
// go in `ReleasePrintJob()`.
@@ -332,6 +345,9 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
#endif
SetPrintingRFH(rfh);
- GetPrintRenderFrame(rfh)->PrintRequestedPages();
+ callback_ = std::move(callback);
+
+ GetPrintRenderFrame(rfh)->PrintRequestedPages(silent, std::move(settings));
for (auto& observer : GetObservers())
observer.OnPrintNow(rfh);
@@ -471,7 +486,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
#if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
enterprise_connectors::ContentAnalysisDelegate::Data scanning_data;
@@ -500,7 +516,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
void PrintViewManagerBase::ScriptedPrintReply(
ScriptedPrintCallback callback,
int process_id,
@@ -245,8 +243,8 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
+ bool canceled) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (!content::RenderProcessHost::FromID(process_id)) {
@@ -479,16 +495,19 @@ void PrintViewManagerBase::ScriptedPrintReply(
#if BUILDFLAG(ENABLE_OOP_PRINTING)
@@ -513,16 +530,19 @@ void PrintViewManagerBase::ScriptedPrintReply(
return;
}
@@ -270,23 +268,23 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
}
void PrintViewManagerBase::NavigationStopped() {
@@ -602,12 +621,13 @@ void PrintViewManagerBase::DidPrintDocument(
@@ -638,11 +658,14 @@ void PrintViewManagerBase::DidPrintDocument(
void PrintViewManagerBase::GetDefaultPrintSettings(
GetDefaultPrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+#if 0 // Printing is always enabled.
+
if (!printing_enabled_.GetValue()) {
GetDefaultPrintSettingsReply(std::move(callback),
mojom::PrintParams::New());
return;
}
-
+#endif
content::RenderFrameHost* render_frame_host = GetCurrentTargetFrame();
auto callback_wrapper =
base::BindOnce(&PrintViewManagerBase::GetDefaultPrintSettingsReply,
@@ -624,18 +644,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
base::Value job_settings,
#if BUILDFLAG(ENABLE_OOP_PRINTING)
if (printing::features::kEnableOopPrintDriversJobPrint.Get() &&
!service_manager_client_id_.has_value()) {
@@ -672,18 +695,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
base::Value::Dict job_settings,
UpdatePrintSettingsCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+#if 0 // Printing is always enabled.
@@ -297,7 +295,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
}
-
+#endif
if (!job_settings.FindIntKey(kSettingPrinterType)) {
if (!job_settings.FindInt(kSettingPrinterType)) {
UpdatePrintSettingsReply(std::move(callback),
CreateEmptyPrintPagesParamsPtr(), false);
return;
@@ -307,15 +305,15 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
content::BrowserContext* context =
web_contents() ? web_contents()->GetBrowserContext() : nullptr;
PrefService* prefs =
@@ -645,6 +667,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
@@ -693,6 +718,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
if (value > 0)
job_settings.SetIntKey(kSettingRasterizePdfDpi, value);
job_settings.Set(kSettingRasterizePdfDpi, value);
}
+#endif
auto callback_wrapper =
base::BindOnce(&PrintViewManagerBase::UpdatePrintSettingsReply,
@@ -670,7 +693,7 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
@@ -718,14 +744,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);
@@ -323,8 +321,16 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
+ std::move(callback).Run(CreateEmptyPrintPagesParamsPtr(), false);
return;
}
auto callback_wrapper = base::BindOnce(
@@ -691,7 +714,6 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
#if BUILDFLAG(ENABLE_OOP_PRINTING)
if (printing::features::kEnableOopPrintDriversJobPrint.Get() &&
!service_manager_client_id_.has_value()) {
// Renderer process has requested settings outside of the expected setup.
- std::move(callback).Run(CreateEmptyPrintPagesParamsPtr());
+ std::move(callback).Run(CreateEmptyPrintPagesParamsPtr(), false);
return;
}
#endif
@@ -748,7 +774,6 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
PrintManager::PrintingFailed(cookie);
#if !BUILDFLAG(IS_ANDROID) // Android does not implement this function.
@@ -332,7 +338,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
#endif
ReleasePrinterQuery();
@@ -706,6 +728,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
@@ -763,6 +788,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
}
void PrintViewManagerBase::ShowInvalidPrinterSettingsError() {
@@ -344,7 +350,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(&ShowWarningMessageBox,
l10n_util::GetStringUTF16(
@@ -716,10 +743,12 @@ void PrintViewManagerBase::RenderFrameHostStateChanged(
@@ -773,10 +803,12 @@ void PrintViewManagerBase::RenderFrameHostStateChanged(
content::RenderFrameHost* render_frame_host,
content::RenderFrameHost::LifecycleState /*old_state*/,
content::RenderFrameHost::LifecycleState new_state) {
@@ -357,7 +363,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
}
void PrintViewManagerBase::DidStartLoading() {
@@ -779,6 +808,11 @@ void PrintViewManagerBase::OnJobDone() {
@@ -836,6 +868,11 @@ void PrintViewManagerBase::OnJobDone() {
ReleasePrintJob();
}
@@ -369,7 +375,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
void PrintViewManagerBase::OnFailed() {
TerminatePrintJob(true);
}
@@ -840,7 +874,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -893,7 +930,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
// Disconnect the current |print_job_|.
auto weak_this = weak_ptr_factory_.GetWeakPtr();
@@ -381,9 +387,9 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
if (!weak_this)
return false;
@@ -915,6 +952,13 @@ void PrintViewManagerBase::ReleasePrintJob() {
content::RenderFrameHost* rfh = printing_rfh_;
printing_rfh_ = nullptr;
@@ -972,6 +1012,13 @@ void PrintViewManagerBase::ReleasePrintJob() {
UnregisterSystemPrintClient();
#endif
+ if (!callback_.is_null()) {
+ std::string cb_str = "";
@@ -395,7 +401,7 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
if (!print_job_)
return;
@@ -964,7 +1008,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
@@ -1021,7 +1068,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
}
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
@@ -404,11 +410,20 @@ index 1f37c11047d47bb2d65975fa69f33d822206dd08..d13ee6a81cd7edc5be99f595515ca521
return true;
if (!cookie) {
@@ -1129,7 +1176,7 @@ void PrintViewManagerBase::SendPrintingEnabled(bool enabled,
}
void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) {
- GetPrintRenderFrame(rfh)->PrintRequestedPages();
+ GetPrintRenderFrame(rfh)->PrintRequestedPages(/*silent=*/true, /*job_settings=*/base::Value::Dict());
for (auto& observer : GetObservers())
observer.OnPrintNow(rfh);
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index 2661776307f773ac8f2c62529ec86349b045ee8f..cb41b271adbb02517a5e1ad222d0320000437dfb 100644
index 48895e0f8a846aeb725e306c7f22ac159d5d96a7..027794e38f86ab1905c5cdd95140b2cb1e5c5653 100644
--- a/chrome/browser/printing/print_view_manager_base.h
+++ b/chrome/browser/printing/print_view_manager_base.h
@@ -37,6 +37,8 @@ namespace printing {
@@ -41,6 +41,8 @@ namespace printing {
class PrintQueriesQueue;
class PrinterQuery;
@@ -417,19 +432,19 @@ index 2661776307f773ac8f2c62529ec86349b045ee8f..cb41b271adbb02517a5e1ad222d03200
// Base class for managing the print commands for a WebContents.
class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
public:
@@ -58,7 +60,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -62,7 +64,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.
- virtual bool PrintNow(content::RenderFrameHost* rfh);
+ virtual bool PrintNow(content::RenderFrameHost* rfh,
+ bool silent = true,
+ base::Value settings = {},
+ base::Value::Dict settings = {},
+ CompletionCallback callback = {});
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Prints the document in `print_data` with settings specified in
@@ -106,6 +111,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -110,6 +115,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
ScriptedPrintCallback callback) override;
void ShowInvalidPrinterSettingsError() override;
void PrintingFailed(int32_t cookie) override;
@@ -437,7 +452,7 @@ index 2661776307f773ac8f2c62529ec86349b045ee8f..cb41b271adbb02517a5e1ad222d03200
// Adds and removes observers for `PrintViewManagerBase` events. The order in
// which notifications are sent to observers is undefined. Observers must be
@@ -193,7 +199,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -231,7 +237,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// Runs `callback` with `params` to reply to ScriptedPrint().
void ScriptedPrintReply(ScriptedPrintCallback callback,
int process_id,
@@ -447,7 +462,7 @@ index 2661776307f773ac8f2c62529ec86349b045ee8f..cb41b271adbb02517a5e1ad222d03200
// 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
@@ -248,9 +255,15 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
@@ -297,9 +304,15 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// The current RFH that is printing with a system printing dialog.
raw_ptr<content::RenderFrameHost> printing_rfh_ = nullptr;
@@ -464,7 +479,7 @@ index 2661776307f773ac8f2c62529ec86349b045ee8f..cb41b271adbb02517a5e1ad222d03200
// This means we are _blocking_ until all the necessary pages have been
// rendered or the print settings are being loaded.
diff --git a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc
index 879004c790d57b28e7a816ebf560971876c17168..334509d3ab45af4bb7877f656ca5aca7ee1bce00 100644
index 016e0d8fcc575bfa77323d8600d5daba152abbc6..dfb856f57767e24c0ec495c94e515afbb83e19ea 100644
--- a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc
+++ b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.cc
@@ -20,7 +20,7 @@ FakePrintRenderFrame::FakePrintRenderFrame(
@@ -472,25 +487,25 @@ index 879004c790d57b28e7a816ebf560971876c17168..334509d3ab45af4bb7877f656ca5aca7
FakePrintRenderFrame::~FakePrintRenderFrame() = default;
-void FakePrintRenderFrame::PrintRequestedPages() {}
+void FakePrintRenderFrame::PrintRequestedPages(bool /*silent*/, ::base::Value /*settings*/) {}
+void FakePrintRenderFrame::PrintRequestedPages(bool /*silent*/, ::base::Value::Dict /*settings*/) {}
void FakePrintRenderFrame::PrintForSystemDialog() {}
diff --git a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h
index 10f46664d8337d6be2fac24d9a6933429f3b2c2b..6de833f2da3ae85cf0752284146974f2026ab174 100644
index 3c95ee5c0d169f677947427a6ace55b4bfe80277..63ba8aca503968d0409b63b991a9276228d60d4a 100644
--- a/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h
+++ b/chrome/browser/ui/webui/print_preview/fake_print_render_frame.h
@@ -24,7 +24,7 @@ class FakePrintRenderFrame : public mojom::PrintRenderFrame {
@@ -25,7 +25,7 @@ class FakePrintRenderFrame : public mojom::PrintRenderFrame {
private:
// printing::mojom::PrintRenderFrame:
- void PrintRequestedPages() override;
+ void PrintRequestedPages(bool silent, ::base::Value settings) override;
+ void PrintRequestedPages(bool silent, ::base::Value::Dict settings) override;
void PrintForSystemDialog() override;
void SetPrintPreviewUI(
mojo::PendingAssociatedRemote<mojom::PrintPreviewUI> preview) override;
diff --git a/components/printing/browser/print_to_pdf/pdf_print_manager.cc b/components/printing/browser/print_to_pdf/pdf_print_manager.cc
index 66810a2a5f0c77ba107c71d2abaef8692bda0fea..cd6103af4571f82f11652a3c7ecf0e534428dc49 100644
index 3ba45e77f66531bc6b81717eb9c7d3faca1e9fa9..41271d3fe390dd16d1c2b9839ac32013f495df51 100644
--- a/components/printing/browser/print_to_pdf/pdf_print_manager.cc
+++ b/components/printing/browser/print_to_pdf/pdf_print_manager.cc
@@ -116,7 +116,8 @@ void PdfPrintManager::PrintToPdf(
@@ -539,19 +554,19 @@ index 66810a2a5f0c77ba107c71d2abaef8692bda0fea..cd6103af4571f82f11652a3c7ecf0e53
void PdfPrintManager::ShowInvalidPrinterSettingsError() {
diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom
index 5afad24754e12554368a6619466ca025edc26180..e2e786692bd877d3b8bf7c31829496afa99ed539 100644
index 156b987aa9cafb69c04bed483aa78f26baa9cd97..3d3f2cb97b59a6e46bf0c16dd2355aa8e21ec5da 100644
--- a/components/printing/common/print.mojom
+++ b/components/printing/common/print.mojom
@@ -274,7 +274,7 @@ interface PrintPreviewUI {
@@ -275,7 +275,7 @@ interface PrintPreviewUI {
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.
- PrintRequestedPages();
+ PrintRequestedPages(bool silent, mojo_base.mojom.DeprecatedDictionaryValue settings);
+ PrintRequestedPages(bool silent, mojo_base.mojom.DictionaryValue settings);
// Tells the RenderFrame to switch the CSS to print media type, render every
// requested page using the print preview document's frame/node, and then
@@ -341,7 +341,7 @@ interface PrintManagerHost {
@@ -348,7 +348,7 @@ interface PrintManagerHost {
// Request the print settings from the user. This step is about showing
// UI to the user to select the final print settings.
[Sync]
@@ -561,10 +576,10 @@ index 5afad24754e12554368a6619466ca025edc26180..e2e786692bd877d3b8bf7c31829496af
// Tells the browser that there are invalid printer settings.
ShowInvalidPrinterSettingsError();
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index 066521576d021cbd3e68057f68199c23a8a30437..72777428d2456191875806bc3c57d0801b43a8ea 100644
index e0ecf8f3f09dafe44a5220117281a08e38a61bef..edbaa28ec4ffd22b6afa332365c5dc51c33de31e 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -40,6 +40,7 @@
@@ -41,6 +41,7 @@
#include "printing/metafile_skia.h"
#include "printing/mojom/print.mojom.h"
#include "printing/print_job_constants.h"
@@ -572,26 +587,26 @@ index 066521576d021cbd3e68057f68199c23a8a30437..72777428d2456191875806bc3c57d080
#include "printing/units.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
@@ -1263,7 +1264,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
@@ -1276,7 +1277,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
if (!weak_this)
return;
- Print(web_frame, blink::WebNode(), PrintRequestType::kScripted);
+ Print(web_frame, blink::WebNode(), PrintRequestType::kScripted,
+ false /* silent */, base::DictionaryValue() /* new_settings */);
+ false /* silent */, base::Value::Dict() /* new_settings */);
if (!weak_this)
return;
@@ -1294,7 +1296,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
@@ -1307,7 +1309,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
receivers_.Add(this, std::move(receiver));
}
-void PrintRenderFrameHelper::PrintRequestedPages() {
+void PrintRenderFrameHelper::PrintRequestedPages(bool silent, base::Value settings) {
+void PrintRenderFrameHelper::PrintRequestedPages(bool silent, base::Value::Dict settings) {
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@@ -1309,7 +1311,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
@@ -1322,7 +1324,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
// plugin node and print that instead.
auto plugin = delegate_->GetPdfElement(frame);
@@ -600,17 +615,17 @@ index 066521576d021cbd3e68057f68199c23a8a30437..72777428d2456191875806bc3c57d080
if (!render_frame_gone_)
frame->DispatchAfterPrintEvent();
@@ -1340,7 +1342,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
@@ -1353,7 +1355,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
}
Print(frame, print_preview_context_.source_node(),
- PrintRequestType::kRegular);
+ PrintRequestType::kRegular, false,
+ base::DictionaryValue());
+ base::Value::Dict());
if (!render_frame_gone_)
print_preview_context_.DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1387,6 +1390,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
@@ -1402,6 +1405,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
return;
@@ -618,38 +633,38 @@ index 066521576d021cbd3e68057f68199c23a8a30437..72777428d2456191875806bc3c57d080
+ print_preview_context_.InitWithFrame(frame);
print_preview_context_.OnPrintPreview();
if (print_preview_context_.IsForArc()) {
@@ -1924,7 +1929,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
@@ -2008,7 +2013,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
return;
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
- PrintRequestType::kRegular);
+ PrintRequestType::kRegular, false /* silent */,
+ base::DictionaryValue() /* new_settings */);
+ base::Value::Dict() /* new_settings */);
// Check if |this| is still valid.
if (!weak_this)
return;
@@ -1939,7 +1945,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -2023,7 +2029,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
- PrintRequestType print_request_type) {
+ PrintRequestType print_request_type,
+ bool silent,
+ base::Value settings) {
+ base::Value::Dict settings) {
// If still not finished with earlier print request simply ignore.
if (prep_frame_view_)
return;
@@ -1947,7 +1955,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -2031,7 +2039,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, base::Value::AsDictionaryValue(settings))) {
+ if (!CalculateNumberOfPages(frame, node, &expected_page_count, std::move(settings))) {
DidFinishPrinting(FAIL_PRINT_INIT);
return; // Failed to init print page settings.
}
@@ -1966,8 +1974,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -2050,8 +2058,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
print_pages_params_->params->print_scaling_option;
auto self = weak_ptr_factory_.GetWeakPtr();
@@ -666,7 +681,7 @@ index 066521576d021cbd3e68057f68199c23a8a30437..72777428d2456191875806bc3c57d080
// Check if |this| is still valid.
if (!self)
return;
@@ -2215,36 +2230,51 @@ void PrintRenderFrameHelper::IPCProcessed() {
@@ -2300,36 +2315,52 @@ void PrintRenderFrameHelper::IPCProcessed() {
}
}
@@ -676,10 +691,10 @@ index 066521576d021cbd3e68057f68199c23a8a30437..72777428d2456191875806bc3c57d080
- GetPrintManagerHost()->GetDefaultPrintSettings(&settings.params);
+bool PrintRenderFrameHelper::InitPrintSettings(
+ bool fit_to_paper_size,
+ const base::DictionaryValue& new_settings) {
+ base::Value::Dict new_settings) {
+ mojom::PrintPagesParamsPtr settings;
+
+ if (new_settings.DictEmpty()) {
+ if (new_settings.empty()) {
+ settings = mojom::PrintPagesParams::New();
+ settings->params = mojom::PrintParams::New();
+ GetPrintManagerHost()->GetDefaultPrintSettings(&settings->params);
@@ -687,7 +702,8 @@ index 066521576d021cbd3e68057f68199c23a8a30437..72777428d2456191875806bc3c57d080
+ bool canceled = false;
+ int cookie =
+ print_pages_params_ ? print_pages_params_->params->document_cookie : 0;
+ GetPrintManagerHost()->UpdatePrintSettings(cookie, new_settings.Clone(), &settings, &canceled);
+ GetPrintManagerHost()->UpdatePrintSettings(
+ cookie, std::move(new_settings), &settings, &canceled);
+ if (canceled)
+ return false;
+ }
@@ -722,15 +738,15 @@ index 066521576d021cbd3e68057f68199c23a8a30437..72777428d2456191875806bc3c57d080
+ blink::WebLocalFrame* frame,
+ const blink::WebNode& node,
+ uint32_t* number_of_pages,
+ const base::DictionaryValue& settings) {
+ base::Value::Dict settings) {
DCHECK(frame);
bool fit_to_paper_size = !IsPrintingNodeOrPdfFrame(frame, node);
bool fit_to_paper_size = !IsPrintingPdfFrame(frame, node);
- if (!InitPrintSettings(fit_to_paper_size)) {
+ if (!InitPrintSettings(fit_to_paper_size, settings)) {
+ if (!InitPrintSettings(fit_to_paper_size, std::move(settings))) {
notify_browser_of_print_failure_ = false;
GetPrintManagerHost()->ShowInvalidPrinterSettingsError();
return false;
@@ -2389,7 +2419,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
@@ -2454,7 +2485,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
std::move(params),
base::BindOnce(
[](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output,
@@ -739,7 +755,7 @@ index 066521576d021cbd3e68057f68199c23a8a30437..72777428d2456191875806bc3c57d080
*output = std::move(input);
std::move(quit_closure).Run();
},
@@ -2634,18 +2664,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type,
@@ -2705,18 +2736,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type,
}
bool PrintRenderFrameHelper::CheckForCancel() {
@@ -760,7 +776,7 @@ index 066521576d021cbd3e68057f68199c23a8a30437..72777428d2456191875806bc3c57d080
bool PrintRenderFrameHelper::PreviewPageRendered(
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
index 2b703118bf94a82262adc293368dcfcdb67807ff..a07f307ff48f3ce5409354a5ba8d54b43325da73 100644
index 15c367bd66706c915fdb95faf483429a8b31eb4c..ba2d5decbad2195c63efa4a5e23c60df7de69441 100644
--- a/components/printing/renderer/print_render_frame_helper.h
+++ b/components/printing/renderer/print_render_frame_helper.h
@@ -254,7 +254,7 @@ class PrintRenderFrameHelper
@@ -768,52 +784,52 @@ index 2b703118bf94a82262adc293368dcfcdb67807ff..a07f307ff48f3ce5409354a5ba8d54b4
// printing::mojom::PrintRenderFrame:
- void PrintRequestedPages() override;
+ void PrintRequestedPages(bool silent, base::Value settings) override;
+ void PrintRequestedPages(bool silent, base::Value::Dict settings) override;
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void PrintForSystemDialog() override;
void SetPrintPreviewUI(
@@ -321,7 +321,9 @@ class PrintRenderFrameHelper
@@ -325,7 +325,9 @@ class PrintRenderFrameHelper
// WARNING: |this| may be gone after this method returns.
void Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
- PrintRequestType print_request_type);
+ PrintRequestType print_request_type,
+ bool silent,
+ base::Value settings);
+ base::Value::Dict settings);
// Notification when printing is done - signal tear-down/free resources.
void DidFinishPrinting(PrintingResult result);
@@ -330,12 +332,14 @@ class PrintRenderFrameHelper
@@ -334,12 +336,14 @@ class PrintRenderFrameHelper
// Initialize print page settings with default settings.
// Used only for native printing workflow.
- bool InitPrintSettings(bool fit_to_paper_size);
+ bool InitPrintSettings(bool fit_to_paper_size,
+ const base::DictionaryValue& settings);
+ base::Value::Dict new_settings);
// Calculate number of pages in source document.
bool CalculateNumberOfPages(blink::WebLocalFrame* frame,
const blink::WebNode& node,
- uint32_t* number_of_pages);
+ uint32_t* number_of_pages,
+ const base::DictionaryValue& settings);
+ base::Value::Dict settings);
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Set options for print preset from source PDF document.
diff --git a/printing/printing_context.cc b/printing/printing_context.cc
index 3d8281c8af9a4339bdd492c67edafc4ec6efb09d..6f8b9d42e051579cf1d0774afa771a7e45d31ff2 100644
index 8a8fcefa9da92a044f5bdf6a2f242048b325d442..6dae33514675d6843736b2c9a767a4b72cb103fa 100644
--- a/printing/printing_context.cc
+++ b/printing/printing_context.cc
@@ -120,7 +120,6 @@ mojom::ResultCode PrintingContext::UsePdfSettings() {
@@ -117,7 +117,6 @@ mojom::ResultCode PrintingContext::UsePdfSettings() {
mojom::ResultCode PrintingContext::UpdatePrintSettings(
base::Value job_settings) {
base::Value::Dict job_settings) {
- ResetSettings();
{
std::unique_ptr<PrintSettings> settings =
PrintSettingsFromJobSettings(job_settings);
diff --git a/printing/printing_context.h b/printing/printing_context.h
index 3f36303105b7979a1a771bf26b42596abe5b3cce..52f740bb832db4a8d76431d9bc77cab10bb7e0c7 100644
index 2c8ef23f7cb75a743fa18e3c613f7c719988028c..265005d6d51f861aa7ccd7e0eba7809b3c652dae 100644
--- a/printing/printing_context.h
+++ b/printing/printing_context.h
@@ -170,6 +170,9 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {

View File

@@ -8,7 +8,7 @@ Chrome moved the SetCursor IPC message to mojo, which we use to tell OSR about `
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172779
diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h
index 059ff2b47e7aa8b9707e71ae9a1793bfdd86d319..529637f8b6af6b8b45f9de61d27b5e9c379c9645 100644
index bdad25cd2c823fa2125fc523c400479882735ae6..bf2ddb136274eb3e4e597ed3060aabcaa9c5f432 100644
--- a/content/browser/renderer_host/render_widget_host_delegate.h
+++ b/content/browser/renderer_host/render_widget_host_delegate.h
@@ -14,6 +14,7 @@
@@ -19,7 +19,7 @@ index 059ff2b47e7aa8b9707e71ae9a1793bfdd86d319..529637f8b6af6b8b45f9de61d27b5e9c
#include "content/public/common/drop_data.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@@ -252,6 +253,9 @@ class CONTENT_EXPORT RenderWidgetHostDelegate {
@@ -257,6 +258,9 @@ class CONTENT_EXPORT RenderWidgetHostDelegate {
// Returns the associated RenderViewHostDelegateView*, if possible.
virtual RenderViewHostDelegateView* GetDelegateView();
@@ -30,10 +30,10 @@ index 059ff2b47e7aa8b9707e71ae9a1793bfdd86d319..529637f8b6af6b8b45f9de61d27b5e9c
// 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 ed56e947fa137cbaddaa12503ae983d7acd4463f..e1d77416991bac0178935b1bd255947d20db6210 100644
index 7cda66952e0d3a67c32791ad3c7d7de8df03f876..8cb3a596593c52e776d546d25fb078003204faa6 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -2073,6 +2073,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) {
@@ -2080,6 +2080,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) {
void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
if (view_)
view_->UpdateCursor(WebCursor(cursor));
@@ -43,10 +43,10 @@ index ed56e947fa137cbaddaa12503ae983d7acd4463f..e1d77416991bac0178935b1bd255947d
void RenderWidgetHostImpl::ShowContextMenuAtPoint(
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 92dcf2308842ce8922426b0cafdd5a3e83f4bd52..d69e028b34ab4407abcdea3ece93db39926c587e 100644
index faa795be3a6cbc7ae13d9a42a1bdbd01ac0406a9..add5ba98f4409460b93aa2f8c49eb49a1f59470a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4494,6 +4494,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
@@ -4523,6 +4523,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
return text_input_manager_.get();
}
@@ -59,19 +59,19 @@ index 92dcf2308842ce8922426b0cafdd5a3e83f4bd52..d69e028b34ab4407abcdea3ece93db39
RenderWidgetHostImpl* render_widget_host) {
return render_widget_host == GetMainFrame()->GetRenderWidgetHost();
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index fdb4a26de507f260466a7bc22c5cadc64190c342..55224f960151b0cae23b2a49d755eace630e9e3a 100644
index 7ad2648933434282c5bdd3fd5d9187d86e142b60..2a29af8d9aa67768ec521e87190174397a25b722 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -961,6 +961,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
blink::mojom::FrameVisibility visibility) override;
@@ -962,6 +962,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
void SendScreenRects() override;
void SendActiveState(bool active) override;
TextInputManager* GetTextInputManager() override;
+ void OnCursorChanged(const WebCursor& cursor) override;
bool IsWidgetForPrimaryMainFrame(
RenderWidgetHostImpl* render_widget_host) override;
bool IsShowingContextMenuOnPage() const override;
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index b68d706fe204c3e8d65b2bf523950840c0398db2..8852a8da29bc9b7f9b832ad392741751f46e3fd7 100644
index 9ee3b74460c009c92fb811787250270ea13233b3..802d02e825d98f103f48e3134d6b9dd7e99aa2c5 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -13,6 +13,7 @@

Some files were not shown because too many files have changed in this diff Show More