Compare commits

...

69 Commits

Author SHA1 Message Date
trop[bot]
42a72df1e7 refactor: remove deprecated BrowserContext::ResourceContext (#41246)
* refactor: remove ResourceContext* arg from GetNSSCertDatabaseForResourceContext()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: remove ResourceContext* arg from CertificateManagerModel::GetCertDBOnIOThread()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: remove BrowserContext* arg from CertificateManagerModel::Create()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: remove unused forward declarations

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: rename method to GetNSSCertDatabase()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! refactor: remove BrowserContext* arg from CertificateManagerModel::Create()

chore: remove unneeded line

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-02-06 09:16:18 -06:00
trop[bot]
16764199a7 fix: original-fs import replacement (#41238)
fix: original-fs import replacement

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-02-05 17:03:08 -05:00
trop[bot]
4113f9d6a6 fix: crash problem with message_port close event (#41237)
When worker_thread shutdown, it will destory context and close
message_port. In this case, it should not dispatch close event.
Because it forbid script running during NotifyContextDestroyed in
ContextLifecycleNotifier.
Now chromium has implemented close_event and will not crash,
so we remove the patch with #22532 and add one test.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jinli Wu <wujinli@bytedance.com>
2024-02-05 10:47:02 +01:00
trop[bot]
7aff4bc1dd refactor: type-safe module imports / requires (#41235)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2024-02-05 10:46:53 +01:00
trop[bot]
d5b0df6775 docs: add note about fuses to our security documentation (#41227)
docs: add note about fuses to our security documentation (#41210)

* Add note about fuses to our security documentation

Additionally, add the missing #18 to the ToC.

* lint issues for security.md

* Update docs/tutorial/security.md



* move reference links to bottom of security.md

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Kilian Valkhof <kilian@kilianvalkhof.com>
2024-02-03 11:30:28 -06:00
trop[bot]
b4f66e5f79 refactor: replace use of deprecated base::JSONWriter::WriteJson() (#41223)
* refactor: use base::WriteJson() in ListValueToNSArray()

refactor: use base::WriteJson() in DictionaryValueToNSDictionary()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use base::WriteJson() in Debugger::SendCommand()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use base::WriteJson() in ScriptingExecuteScriptFunction::Run()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use base::WriteJson() in HandleAccessibilityRequestCallback()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-02-02 19:08:52 -06:00
Calvin
fbab31a699 chore: cherry-pick e7ffe20ebfac from chromium (#41216)
* chore: cherry-pick e7ffe20ebfac from chromium

* chore: update patches

---------

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2024-02-01 13:27:40 -08:00
electron-roller[bot]
7bccdbcbdb chore: bump chromium to 122.0.6261.18 (29-x-y) (#41203)
* chore: bump chromium in DEPS to 122.0.6261.18

* 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>
2024-02-01 14:05:45 +01:00
trop[bot]
d715090a36 fix: select-usb-device should respect filters option (#41197)
fix: select-usb-device should respect filters option

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-31 21:18:52 +01:00
trop[bot]
31054d6d46 docs: document printToPDF generateDocumentOutline option (#41167)
* doc: document printToPDF generateDocumentOutline option

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

* doc: ready event to whenReady

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-31 12:03:28 +01:00
trop[bot]
76859affbd fix: avoid potential CHECK() failure in DictionaryToRect() (#41184)
refactor: use gfx::Rect::Contains() instead of reinventing the wheel

perf: use base::Value::FindInt() to avoid redundant map lookups

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-31 12:02:44 +01:00
trop[bot]
f3224365cf refactor: type-safe imports in lib/node/init.ts (#41186)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2024-01-31 10:07:34 +01:00
trop[bot]
4a24337b14 refactor: simplify code by using base::Value::EnsureList() (#41182)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-31 10:07:28 +01:00
trop[bot]
2312420deb fix: shouldPrintBackgrounds -> printBackground in webContents.printToPDF (#41180)
fix: shouldPrintBackgrounds -> printBackground

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-31 10:07:12 +01:00
trop[bot]
a05c9bcfb9 refactor: inline simple getters (#41163)
* refactor: inline OffScreenRenderWidgetHostView::IsPainting()

refactor: inline OffScreenRenderWidgetHostView::GetFrameRate()

refactor: inline OffScreenRenderWidgetHostView::GetRootLayer()

refactor: inline OffScreenRenderWidgetHostView::GetDelegatedFrameHost()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: inline OffscreenViewProxy::GetBitmap()

refactor: inline OffscreenViewProxy::GetBounds()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: inline WebContentsZoomController::GetDefaultZoomFactor()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: inline Notification prop getters

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: inline RootView::is_menu_bar_auto_hide()

refactor: inline RootView::is_menu_bar_visible()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: inline ElectronBrowserContext::can_use_http_cache()

refactor: inline ElectronBrowserContext::get_max_cache_size()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! refactor: inline Notification prop getters

remove get_ prefix from inlined simple getter method names

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! refactor: inline OffscreenViewProxy::GetBitmap()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! refactor: inline WebContentsZoomController::GetDefaultZoomFactor()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! refactor: inline Notification prop getters

have object getters return const references

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: rename method to OffScreenRenderWidgetHostView::root_layer()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: rename method to ElectronBrowserContext::max_cache_size()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: rename method to OffScreenRenderWidgetHostView::frame_rate()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: rename method to OffScreenRenderWidgetHostView::delegated_frame_host()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-30 09:45:19 +01:00
trop[bot]
25f52d5d32 fix: potential async_hooks crash in NotifyWindowRestore on Windows (#41146)
* fix: potential async_hooks crash in NotifyWindowRestore on Windows

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

* fix: don't use CallbackScope for Error objects

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-29 10:11:46 +01:00
trop[bot]
1fefe25ed5 fix: update osk patch to fix more corner cases (#41149)
This is a follow up to https://github.com/electron/electron/pull/35921
that, it fixes more corner cases that on-screen-keyboard does not hide
for webviews.

This change has been applied in Teams for quite a while and should be
reliable enough to introduce to Electron.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2024-01-29 09:54:25 +01:00
trop[bot]
d92ffceafb fix: apply module search paths restriction on worker and child process (#41138)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2024-01-26 09:28:26 -06:00
trop[bot]
6e1dc452f9 build: remove unneeded dlls in Windows zip (#41129)
* build: fixup zip manifest check on Windows

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* build: remove unused dlls

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2024-01-25 17:46:52 -06:00
electron-roller[bot]
9daf416097 chore: bump chromium to 122.0.6261.6 (29-x-y) (#40959)
* chore: bump chromium in DEPS to 122.0.6240.1

* chore: bump chromium in DEPS to 122.0.6241.6

* chore: bump chromium in DEPS to 122.0.6245.1

* chore: bump chromium in DEPS to 122.0.6247.1

* chore: bump chromium in DEPS to 122.0.6249.1

* chore: bump chromium in DEPS to 122.0.6251.1

* chore: bump chromium in DEPS to 122.0.6253.1

* chore: bump chromium in DEPS to 122.0.6255.1

* chore: bump chromium in DEPS to 122.0.6257.1

* chore: bump chromium in DEPS to 122.0.6259.1

* chore: bump chromium in DEPS to 122.0.6259.3

* chore: bump chromium in DEPS to 122.0.6259.5

* chore: bump chromium in DEPS to 122.0.6260.0

* chore: bump chromium in DEPS to 122.0.6261.1

* chore: bump chromium in DEPS to 122.0.6261.6

* chore: update patches

(cherry picked from commit dde66c3589)

* refactor: extensions replaced StringPiece with string_view

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

* chore: update patches

(cherry picked from commit 95b04b1fca)

* 5192010: Rename {absl => std}::optional in //chrome/

https://chromium-review.googlesource.com/c/chromium/src/+/5192010
(cherry picked from commit 55e5867614)

* 5109767: CodeHealth: Fix leaked raw_ptr in Linux ProcessSingleton

https://chromium-review.googlesource.com/c/chromium/src/+/5109767
(cherry picked from commit 7b2efc7586)

* 5105227: [media_preview] Show requested device in permission bubble

https://chromium-review.googlesource.com/c/chromium/src/+/5105227
(cherry picked from commit 10d61636c6)

* chore: update patches

(cherry picked from commit d04ebc7b07)

* 5180720: Polish tiled browser window UI on Linux | https://chromium-review.googlesource.com/c/chromium/src/+/5180720

(cherry picked from commit 3dbbb67dbc)

* chore: update patches

(cherry picked from commit 18a5961e4e)

* chore: update patches

(cherry picked from commit 69e0bfefcc)

* 5186276: [autopip] Make "allow once" per navigation | https://chromium-review.googlesource.com/c/chromium/src/+/5186276

(cherry picked from commit 412f70681a)

* chore: update patches

(cherry picked from commit e4d2a2ded0)

* 5190661: Automated T* -> raw_ptr<T> rewrite "refresh" | https://chromium-review.googlesource.com/c/chromium/src/+/5190661

(cherry picked from commit 6b41b72130)

* 5206106: Make sure RenderFrameHosts are active when printing | https://chromium-review.googlesource.com/c/chromium/src/+/5206106

(cherry picked from commit 9a788c0c60)

* 5202674: Reland "Automated T* -> raw_ptr<T> rewrite 'refresh'"

https://chromium-review.googlesource.com/c/chromium/src/+/5202674
(cherry picked from commit 55daca952d)

* fixup CodeHealth: Fix leaked raw_ptr in Linux ProcessSingleton

https://chromium-review.googlesource.com/c/chromium/src/+/5109767
(cherry picked from commit 047898ba92)

* fixup 5206106: Make sure RenderFrameHosts are active when printing

(cherry picked from commit 715c534cd8)

* Make legacy ToV8() helpers private to ScriptPromiseResolver, their only user

https://chromium-review.googlesource.com/c/chromium/src/+/5207474
(cherry picked from commit 9a10062d8c)

* fixup CodeHealth: Fix leaked raw_ptr in Linux ProcessSingleton

(cherry picked from commit a1f643b25e)

* fixup 5186276: [autopip] Make "allow once" per navigation

https://chromium-review.googlesource.com/c/chromium/src/+/5186276
(cherry picked from commit e3c40ed923)

* 5191363: Mark LOG(FATAL) [[noreturn]]

https://chromium-review.googlesource.com/c/chromium/src/+/5191363
(cherry picked from commit 8037cef988)

* fixup 5186276: [autopip] Make "allow once" per navigation

https://chromium-review.googlesource.com/c/chromium/src/+/5186276
(cherry picked from commit e60c31dd4f)

* fixup Make legacy ToV8() helpers private to ScriptPromiseResolver

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

(cherry picked from commit b02108e0c0)

* chore: update patches

(cherry picked from commit 96e8574115)

* chore: update patches

(cherry picked from commit e0f51957be)

* chore: restore patch that was mistakenly removed

(cherry picked from commit 4057b5439c)

* 5181931: Improve LoginHandler (Part 9 / N)

https://chromium-review.googlesource.com/c/chromium/src/+/5181931
(cherry picked from commit 6ad8028fe8)

* Dispatch SiteInstanceGotProcess() only when both process and site are set.

https://chromium-review.googlesource.com/c/chromium/src/+/5142354
(cherry picked from commit a871198a23)

* 5171446: [AsyncSB] Pass navigation_id into CreateURLLoaderThrottles

https://chromium-review.googlesource.com/c/chromium/src/+/5171446
(cherry picked from commit ebf2efcedd)

* 5213708: Move DownloadTargetInfo into components/download

https://chromium-review.googlesource.com/c/chromium/src/+/5213708
(cherry picked from commit c361ded147)

* extensions: Add a loader for Controlled Frame embedder scripts

https://chromium-review.googlesource.com/c/chromium/src/+/5202765
(cherry picked from commit 63d2773d15)

* [CSC][Zoom] Add initial_zoom_level to DisplayMediaInformation

https://chromium-review.googlesource.com/c/chromium/src/+/5168626
(cherry picked from commit a4b5c9ce31)

* fix: suppress clang -Wimplicit-const-int-float-conversion

(cherry picked from commit 979bde6683)

* fixup 5191363: Mark LOG(FATAL) [[noreturn]] for Windows

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

(cherry picked from commit 759f1740a8)

* 5167921: Remove Widget::IsTranslucentWindowOpacitySupported

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

Also
5148392: PinnedState: Support pinned state in PlatformWindowState | https://chromium-review.googlesource.com/c/chromium/src/+/5148392

(cherry picked from commit 53d9c82a57)

* fixup: 5180720: Polish tiled browser window UI on Linux

https://chromium-review.googlesource.com/c/chromium/src/+/5180720
(cherry picked from commit e565db5095)

* 5170669: clipboard: Migrate DOMException constructors to RejectWith-

https://chromium-review.googlesource.com/c/chromium/src/+/5170669
(cherry picked from commit 5409118134)

* 5178824: [Fullscreen] Record UKM data

https://chromium-review.googlesource.com/c/chromium/src/+/5178824
(cherry picked from commit 3d53a6ec01)

* chore: update patches after rebase

(cherry picked from commit 3a6a335a05)

* chore: update patches after cherry picks

* chore: update patches after rebase

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2024-01-25 15:19:31 -05:00
Cheng Zhao
738e0b9664 chore: remove node patches by using the preload feature (#41113) 2024-01-25 11:39:04 -05:00
trop[bot]
370a2c702b fix: dangling raw_ptr in OSRWHV destructor (#41117)
`delegated_frame_host_` holds a pointer to `delegated_frame_host_client_`.
Since `delegated_frame_host_client_` was being destroyed first, that
pointer was dangling in the OSRWHV destructor.

Also, make these two unique_ptr fields `const` since they point to the
same objects for the lifespan of the OSRWHV.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-25 15:45:08 +09:00
trop[bot]
3f85bd57a2 docs: update Playwright automated-testing guide (#41098)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Max Schmitt <max@schmitt.mx>
2024-01-25 11:32:00 +09:00
trop[bot]
5c8b5ff811 fix: on error, reset spawnedProcess (#41110)
reset spawnedProcess instance in case of error

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Maikel Ortega Hernandez <maikeloh@gmail.com>
2024-01-25 11:30:47 +09:00
trop[bot]
7d7f390c93 fix: draggable regions not working (#41112)
* fix: draggable regions not working

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

* fix: only support app regions for main frame

Co-authored-by: deepak1556 <hop2deep@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2024-01-25 11:21:01 +09:00
trop[bot]
0fc5e42018 fix: only remove hijackable envs from foreign parent (#41102)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
2024-01-25 10:13:57 +09:00
trop[bot]
1ff780d3dd refactor: remove banned std::to_string() calls (#41109)
* refactor: do not use banned std::to_string() in ServiceWorkerContext::GetAllRunningWorkerInfo()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: do not use banned std::to_string() in REPORT_AND_RETURN_IF_FAILED()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: do not use banned std::to_string() in JSChunkedDataPipeGetter::OnWriteChunkComplete()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: do not use banned std::to_string() in SetCrashKey()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: remove unused #include

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! refactor: do not use banned std::to_string() in REPORT_AND_RETURN_IF_FAILED()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-25 09:45:14 +09:00
Shelley Vohr
dd142b0327 fix: undici incorrectly copies headers onto fetches (#41019) 2024-01-24 11:32:45 -05:00
Milan Burda
0df4312ded chore: replace absl::optional<T> with std::optional<T> (#41074)
chore: replace absl::optional<T> with std::optional<T> (#40928)
2024-01-23 20:43:22 -06:00
trop[bot]
95e3df589f fix: ElectronBrowserContext::PartitionKey comparisons (#41084)
* fix: ElectronBrowserContext::PartitionKey comparisons

Use c++20 default comparisons to simplify + fix PartitionKey sorting:

- The equality operator is broken. `PartitionKey{"foo", false}` is both
  equal, to and less than, `PartitionKey{"foo", true}`

- For some keys, the same session can be retrieved via both `fromPath()`
  and `fromPartition()`. This use case was discussed and removed from
  the original PR after code review said "always returning different
  sessions feels lower maintenance." The current behavior is a bug that
  comes from the comparison operators not checking the keys' types.

Xref: 3f1aea9af9 (r1099745359)

Xref: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-features.md#Default-comparisons-allowed

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! fix: ElectronBrowserContext::PartitionKey comparisons

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-23 17:39:57 -06:00
trop[bot]
7441b812e4 docs: fixed typos and grammatical errors (#41058)
* docs: fixed typos

Co-authored-by: Villy-P <valeriuspetrini@gmail.com>

* Update docs/tutorial/performance.md

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

Co-authored-by: Valerius Petrini <112593680+Villy-P@users.noreply.github.com>

* Update performance.md

Co-authored-by: Valerius Petrini <112593680+Villy-P@users.noreply.github.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Villy-P <valeriuspetrini@gmail.com>
Co-authored-by: Valerius Petrini <112593680+Villy-P@users.noreply.github.com>
2024-01-22 14:45:36 -06:00
Keeley Hammond
12f4204824 revert: replace BrowserView with WebContentsView (#41060)
Revert "feat: replace BrowserView with WebContentsView (#40759)"

This reverts commit bd304f7c9d.
2024-01-22 08:53:02 -08:00
trop[bot]
b84beed666 chore: cleanup tests creating crashpad handler in the test runner process (#41053)
* chore: cleanup tests creating crashpad handler in the test runner process

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* ci: logging

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* ci: enable logging

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* ci: more logging

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* ci: run all tests

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* ci: more logging

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* ci: increase timeout

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Revert "ci: increase timeout"

This reverts commit 870f74455d.

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Revert "ci: more logging"

This reverts commit 46837f8b3a.

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Revert "ci: run all tests"

This reverts commit 6a7889ce67.

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Revert "ci: more logging"

This reverts commit 351473ab43.

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Revert "ci: enable logging"

This reverts commit 194109ed5a.

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Revert "ci: logging"

This reverts commit 9a3396fc7a.

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* chore: disable flaky ia32 tests

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* chore: fixup .patches after trop

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2024-01-19 09:53:20 +01:00
trop[bot]
ebeb8adaf4 fix: crash when dialog.showMessageBoxSync with missing buttons (#41043)
* fix: crash when dialog.showMessageBoxSync missing buttons

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

* chore: feedback from review

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-18 20:35:53 -05:00
trop[bot]
d5433ec0cc test: fixup assertNotWindows (#41048)
* chore: fixup assertNotWindows

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

* remove logging

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2024-01-18 16:19:52 -05:00
trop[bot]
8d49957c93 refactor: remove deprecated ToInternalValue() (#41022)
* refactor: do not use deprecated ToInternalValue() in ElectronExtensionLoader::FinishExtensionLoad()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: do not use deprecated ToInternalValue() in NotificationPresenterWin::SaveIconToFilesystem()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: rename temp variable to now_usec for clarity

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-18 11:33:30 -06:00
trop[bot]
471c44c709 fix: use HasStyleMask(NSWindowStyleMaskResizable) instead of IsResizable() for enabling/disabling window maximize button (#41029)
* fix: use `HasStyleMask(NSWindowStyleMaskResizable)` instead of `IsResizable()` for enabling/disabling window maximize button

Co-authored-by: Tamás Zahola <tzahola@gmail.com>

* Format

Co-authored-by: Tamás Zahola <tzahola@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Tamás Zahola <tzahola@gmail.com>
2024-01-18 13:20:02 +01:00
trop[bot]
8f4e7bde5e fix: modal rounding on nonmodal windows (#41037)
* fix: modal rounding on nonmodal windows

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

* chore: feedback from review

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-18 13:19:11 +01:00
trop[bot]
94fdb02987 refactor: use base::NoDestructor instead of base::LazyInstance (#40979)
* refactor: use NoDestructor for g_io_thread_application_locale

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use NoDestructor for ExtensionActionAPI::GetFactoryInstance()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use NoDestructor for ElectronExtensionsClient::GetPermissionMessageProvider()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use NoDestructor for feat_add_support_for_overriding_the_base_spellchecker_download_url.patch

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: remove unused #include

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! refactor: use NoDestructor for ElectronExtensionsClient::GetPermissionMessageProvider()

make sure instance is static

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: remove unused #include "base/lazy_instance.h"

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-17 10:22:59 -05:00
trop[bot]
2377746413 refactor: fix deprecated base::Base64Encode() API calls (#40992)
* refactor: replace deprecated Base64Encode() usage in IWC::NetworkResourceLoader::OnDataReceived()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: replace deprecated Base64Encode() usage EncodeToken(const base::UnguessableToken& token)

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-16 15:18:22 -06:00
trop[bot]
2bb2ef92da ci: correctly export RBE_experimental_credentials_helper_args (#40998)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-15 13:22:53 -08:00
trop[bot]
c994eb8e13 build: log got error response bodies (#40977)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-15 11:32:45 +01:00
Charles Kerr
a9d358e730 chore: migrate base::StringPiece to std::string_view (#40915) (#40973)
* chore: migrate from base::StringPiece to std::string_view in keyboard_util.cc

* chore: migrate from base::StringPiece to std::string_view in error_thrower.cc

* chore: migrate from base::StringPiece to std::string_view in electron_api_web_contents.cc

* chore: migrate from base::StringPiece to std::string_view in gin_helper/dictionary.h

* chore: migrate from base::StringPiece to std::string_view in electron_api_url_loader.cc

* chore: phase out internal use of base:::StringPiece

`base::StringPiece` is being phased out upstream. Its code has been
removed upstream and it's just a typedef for `std::string_view`.

They haven't removed the typedef yet, so this PR tries to get ahead
of future breakage by migrating "internal" use (i.e. leaving alone the
places where the `base::StringPiece` name is coming from an upstream
method that we override).

Xref: https://bugs.chromium.org/p/chromium/issues/detail?id=691162

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

Xref: https://docs.google.com/document/d/1d4RnD1uAE2t4iANR0nXy82ASIPGsPuw2mpO6v6T7JKs
2024-01-12 10:50:55 +01:00
Samuel Attard
69e30e8d67 chore: cherry-pick 389ea9be7d68 from v8 (#40969)
* chore: cherry-pick 389ea9be7d68 from v8

* chore: update patches

---------

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2024-01-12 10:50:36 +01:00
trop[bot]
02dfdce54a fix: InAppPurchase pre-emptive deallocation (#40957)
* fix: InAppPurchase pre-emptive deallocation

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

* test: try re-enabling IAP tests

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-11 19:41:36 +01:00
trop[bot]
bd304f7c9d feat: replace BrowserView with WebContentsView (#40759)
* feat: replace BrowserView with WebContentsView

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

* Update appveyor.yml

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2024-01-11 13:10:11 -05:00
trop[bot]
c2524d762b build: fix windows remote exec of python actions (#40961)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
2024-01-11 18:47:11 +01:00
trop[bot]
0b1e1b1612 chore: bump chromium to 122.0.6236.2 (29-x-y) (#40950)
* chore: bump chromium in DEPS to 122.0.6223.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* 5129828: Removes special cases for selenium-atoms dependencies.

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

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

* chore: fixup patch indices

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

* 5139789: Deduplicate BrowserContext's ResourceContext

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

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

* 5148579: Simplify SelectFileDialog::Listener

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

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

* 5134038: Code Health: Use string_view in base::i18n::BreakIterator::SetText

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

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

* 5137427: Code Health: Use string_view in SpellCheck::SpellCheckWord

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

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

* adds ranges::fold_left_with_iter and ranges::fold_left

Notable things in this commit:

* refactors `__indirect_binary_left_foldable`, making it slightly
different (but equivalent) to _`indirect-binary-left-foldable`_, which
improves readability (a [patch to the Working Paper][patch] was made)
* omits `__cpo` namespace, since it is not required for implementing
niebloids (a cleanup should happen in 2024)
* puts tests ensuring invocable robustness and dangling correctness
inside the correctness testing to ensure that the algorithms' results
are still correct

[patch]: https://github.com/cplusplus/draft/pull/6734

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

* chore: bump chromium in DEPS to 122.0.6224.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* 5154766: [Refresh 2023] [GTK] Fix gap above toolbar with fractional scaling

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

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

* chore: fixup patch indices

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

* 5094458: Remove extra CGColorSpace parameters from skia and ui helpers

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

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

* chore: bump chromium in DEPS to 122.0.6226.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6227.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6228.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6230.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6232.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6234.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6236.2

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* fix: remove --disable-color-correct-renderering

Per https://electronhq.slack.com/archives/CB6CG54DB/p1698444047862459 it is not used any more and was never documented.

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* chore: add WEB_PRINTING to content permission converter

Unused in non-cros so no need to document

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

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* chore: Views is now vec<raw_ptr> instead of raw<T*>

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

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* spec: add Iterator to global intrinsics

Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>

* chore: update patches

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
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: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2024-01-11 23:19:31 +13:00
trop[bot]
0d0340ec69 build: add infra for reclient support (#40952)
* chore: add patch to always set macos platform for x-build

* build: add infra for reclient support

* build: override reclient version

* build: use RBE in CI

* chore: hardcode reclient fix version

* build: lower process count on macOS

* build: use large macOS instance for testing-arm64

* Revert "build: use large macOS instance for testing-arm64"

This reverts commit 6844adfd00a5230e68234112dfd84caa50d3f621.

* build: login in via helper not writing file

* chore: update patches

* build: use recelint from DEPS

* build: fix windows reproxy cfg

* build: use reclient in appveyor

* build: update WOA job too

* build: force another build

* build: do not checkout reclient

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <sam@electronjs.org>
2024-01-11 23:19:10 +13:00
trop[bot]
f0d42aed88 refactor: migrate deprecated LazyInstance code to NoDestructor (#40945)
* refactor: do not use deprecated NoDestructor in javascript_environment.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: do not use deprecated NoDestructor in window_list.cc

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-10 17:34:27 -06:00
trop[bot]
ddb1c784d0 build: use container runner for arm tests (#40934)
* build: use aks arm64 test runners

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* build: better image

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* build: even more stuff

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* build: arm par

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* build: use aks arm32

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* build: arm32 par

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* build: get test timings from abs paths

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* build: avoid realpath, use echo

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* chore: fix contentTracing test

* cry

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
2024-01-11 00:27:47 +13:00
trop[bot]
33ae7cc786 fix: crash using powerMonitor before ready event (#40925)
* fix: crash using powerMonitor before ready event

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

* refactor: continue using DBusBluezManagerWrapperLinux

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-09 17:16:52 -06:00
trop[bot]
cbd1b4486c chore: do not inject DXVA_Decoding trace category (#40899)
This doesn't need to be injected. Looks like it was an accident in
60ca38fb for https://github.com/electron/electron/pull/38465 .

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-09 09:41:06 +01:00
trop[bot]
40a13b649f fix: wide string concatenation (#40908)
* fix: wide string concatenation

Co-authored-by: clavin <clavin@electronjs.org>

* Use wstring_views to keep length in context

Co-authored-by: clavin <clavin@electronjs.org>

* forgot a space, oopsies

Co-authored-by: clavin <clavin@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
2024-01-09 09:40:53 +01:00
trop[bot]
5728d3b709 feat: add net module to utility process (#40890)
* chore: initial prototype of net api from utility process

* chore: update url loader to work on both browser and utility processes

* chore: add net files to utility process bundle

* chore: re-add app ready check but only on main process

* chore: replace browser thread dcheck's with sequence checker

* refactor: move url loader from browser to common

* refactor: move net-client-request.ts from browser to common

* docs: add utility process to net api docs

* refactor: move net module app ready check to browser only

* refactor: switch import from main to common after moving to common

* test: add basic net module test for utility process

* refactor: switch browser pid with utility pid

* refactor: move electron_api_net from browser to common

* chore: add fetch to utility net module

* chore: add isOnline and online to utility net module

* refactor: move net spec helpers into helper file

* refactor: break apart net module tests

Adds two additional net module test files: `api-net-session-spec.ts` for
tests that depend on a session being available (aka depend on running on
the main process) and `api-net-custom-protocols-spec.ts` for custom
protocol tests. This enables running `api-net-spec.ts` in the utility
process.

* test: add utility process mocha runner to run net module tests

* docs: add utility process to net module classes

* refactor: update imports in lib/utility to use electron/utility

* chore: check browser context before using in main process

Since the browser context supplied to the SimpleURLLoaderWrapper can now
be null for use in the UtilityProcess, adding a null check for the main
process before use to get a more sensible error if something goes wrong.



* chore: remove test debugging

* chore: remove unnecessary header include

* docs: add utility process net module limitations

* test: run net module tests in utility process individually

* refactor: clean up prior utility process net tests

* chore: add resolveHost to utility process net module

* chore: replace resolve host dcheck with sequence checker

* test: add net module tests for net.resolveHost

* docs: remove utility process limitation for resolveHost

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Devraj Mehta <devm33@github.com>
2024-01-08 15:39:56 -06:00
trop[bot]
0778cc70bb fix: macOS maximize button shouldn't be disabled just because the window is non-fullscreenable (#40897)
* fix: macOS maximize button shouldn't be disabled just because the window is non-fullscreenable

Co-authored-by: Tamás Zahola <tzahola@gmail.com>

* add test

Co-authored-by: Tamás Zahola <tzahola@gmail.com>

* fix test by enabling maximize button if `resizable && (maximizable || fullscreenable)` instead of `(resizable && maximizable) && fullscreenable`

Co-authored-by: Tamás Zahola <tzahola@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Tamás Zahola <tzahola@gmail.com>
2024-01-08 21:24:57 +01:00
trop[bot]
f0c02568da perf: use fixed-size arrays for the font cache (#40912)
refactor: use fixed-size arrays for the font cache

Since we know at compile time which [family x script] combos we want to
cache, we can hold the cache in fixed std::arrays instead of in nested
std::unordered_maps.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-01-08 12:55:29 -06:00
trop[bot]
3c01b58114 docs: add missing vibrancy breaking change (#40907)
docs: add missing vibranch change

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-08 15:20:40 +01:00
Charles Kerr
c257cc25a2 refactor: make NativeWindow getter methods const (#40887)
refactor: make NativeWindow getter methods const (#40804)

* refactor: make NativeWindow getter methods const

* fixup! refactor: make NativeWindow getter methods const

make GetZOrderLevel() const

* fixup! refactor: make NativeWindow getter methods const

fix oops
2024-01-05 15:08:58 +01:00
trop[bot]
e1ec17d641 chore: bump chromium to 122.0.6194.0 (29-x-y) (#40872)
* chore: bump chromium in DEPS to 122.0.6180.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update render_widget_host_view_base.patch

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

minor manual changes to match upstream changes

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update printing.patch

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

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

Update patch to upstream changes in print_view_manager_base.cc.
CC @codebytere for 👀

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update feat_add_onclose_to_messageport.patch

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

no manual changes; patch applied with fuzz 1

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update build_do_not_depend_on_packed_resource_integrity.patch

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

minor manual changes to match upstream changes

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update port_autofill_colors_to_the_color_pipeline.patch

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

no manual changes; patch applied with fuzz 2

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update revert_api_dcheck-fail_when_we_reenter_v8_while_terminating.patch

Xref: https://chromium-review.googlesource.com/c/v8/v8/+/5076902
Xref: https://chromium-review.googlesource.com/c/v8/v8/+/5096253

The `bailout_value` variable, which allowed us to fail gracefully in
these macros, has been removed upstream. This raises the temperature
on https://github.com/electron/electron/issues/40741 ...

Since we don't have a bailout value, return a default-constructed
instance of whatever the return type is of the function that invokes
the macro.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* Remove performActionOnRemotePage

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

It appears it is not used by anything within Chromium or outside.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* perf: in SubmenuButton ctor, move() the PressedCallback

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

The copy construtor is more expensive and has been removed upstream

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update constructor call for ElectronExtensionsRendererClient::dispatcher_

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: handle CAPTURED_SURFACE_CONTROL in Converter<blink::PermissionType>::ToV8()

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: e patches all

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: bump chromium to 122.0.6181.0

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: e patches all

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: Add lookup for per-RenderFrame SpellCheckProvider

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

Previously we could pass a routing ID into the spellcheck methods.
This ID arg has been replaced with a SpellCheckHost& arg.

We can get the SpellCheckHost from an accessor in SpellCheckProvider,
which was already being created on a per-render-frame basis in
RenderClientBase.

This commit adds a RenderFrame-to-SpellCheckProvider accessor
in RenderClientBase so that it can be used to get that needed
SpellCheckHost.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: make lint happy

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: restore the will_cause_resize arg to WebContents::ExitFullscreen

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

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

upstream reverted this change

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: bump chromium in DEPS to 122.0.6182.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>

* chore: fix virtual function names that were renamed upstream

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: handle new blink::PermissionType::SMART_CARD in PermissionType converter

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: node script/gen-libc++-filenames.js

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* fixup! chore: update build_do_not_depend_on_packed_resource_integrity.patch

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: remove revert_api_dcheck-fail_when_we_reenter_v8_while_terminating.patch

The previous experiment of removing the DCHECK in 35093783 was a huge
failure. We either need to either:

A) use upstream as-is and fix the DCHECK failure, or
B) revert https://chromium-review.googlesource.com/c/v8/v8/+/5076902 too
C) find some other workaround

This commit is the first half of option A, removing the patch to use
upstream as-is.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: bump chromium in DEPS to 122.0.6184.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6186.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore; update mas_avoid_private_macos_api_usage.patch.patch

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

minor manual changes to match upstream changes

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update build_do_not_depend_on_packed_resource_integrity.patch

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

minor manual changes to match upstream changes

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: update fix_move_autopipsettingshelper_behind_branding_buildflag.patch

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

no manual changes; patch applied with fuzz 1

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: e patches all

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: add refactor_update_node-platform_to_match_v8-platform_api_changes.patch

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* chore: bump chromium in DEPS to 122.0.6188.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6190.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6192.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: bump chromium in DEPS to 122.0.6194.0

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* Remove an unnecessary DCHECK which causes Lacros to crash.

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Add shared regular profile function that includes ash

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Simplify the PrintManagerHost::ScriptedPrint() call

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Add tests

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fixup! chore: add refactor_update_node-platform_to_match_v8-platform_api_changes.patch

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* chore: node script/gen-libc++-filenames.js

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Remove //ui/ozone/buildflags.h

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fixup! Remove //ui/ozone/buildflags.h

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fixup! Remove //ui/ozone/buildflags.h

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* chore: update patches

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fixup! refactor: Add lookup for per-RenderFrame SpellCheckProvider

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fixup! Remove //ui/ozone/buildflags.h

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Add permission policy verification in PermissionControllerImpl

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fix: ensure spellcheck interface is registered for frame

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* Unify pending and scheduled exceptions

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

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fix: dchecks in node.js tests

Co-authored-by: deepak1556 <hop2deep@gmail.com>

* fix: try adding termination check

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

* chore: document breaking iframe change

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

* chore: update patches after trop

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
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>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2024-01-04 16:17:50 -05:00
trop[bot]
ce7e0afd0a chore: add disclaimer to release timeline (#40885)
* chore: add disclaimer to release timeline

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

* Update docs/tutorial/electron-timelines.md

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

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

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <vertedinde@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-01-04 12:44:59 -08:00
trop[bot]
f589b73dee fix: ignore all NODE_ envs from foreign parent in node process (#40881) 2024-01-04 11:52:03 +01:00
trop[bot]
44f29fc675 fix: make grant_file_protocol_extra_privileges fuse also block CORS fetches (#40864)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
2024-01-03 13:30:26 +01:00
trop[bot]
daf00de2ed fix: titlebar incorrectly displayed on frameless windows (#40862)
* fix: titlebar incorrectly displayed on frameless windows

Co-authored-by: brhenrique <bruno.d@miro.com>

* fix: enable transparency for Mica windows

Co-authored-by: brhenrique <bruno.d@miro.com>

* Refactor ShouldWindowContentsBeTransparent

Co-authored-by: clavin <clavin@electronjs.org>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: brhenrique <bruno.d@miro.com>
Co-authored-by: clavin <clavin@electronjs.org>
2024-01-02 16:39:57 -05:00
trop[bot]
877a3b9fe2 docs: corrected the ipcMain import path (#40794)
Update tutorial-3-preload.md

corrected the import path for ipcMain

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Nikhil Simon Toppo <nikhilsimontoppo@gmail.com>
2023-12-21 09:19:12 -06:00
trop[bot]
0bcaaca6bd refactor: use a FixedFlatMap for v8 converting ui::MenuSourceType (#40805)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-12-20 22:24:39 -06:00
trop[bot]
8619bd5027 fix: add partition alloc check for MacOS 13/14+ (#40766)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
2023-12-15 12:00:58 -08:00
trop[bot]
4875c9b645 chore: bump chromium to 121.0.6159.0 (29-x-y) (#40751)
* chore: bump chromium to 121.0.6159.0 29-x-y

* chore: bump chromium in DEPS to 121.0.6154.0

* chore: bump chromium in DEPS to 121.0.6155.0

* fix patches

* chore: update patches

* patch out reference to GetOcclusionTracker

* un-flag PIPOcclusionTracker

* chore: bump chromium in DEPS to 121.0.6157.0

* fix conflicts

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

* add PIP occlusion tracker sources to chromium_src

* 5037591: Replace feature_list's Initialize* methods with Init*.

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

* 4811903: Move //content/browser/renderer_host/input/synthetic_gesture_controller to //content/common/input

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

* 4917953: usb: Add usb-unrestricted to permission policy

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

* 5072395: Remove unused `creation_context` parameter from blink/public APIs

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

* 5052035: [X11] Change AtomCache from a singleton to owned by Connection

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

* fix v8/.patches

* node script/gen-libc++-filenames.js

* 5035771: Remove the SetImage method of ImageButton

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

* fixup! 5052035: [X11] Change AtomCache from a singleton to owned by Connection

* fixup! 5035771: Remove the SetImage method of ImageButton

* chore: bump chromium in DEPS to 121.0.6159.0

* 4505903: [Extensions] Add lastAccessed property to chrome.tabs.Tab

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

* update patches

* don't duplicate tabs API types

this causes weird memory bugs if the two get out of sync

* fix UAF in TrayIconCocoa

not sure why this is popping up just now ... this has been broken for ages afaict

* Revert "don't duplicate tabs API types"

This reverts commit 80dff2efaa.

This is failing tests with extensions API schema check failures, so
revert for now. we'll fix it later.

* revert v8 change causing node crashes

* chore: reduce diffs in revert_api_dcheck-fail_when_we_reenter_v8_while_terminating.patch

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: clavin <clavin@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>

* chore: update patches

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
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>
2023-12-12 13:59:27 -06:00
trop[bot]
f4979e3cd2 docs: fix year typos in electron-timelines.md (#40730)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Yureka <yuka@yuka.dev>
2023-12-08 13:26:25 +01:00
443 changed files with 10977 additions and 6613 deletions

View File

@@ -80,12 +80,14 @@ executors:
machine: true
linux-arm:
resource_class: electronjs/linux-arm
machine: true
resource_class: electronjs/aks-linux-arm-test
docker:
- image: ghcr.io/electron/test:arm32v7-8e0f85b708fa58e28e4824954d6fd55adfda5e9e
linux-arm64:
resource_class: electronjs/linux-arm64
machine: true
resource_class: electronjs/aks-linux-arm-test
docker:
- image: ghcr.io/electron/test:arm64v8-76d5d29e247972da3855a01c2d8cf72c5998233a
# The config expects the following environment variables to be set:
# - "SLACK_WEBHOOK" Slack hook URL to send notifications.
@@ -335,46 +337,27 @@ step-setup-env-for-build: &step-setup-env-for-build
# To find `gn` executable.
echo 'export CHROMIUM_BUILDTOOLS_PATH="'"$PWD"'/src/buildtools"' >> $BASH_ENV
step-setup-goma-for-build: &step-setup-goma-for-build
step-setup-rbe-for-build: &step-setup-rbe-for-build
run:
name: Setup Goma
name: Setup RBE
command: |
echo 'export NUMBER_OF_NINJA_PROCESSES=300' >> $BASH_ENV
if [ "`uname`" == "Darwin" ]; then
echo 'export NUMBER_OF_NINJA_PROCESSES=200' >> $BASH_ENV
echo 'ulimit -n 10000' >> $BASH_ENV
echo 'sudo launchctl limit maxfiles 65536 200000' >> $BASH_ENV
fi
if [ ! -z "$RAW_GOMA_AUTH" ]; then
echo $RAW_GOMA_AUTH > ~/.goma_oauth2_config
fi
git clone https://github.com/electron/build-tools.git
cd build-tools
npm install
npx yarn --ignore-engines
mkdir third_party
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
export GOMA_FALLBACK_ON_AUTH_FAILURE=true
third_party/goma/goma_ctl.py ensure_start
if [ ! -z "$RAW_GOMA_AUTH" ] && [ "`third_party/goma/goma_auth.py info`" != "Login as Fermi Planck" ]; then
echo "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token."
exit 1
fi
echo 'export GN_GOMA_FILE='`node -e "console.log(require('./src/utils/goma.js').gnFilePath)"` >> $BASH_ENV
echo 'export GOMA_DIR='`node -e "console.log(require('./src/utils/goma.js').dir)"` >> $BASH_ENV
echo 'export GOMA_FALLBACK_ON_AUTH_FAILURE=true' >> $BASH_ENV
cd ..
touch "${TMPDIR:=/tmp}"/.goma-ready
background: true
step-wait-for-goma: &step-wait-for-goma
run:
name: Wait for Goma
command: |
until [ -f "${TMPDIR:=/tmp}"/.goma-ready ]
do
sleep 5
done
echo "Goma ready"
no_output_timeout: 5m
# Pull down credential helper and print status
node -e "require('./src/utils/reclient.js').downloadAndPrepare({})"
HELPER=$(node -p "require('./src/utils/reclient.js').helperPath")
$HELPER login
echo 'export RBE_service='`node -e "console.log(require('./src/utils/reclient.js').serviceAddress)"` >> $BASH_ENV
echo 'export RBE_experimental_credentials_helper='`node -e "console.log(require('./src/utils/reclient.js').helperPath)"` >> $BASH_ENV
echo 'export RBE_experimental_credentials_helper_args="print"' >> $BASH_ENV
step-restore-brew-cache: &step-restore-brew-cache
restore_cache:
@@ -548,6 +531,13 @@ step-fix-sync: &step-fix-sync
sed -i '' "s/Updating depot_tools... //g" gn_ensure_file
cipd ensure --root src/buildtools/mac -ensure-file gn_ensure_file
# Fix reclient (wrong binary)
echo 'infra/rbe/client/${platform}' `gclient getdep --deps-file=src/DEPS -r 'src/buildtools/reclient:infra/rbe/client/${platform}'` > gn_ensure_file
# Remove extra output from calling gclient getdep which always calls update_depot_tools
sed -i '' "s/Updating depot_tools... //g" gn_ensure_file
cipd ensure --root src/buildtools/reclient -ensure-file gn_ensure_file
python3 src/buildtools/reclient_cfgs/configure_reclient_cfgs.py --rbe_instance "projects/rbe-chrome-untrusted/instances/default_instance" --reproxy_cfg_template reproxy.cfg.template --rewrapper_cfg_project "" --skip_remoteexec_cfg_fetch
# Fix dsymutil (wrong binary)
if [ "$TARGET_ARCH" == "arm64" ]; then
export DSYM_SHA_FILE=src/tools/clang/dsymutil/bin/dsymutil.arm64.sha1
@@ -600,7 +590,7 @@ step-gn-gen-default: &step-gn-gen-default
name: Default GN gen
command: |
cd src
gn gen out/Default --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
gn gen out/Default --args="import(\"$GN_CONFIG\") use_remoteexec=true $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
step-gn-check: &step-gn-check
run:
@@ -636,16 +626,16 @@ step-electron-chromedriver-build: &step-electron-chromedriver-build
command: |
cd src
if [ "`uname`" != "Darwin" ] && ([ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]); then
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") import(\"$GN_GOMA_FILE\") is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
gn gen out/chromedriver --args="import(\"$GN_CONFIG\") use_remoteexec=true is_component_ffmpeg=false proprietary_codecs=false $GN_EXTRA_ARGS $GN_BUILDFLAG_ARGS"
export CHROMEDRIVER_DIR="out/chromedriver"
else
export CHROMEDRIVER_DIR="out/Default"
fi
ninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
autoninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver -j $NUMBER_OF_NINJA_PROCESSES
if [ "`uname`" == "Linux" ]; then
electron/script/strip-binaries.py --target-cpu="$TARGET_ARCH" --file $PWD/$CHROMEDRIVER_DIR/chromedriver
fi
ninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver_zip
autoninja -C $CHROMEDRIVER_DIR electron:electron_chromedriver_zip
if [ "`uname`" != "Darwin" ] && ([ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]); then
cp out/chromedriver/chromedriver.zip out/Default
fi
@@ -655,7 +645,7 @@ step-nodejs-headers-build: &step-nodejs-headers-build
name: Build Node.js headers
command: |
cd src
ninja -C out/Default electron:node_headers
autoninja -C out/Default electron:node_headers
step-electron-publish: &step-electron-publish
run:
@@ -709,14 +699,14 @@ step-ffmpeg-gn-gen: &step-ffmpeg-gn-gen
name: ffmpeg GN gen
command: |
cd src
gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") import(\"$GN_GOMA_FILE\") $GN_EXTRA_ARGS"
gn gen out/ffmpeg --args="import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true $GN_EXTRA_ARGS"
step-ffmpeg-build: &step-ffmpeg-build
run:
name: Non proprietary ffmpeg build
command: |
cd src
ninja -C out/ffmpeg electron:electron_ffmpeg_zip -j $NUMBER_OF_NINJA_PROCESSES
autoninja -C out/ffmpeg electron:electron_ffmpeg_zip -j $NUMBER_OF_NINJA_PROCESSES
step-verify-mksnapshot: &step-verify-mksnapshot
run:
@@ -748,26 +738,13 @@ step-setup-linux-for-headless-testing: &step-setup-linux-for-headless-testing
sh -e /etc/init.d/xvfb start
fi
step-show-goma-stats: &step-show-goma-stats
run:
shell: /bin/bash
name: Check goma stats after build
command: |
set +e
set +o pipefail
python3 $GOMA_DIR/goma_ctl.py stat
python3 $GOMA_DIR/diagnose_goma_log.py
true
when: always
background: true
step-mksnapshot-build: &step-mksnapshot-build
run:
name: mksnapshot build
no_output_timeout: 30m
command: |
cd src
ninja -C out/Default electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
autoninja -C out/Default electron:electron_mksnapshot -j $NUMBER_OF_NINJA_PROCESSES
gn desc out/Default v8:run_mksnapshot_default args > out/Default/mksnapshot_args
# Remove unused args from mksnapshot_args
SEDOPTION="-i"
@@ -790,7 +767,7 @@ step-mksnapshot-build: &step-mksnapshot-build
fi
fi
if [ "$SKIP_DIST_ZIP" != "1" ]; then
ninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
autoninja -C out/Default electron:electron_mksnapshot_zip -j $NUMBER_OF_NINJA_PROCESSES
(cd out/Default; zip mksnapshot.zip mksnapshot_args gen/v8/embedded.S)
fi
@@ -800,7 +777,7 @@ step-hunspell-build: &step-hunspell-build
command: |
cd src
if [ "$SKIP_DIST_ZIP" != "1" ]; then
ninja -C out/Default electron:hunspell_dictionaries_zip -j $NUMBER_OF_NINJA_PROCESSES
autoninja -C out/Default electron:hunspell_dictionaries_zip -j $NUMBER_OF_NINJA_PROCESSES
fi
step-maybe-generate-libcxx: &step-maybe-generate-libcxx
@@ -809,9 +786,9 @@ step-maybe-generate-libcxx: &step-maybe-generate-libcxx
command: |
cd src
if [ "`uname`" == "Linux" ]; then
ninja -C out/Default electron:libcxx_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:libcxxabi_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
ninja -C out/Default electron:libcxx_objects_zip -j $NUMBER_OF_NINJA_PROCESSES
autoninja -C out/Default electron:libcxx_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
autoninja -C out/Default electron:libcxxabi_headers_zip -j $NUMBER_OF_NINJA_PROCESSES
autoninja -C out/Default electron:libcxx_objects_zip -j $NUMBER_OF_NINJA_PROCESSES
fi
step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
@@ -821,7 +798,7 @@ step-maybe-generate-breakpad-symbols: &step-maybe-generate-breakpad-symbols
command: |
if [ "$GENERATE_SYMBOLS" == "true" ]; then
cd src
ninja -C out/Default electron:electron_symbols
autoninja -C out/Default electron:electron_symbols
fi
step-maybe-zip-symbols: &step-maybe-zip-symbols
@@ -830,8 +807,8 @@ step-maybe-zip-symbols: &step-maybe-zip-symbols
command: |
cd src
export BUILD_PATH="$PWD/out/Default"
ninja -C out/Default electron:licenses
ninja -C out/Default electron:electron_version_file
autoninja -C out/Default electron:licenses
autoninja -C out/Default electron:electron_version_file
electron/script/zip-symbols.py -b $BUILD_PATH
step-maybe-zip-symbols-and-clean: &step-maybe-zip-symbols-and-clean
@@ -840,8 +817,8 @@ step-maybe-zip-symbols-and-clean: &step-maybe-zip-symbols-and-clean
command: |
cd src
export BUILD_PATH="$PWD/out/Default"
ninja -C out/Default electron:licenses
ninja -C out/Default electron:electron_version_file
autoninja -C out/Default electron:licenses
autoninja -C out/Default electron:electron_version_file
DELETE_DSYMS_AFTER_ZIP=1 electron/script/zip-symbols.py -b $BUILD_PATH
step-maybe-cross-arch-snapshot: &step-maybe-cross-arch-snapshot
@@ -1188,11 +1165,10 @@ commands:
could-be-aks:
type: boolean
steps:
- *step-setup-goma-for-build
- *step-setup-rbe-for-build
- checkout-from-cache:
could-be-aks: << parameters.could-be-aks >>
- *step-setup-env-for-build
- *step-wait-for-goma
- *step-gn-gen-default
- *step-gn-check
build_and_save_artifacts:
@@ -1213,8 +1189,6 @@ commands:
- step-electron-dist-build:
additional-targets: electron:node_headers third_party/electron_node:overlapped-checker electron:hunspell_dictionaries_zip
- *step-show-goma-stats
# mksnapshot
- *step-mksnapshot-build
- *step-maybe-cross-arch-snapshot
@@ -1343,7 +1317,7 @@ commands:
command: |
cd src
if [ "$SKIP_DIST_ZIP" != "1" ]; then
ninja -C out/Default electron:electron_dist_zip << parameters.additional-targets >> -j $NUMBER_OF_NINJA_PROCESSES
autoninja -C out/Default electron:electron_dist_zip << parameters.additional-targets >> -j $NUMBER_OF_NINJA_PROCESSES
if [ "$CHECK_DIST_MANIFEST" == "1" ]; then
if [ "`uname`" == "Darwin" ]; then
target_os=mac
@@ -1444,7 +1418,7 @@ commands:
- when:
condition: << parameters.build >>
steps:
- *step-setup-goma-for-build
- *step-setup-rbe-for-build
- when:
condition: << parameters.checkout-and-assume-cache >>
steps:
@@ -1563,7 +1537,6 @@ commands:
steps:
- *step-depot-tools-add-to-path
- *step-setup-env-for-build
- *step-wait-for-goma
- *step-get-more-space-on-mac
- *step-fix-sync
- *step-delete-git-directories
@@ -1657,17 +1630,15 @@ commands:
export LLVM_SYMBOLIZER_PATH=$PWD/third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer
export MOCHA_TIMEOUT=180000
echo "Piping output to ASAN_SYMBOLIZE ($ASAN_SYMBOLIZE)"
(cd electron && (circleci tests glob "spec/*-spec.ts" | circleci tests run --command="xargs node script/yarn test --runners=main --trace-uncaught --enable-logging --files" --split-by=timings 2>&1)) | $ASAN_SYMBOLIZE
(cd electron && (circleci tests glob "spec/*-spec.ts" | xargs -I@ -P4 bash -c "echo $(pwd)/@" | circleci tests run --command="xargs node script/yarn test --runners=main --trace-uncaught --enable-logging --files" --split-by=timings 2>&1)) | $ASAN_SYMBOLIZE
else
if [ "$TARGET_ARCH" == "arm" ] || [ "$TARGET_ARCH" == "arm64" ]; then
export ELECTRON_SKIP_NATIVE_MODULE_TESTS=true
(cd electron && node script/yarn test --runners=main --trace-uncaught --enable-logging)
else
if [ "$TARGET_ARCH" == "ia32" ]; then
npm_config_arch=x64 node electron/node_modules/dugite/script/download-git.js
fi
(cd electron && (circleci tests glob "spec/*-spec.ts" | circleci tests run --command="xargs node script/yarn test --runners=main --trace-uncaught --enable-logging --files" --split-by=timings))
fi
if [ "$TARGET_ARCH" == "ia32" ]; then
npm_config_arch=x64 node electron/node_modules/dugite/script/download-git.js
fi
(cd electron && (circleci tests glob "spec/*-spec.ts" | xargs -I@ -P4 bash -c "echo $(pwd)/@" | circleci tests run --command="xargs node script/yarn test --runners=main --trace-uncaught --enable-logging --files" --split-by=timings))
fi
- store_test_results:
path: src/junit
@@ -1751,14 +1722,12 @@ commands:
- *step-fix-sync
- *step-setup-env-for-build
- *step-fix-known-hosts-linux
- *step-setup-goma-for-build
- *step-wait-for-goma
- *step-setup-rbe-for-build
- *step-gn-gen-default
# Electron app
- ninja_build_electron:
build-type: << parameters.build-type >>
- *step-show-goma-stats
- *step-maybe-generate-breakpad-symbols
- *step-maybe-electron-dist-strip
- step-electron-dist-build
@@ -2297,6 +2266,7 @@ jobs:
<<: *env-global
<<: *env-headless-testing
<<: *env-stack-dumping
parallelism: 3
steps:
- electron-tests:
artifact-key: linux-arm
@@ -2308,6 +2278,7 @@ jobs:
<<: *env-global
<<: *env-headless-testing
<<: *env-stack-dumping
parallelism: 3
steps:
- electron-tests:
artifact-key: linux-arm64

View File

@@ -166,15 +166,6 @@ npm_action("build_electron_definitions") {
outputs = [ "$target_gen_dir/tsc/typings/electron.d.ts" ]
}
webpack_build("electron_asar_bundle") {
deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.asar_bundle_deps
config_file = "//electron/build/webpack/webpack.config.asar.js"
out_file = "$target_gen_dir/js2c/asar_bundle.js"
}
webpack_build("electron_browser_bundle") {
deps = [ ":build_electron_definitions" ]
@@ -220,6 +211,15 @@ webpack_build("electron_isolated_renderer_bundle") {
out_file = "$target_gen_dir/js2c/isolated_bundle.js"
}
webpack_build("electron_node_bundle") {
deps = [ ":build_electron_definitions" ]
inputs = auto_filenames.node_bundle_deps
config_file = "//electron/build/webpack/webpack.config.node.js"
out_file = "$target_gen_dir/js2c/node_init.js"
}
webpack_build("electron_utility_bundle") {
deps = [ ":build_electron_definitions" ]
@@ -231,9 +231,9 @@ webpack_build("electron_utility_bundle") {
action("electron_js2c") {
deps = [
":electron_asar_bundle",
":electron_browser_bundle",
":electron_isolated_renderer_bundle",
":electron_node_bundle",
":electron_renderer_bundle",
":electron_sandboxed_renderer_bundle",
":electron_utility_bundle",
@@ -242,9 +242,9 @@ action("electron_js2c") {
]
sources = [
"$target_gen_dir/js2c/asar_bundle.js",
"$target_gen_dir/js2c/browser_init.js",
"$target_gen_dir/js2c/isolated_bundle.js",
"$target_gen_dir/js2c/node_init.js",
"$target_gen_dir/js2c/renderer_init.js",
"$target_gen_dir/js2c/sandbox_bundle.js",
"$target_gen_dir/js2c/utility_init.js",
@@ -492,6 +492,7 @@ source_set("electron_lib") {
"//third_party/webrtc_overrides:webrtc_component",
"//third_party/widevine/cdm:headers",
"//third_party/zlib/google:zip",
"//ui/base:ozone_buildflags",
"//ui/base/idle",
"//ui/compositor",
"//ui/events:dom_keycode_converter",

9
DEPS
View File

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
vars = {
'chromium_version':
'121.0.6147.0',
'122.0.6261.18',
'node_version':
'v20.9.0',
'nan_version':
@@ -13,6 +13,8 @@ vars = {
'74ab5baccc6f7202c8ac69a8d1e152c29dc1ea76',
'mantle_version':
'78d3966b3c331292ea29ec38661b25df0a245948',
'engflow_reclient_configs_version':
'955335c30a752e9ef7bff375baab5e0819b6c00d',
'pyyaml_version': '3.12',
@@ -23,6 +25,7 @@ vars = {
'squirrel_git': 'https://github.com/Squirrel',
'reactiveobjc_git': 'https://github.com/ReactiveCocoa',
'mantle_git': 'https://github.com/Mantle',
'engflow_git': 'https://github.com/EngFlow',
# The path of the sysroots.json file.
'sysroots_json_path': 'electron/script/sysroots.json',
@@ -102,6 +105,10 @@ deps = {
'src/third_party/squirrel.mac/vendor/Mantle': {
'url': Var("mantle_git") + '/Mantle.git@' + Var("mantle_version"),
'condition': 'process_deps',
},
'src/third_party/engflow-reclient-configs': {
'url': Var("engflow_git") + '/reclient-configs.git@' + Var("engflow_reclient_configs_version"),
'condition': 'process_deps'
}
}

View File

@@ -13,7 +13,6 @@ environment:
ELECTRON_ENABLE_STACK_DUMPING: 1
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
GOMA_FALLBACK_ON_AUTH_FAILURE: true
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
PYTHONIOENCODING: UTF-8

View File

@@ -37,7 +37,6 @@ environment:
ELECTRON_ALSO_LOG_TO_STDERR: 1
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, tap"
GOMA_FALLBACK_ON_AUTH_FAILURE: true
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
GYP_MSVS_HASH_27370823e7: 28622d16b1
@@ -101,31 +100,22 @@ for:
if (Test-Path -Path "$pwd\src\electron") {
Remove-Item -Recurse -Force $pwd\src\electron
}
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
}
- git clone https://github.com/electron/build-tools.git
- cd build-tools
- npm install
- npx yarn --ignore-engines
- mkdir third_party
- ps: >-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
- cd ..\..
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
node -e "require('./src/utils/reclient.js').downloadAndPrepare({})"
- ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath"
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$goma_login = python3 $env:LOCAL_GOMA_DIR\goma_auth.py info
if ($goma_login -eq 'Login as Fermi Planck') {
Write-warning "Goma authentication is correct";
} else {
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
$host.SetShouldExit(1)
}
}
& $env:RECLIENT_HELPER login
- ps: >-
$env:RBE_service = node -e "console.log(require('./src/utils/reclient.js').serviceAddress)"
- ps: >-
$env:RBE_experimental_credentials_helper = $env:RECLIENT_HELPER
- ps: >-
$env:RBE_experimental_credentials_helper_args = "print"
- cd ..\..
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: >-
if ($env:GN_CONFIG -ne 'release') {
@@ -147,27 +137,26 @@ for:
- cd src
- ps: $env:PATH="$pwd\third_party\ninja;$env:PATH"
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") use_remoteexec=true %GN_EXTRA_ARGS% "
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron/shell/common/api:mojo
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- if DEFINED ELECTRON_RBE_JWT (autoninja -j 300 -C out/Default electron:electron_app) else (autoninja -C out/Default electron:electron_app)
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- ninja -C out/Default electron:electron_dist_zip
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true %GN_EXTRA_ARGS%"
- autoninja -C out/ffmpeg electron:electron_ffmpeg_zip
- autoninja -C out/Default electron:electron_dist_zip
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args
# Remove unused args from mksnapshot_args
- ps: >-
Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') -And -not $_.Contains('The gn arg use_goma=true') } | Set-Content out/Default/mksnapshot_args
- ninja -C out/Default electron:electron_mksnapshot_zip
- autoninja -C out/Default electron:electron_mksnapshot_zip
- cd out\Default
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
- cd ..\..
- ninja -C out/Default electron:hunspell_dictionaries_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default electron:node_headers
- python3 %LOCAL_GOMA_DIR%\goma_ctl.py stat
- autoninja -C out/Default electron:hunspell_dictionaries_zip
- autoninja -C out/Default electron:electron_chromedriver_zip
- autoninja -C out/Default electron:node_headers
- ps: >-
Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
@@ -177,7 +166,7 @@ for:
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
ninja -C out/Default electron:electron_symbols
autoninja -C out/Default electron:electron_symbols
}
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
@@ -188,7 +177,12 @@ for:
# built on CI.
7z a pdb.zip out\Default\*.pdb
}
- python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
- ps: |
$manifest_file = "electron/script/zip_manifests/dist_zip.win.$env:TARGET_ARCH.manifest"
python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip $manifest_file
if ($LASTEXITCODE -ne 0) {
throw "Zip contains files not listed in the manifest $manifest_file"
}
- ps: |
cd C:\projects\src
$missing_artifacts = $false

View File

@@ -37,7 +37,6 @@ environment:
ELECTRON_ALSO_LOG_TO_STDERR: 1
MOCHA_REPORTER: mocha-multi-reporters
MOCHA_MULTI_REPORTERS: "@marshallofsound/mocha-appveyor-reporter, tap"
GOMA_FALLBACK_ON_AUTH_FAILURE: true
DEPOT_TOOLS_WIN_TOOLCHAIN: 1
DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL: "https://dev-cdn.electronjs.org/windows-toolchains/_"
GYP_MSVS_HASH_27370823e7: 28622d16b1
@@ -99,31 +98,22 @@ for:
if (Test-Path -Path "$pwd\src\electron") {
Remove-Item -Recurse -Force $pwd\src\electron
}
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
$env:RAW_GOMA_AUTH | Set-Content $env:GOMA_OAUTH2_CONFIG_FILE
}
- git clone https://github.com/electron/build-tools.git
- cd build-tools
- npm install
- npx yarn --ignore-engines
- mkdir third_party
- ps: >-
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
- cd ..\..
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
node -e "require('./src/utils/reclient.js').downloadAndPrepare({})"
- ps: $env:RECLIENT_HELPER = node -p "require('./src/utils/reclient.js').helperPath"
- ps: >-
if (Test-Path 'env:RAW_GOMA_AUTH') {
$goma_login = python3 $env:LOCAL_GOMA_DIR\goma_auth.py info
if ($goma_login -eq 'Login as Fermi Planck') {
Write-warning "Goma authentication is correct";
} else {
Write-warning "WARNING!!!!!! Goma authentication is incorrect; please update Goma auth token.";
$host.SetShouldExit(1)
}
}
& $env:RECLIENT_HELPER login
- ps: >-
$env:RBE_service = node -e "console.log(require('./src/utils/reclient.js').serviceAddress)"
- ps: >-
$env:RBE_experimental_credentials_helper = $env:RECLIENT_HELPER
- ps: >-
$env:RBE_experimental_credentials_helper_args = "print"
- cd ..\..
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
- ps: >-
if ($env:GN_CONFIG -ne 'release') {
@@ -145,27 +135,26 @@ for:
- cd src
- ps: $env:PATH="$pwd\third_party\ninja;$env:PATH"
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") use_remoteexec=true %GN_EXTRA_ARGS% "
- gn check out/Default //electron:electron_lib
- gn check out/Default //electron:electron_app
- gn check out/Default //electron/shell/common/api:mojo
- if DEFINED GN_GOMA_FILE (ninja -j 300 -C out/Default electron:electron_app) else (ninja -C out/Default electron:electron_app)
- if DEFINED ELECTRON_RBE_JWT (autoninja -j 300 -C out/Default electron:electron_app) else (autoninja -C out/Default electron:electron_app)
- if "%GN_CONFIG%"=="testing" ( python C:\depot_tools\post_build_ninja_summary.py -C out\Default )
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") %GN_EXTRA_ARGS%"
- ninja -C out/ffmpeg electron:electron_ffmpeg_zip
- ninja -C out/Default electron:electron_dist_zip
- gn gen out/ffmpeg "--args=import(\"//electron/build/args/ffmpeg.gn\") use_remoteexec=true %GN_EXTRA_ARGS%"
- autoninja -C out/ffmpeg electron:electron_ffmpeg_zip
- autoninja -C out/Default electron:electron_dist_zip
- gn desc out/Default v8:run_mksnapshot_default args > out/Default/default_mksnapshot_args
# Remove unused args from mksnapshot_args
- ps: >-
Get-Content out/Default/default_mksnapshot_args | Where-Object { -not $_.Contains('--turbo-profiling-input') -And -not $_.Contains('builtins-pgo') -And -not $_.Contains('The gn arg use_goma=true') } | Set-Content out/Default/mksnapshot_args
- ninja -C out/Default electron:electron_mksnapshot_zip
- autoninja -C out/Default electron:electron_mksnapshot_zip
- cd out\Default
- 7z a mksnapshot.zip mksnapshot_args gen\v8\embedded.S
- cd ..\..
- ninja -C out/Default electron:hunspell_dictionaries_zip
- ninja -C out/Default electron:electron_chromedriver_zip
- ninja -C out/Default electron:node_headers
- python3 %LOCAL_GOMA_DIR%\goma_ctl.py stat
- autoninja -C out/Default electron:hunspell_dictionaries_zip
- autoninja -C out/Default electron:electron_chromedriver_zip
- autoninja -C out/Default electron:node_headers
- ps: >-
Get-CimInstance -Namespace root\cimv2 -Class Win32_product | Select vendor, description, @{l='install_location';e='InstallLocation'}, @{l='install_date';e='InstallDate'}, @{l='install_date_2';e='InstallDate2'}, caption, version, name, @{l='sku_number';e='SKUNumber'} | ConvertTo-Json | Out-File -Encoding utf8 -FilePath .\installed_software.json
- python3 electron/build/profile_toolchain.py --output-json=out/Default/windows_toolchain_profile.json
@@ -174,7 +163,7 @@ for:
if ($env:GN_CONFIG -eq 'release') {
# Needed for msdia140.dll on 64-bit windows
$env:Path += ";$pwd\third_party\llvm-build\Release+Asserts\bin"
ninja -C out/Default electron:electron_symbols
autoninja -C out/Default electron:electron_symbols
}
- ps: >-
if ($env:GN_CONFIG -eq 'release') {
@@ -185,7 +174,12 @@ for:
# built on CI.
7z a pdb.zip out\Default\*.pdb
}
- python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip electron/script/zip_manifests/dist_zip.win.%TARGET_ARCH%.manifest
- ps: |
$manifest_file = "electron/script/zip_manifests/dist_zip.win.$env:TARGET_ARCH.manifest"
python3 electron/script/zip_manifests/check-zip-manifest.py out/Default/dist.zip $manifest_file
if ($LASTEXITCODE -ne 0) {
throw "Zip contains files not listed in the manifest $manifest_file"
}
- ps: |
cd C:\projects\src
$missing_artifacts = $false

View File

@@ -24,6 +24,10 @@ enable_printing = true
angle_enable_vulkan_validation_layers = false
dawn_enable_vulkan_validation_layers = false
# Removes dxc dll's that are only used experimentally.
# See https://bugs.chromium.org/p/chromium/issues/detail?id=1474897
dawn_use_built_dxc = false
# These are disabled because they cause the zip manifest to differ between
# testing and release builds.
# See https://chromium-review.googlesource.com/c/chromium/src/+/2774898.

View File

@@ -32,6 +32,13 @@ extern const volatile char kFuseWire[];
TEMPLATE_CC = """
#include "electron/fuses.h"
#include "base/dcheck_is_on.h"
#if DCHECK_IS_ON()
#include "base/command_line.h"
#include "base/strings/string_util.h"
#include <string>
#endif
namespace electron::fuses {
@@ -66,9 +73,20 @@ for fuse in fuses:
getters_h += "FUSE_EXPORT bool Is{name}Enabled();\n".replace("{name}", name)
getters_cc += """
bool Is{name}Enabled() {
#if DCHECK_IS_ON()
// RunAsNode is checked so early that base::CommandLine isn't yet
// initialized, so guard here to avoid a CHECK.
if (base::CommandLine::InitializedForCurrentProcess()) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch("{switch_name}")) {
std::string switch_value = command_line->GetSwitchValueASCII("{switch_name}");
return switch_value == "1";
}
}
#endif
return kFuseWire[{index}] == '1';
}
""".replace("{name}", name).replace("{index}", str(index))
""".replace("{name}", name).replace("{switch_name}", f"set-fuse-{fuse.lower()}").replace("{index}", str(index))
def c_hex(n):
s = hex(n)[2:]

View File

@@ -1,5 +0,0 @@
module.exports = require('./webpack.config.base')({
target: 'asar',
alwaysHasNode: true,
targetDeletesNodeGlobals: true
});

View File

@@ -0,0 +1,4 @@
module.exports = require('./webpack.config.base')({
target: 'node',
alwaysHasNode: true
});

View File

@@ -59,8 +59,14 @@ static_library("chrome") {
"//chrome/browser/net/proxy_service_factory.h",
"//chrome/browser/picture_in_picture/picture_in_picture_bounds_cache.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_bounds_cache.h",
"//chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker.h",
"//chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker_observer.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker_observer.h",
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.cc",
"//chrome/browser/picture_in_picture/picture_in_picture_window_manager.h",
"//chrome/browser/picture_in_picture/scoped_picture_in_picture_occlusion_observation.cc",
"//chrome/browser/picture_in_picture/scoped_picture_in_picture_occlusion_observation.h",
"//chrome/browser/platform_util.cc",
"//chrome/browser/platform_util.h",
"//chrome/browser/predictors/preconnect_manager.cc",
@@ -446,6 +452,8 @@ source_set("chrome_spellchecker") {
"//chrome/browser/profiles/profile_selections.h",
"//chrome/browser/spellchecker/spell_check_host_chrome_impl.cc",
"//chrome/browser/spellchecker/spell_check_host_chrome_impl.h",
"//chrome/browser/spellchecker/spell_check_initialization_host_impl.cc",
"//chrome/browser/spellchecker/spell_check_initialization_host_impl.h",
"//chrome/browser/spellchecker/spellcheck_custom_dictionary.cc",
"//chrome/browser/spellchecker/spellcheck_custom_dictionary.h",
"//chrome/browser/spellchecker/spellcheck_factory.cc",

View File

@@ -2,7 +2,7 @@
> Make HTTP/HTTPS requests.
Process: [Main](../glossary.md#main-process)<br />
Process: [Main](../glossary.md#main-process), [Utility](../glossary.md#utility-process)<br />
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
`ClientRequest` implements the [Writable Stream](https://nodejs.org/api/stream.html#stream_writable_streams)

View File

@@ -2,7 +2,7 @@
> Handle responses to HTTP/HTTPS requests.
Process: [Main](../glossary.md#main-process)<br />
Process: [Main](../glossary.md#main-process), [Utility](../glossary.md#utility-process)<br />
_This class is not exported from the `'electron'` module. It is only available as a return value of other methods in the Electron API._
`IncomingMessage` implements the [Readable Stream](https://nodejs.org/api/stream.html#stream_readable_streams)

View File

@@ -2,7 +2,7 @@
> Issue HTTP/HTTPS requests using Chromium's native networking library
Process: [Main](../glossary.md#main-process)
Process: [Main](../glossary.md#main-process), [Utility](../glossary.md#utility-process)
The `net` module is a client-side API for issuing HTTP(S) requests. It is
similar to the [HTTP](https://nodejs.org/api/http.html) and
@@ -119,6 +119,9 @@ protocol.handle('https', (req) => {
})
```
Note: in the [utility process](../glossary.md#utility-process) custom protocols
are not supported.
### `net.isOnline()`
Returns `boolean` - Whether there is currently internet connection.

View File

@@ -1614,6 +1614,7 @@ win.webContents.print(options, (success, errorType) => {
* `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`.
* `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
* `generateTaggedPDF` boolean (optional) _Experimental_ - Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this property is experimental, the generated PDF may not adhere fully to PDF/UA and WCAG standards.
* `generateDocumentOutline` boolean (optional) _Experimental_ - Whether or not to generate a PDF document outline from content headers. Defaults to false.
Returns `Promise<Buffer>` - Resolves with the generated PDF data.
@@ -1624,24 +1625,26 @@ The `landscape` will be ignored if `@page` CSS at-rule is used in the web page.
An example of `webContents.printToPDF`:
```js
const { BrowserWindow } = require('electron')
const { app, BrowserWindow } = require('electron')
const fs = require('node:fs')
const path = require('node:path')
const os = require('node:os')
const win = new BrowserWindow()
win.loadURL('https://github.com')
app.whenReady().then(() => {
const win = new BrowserWindow()
win.loadURL('https://github.com')
win.webContents.on('did-finish-load', () => {
// Use default printing options
const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
win.webContents.printToPDF({}).then(data => {
fs.writeFile(pdfPath, data, (error) => {
if (error) throw error
console.log(`Wrote PDF successfully to ${pdfPath}`)
win.webContents.on('did-finish-load', () => {
// Use default printing options
const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
win.webContents.printToPDF({}).then(data => {
fs.writeFile(pdfPath, data, (error) => {
if (error) throw error
console.log(`Wrote PDF successfully to ${pdfPath}`)
})
}).catch(error => {
console.log(`Failed to write PDF to ${pdfPath}: `, error)
})
}).catch(error => {
console.log(`Failed to write PDF to ${pdfPath}: `, error)
})
})
```

View File

@@ -608,6 +608,7 @@ Prints `webview`'s web page. Same as `webContents.print([options])`.
* `footerTemplate` string (optional) - HTML template for the print footer. Should use the same format as the `headerTemplate`.
* `preferCSSPageSize` boolean (optional) - Whether or not to prefer page size as defined by css. Defaults to false, in which case the content will be scaled to fit the paper size.
* `generateTaggedPDF` boolean (optional) _Experimental_ - Whether or not to generate a tagged (accessible) PDF. Defaults to false. As this property is experimental, the generated PDF may not adhere fully to PDF/UA and WCAG standards.
* `generateDocumentOutline` boolean (optional) _Experimental_ - Whether or not to generate a PDF document outline from content headers. Defaults to false.
Returns `Promise<Uint8Array>` - Resolves with the generated PDF data.

View File

@@ -12,6 +12,20 @@ This document uses the following convention to categorize breaking changes:
* **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
* **Removed:** An API or feature was removed, and is no longer supported by Electron.
## Planned Breaking API Changes (30.0)
### Behavior Changed: cross-origin iframes now use Permission Policy to access features
Cross-origin iframes must now specify features available to a given `iframe` via the `allow`
attribute in order to access them.
See [documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#allow) for
more information.
### Removed: The `--disable-color-correct-rendering` switch
This switch was never formally documented but it's removal is being noted here regardless. Chromium itself now has better support for color spaces so this flag should not be needed.
## Planned Breaking API Changes (29.0)
### Behavior Changed: `ipcRenderer` can no longer be sent over the `contextBridge`
@@ -211,6 +225,18 @@ systemPreferences.on('high-contrast-color-scheme-changed', () => { /* ... */ })
nativeTheme.on('updated', () => { /* ... */ })
```
### Removed: Some `window.setVibrancy` options on macOS
The following vibrancy options have been removed:
* 'light'
* 'medium-light'
* 'dark'
* 'ultra-dark'
* 'appearance-based'
These were previously deprecated and have been removed by Apple in 10.15.
### Removed: `webContents.getPrinters`
The `webContents.getPrinters` method has been removed. Use

View File

@@ -196,32 +196,19 @@ support via Electron's support for the [Chrome DevTools Protocol][] (CDP).
### Install dependencies
You can install Playwright through your preferred Node.js package manager. The Playwright team
recommends using the `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD` environment variable to avoid
unnecessary browser downloads when testing an Electron app.
```sh npm2yarn
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npm install --save-dev playwright
```
Playwright also comes with its own test runner, Playwright Test, which is built for end-to-end
testing. You can also install it as a dev dependency in your project:
You can install Playwright through your preferred Node.js package manager. It comes with its
own [test runner][playwright-intro], which is built for end-to-end testing:
```sh npm2yarn
npm install --save-dev @playwright/test
```
:::caution Dependencies
This tutorial was written `playwright@1.16.3` and `@playwright/test@1.16.3`. Check out
This tutorial was written with `@playwright/test@1.41.1`. Check out
[Playwright's releases][playwright-releases] page to learn about
changes that might affect the code below.
:::
:::info Using third-party test runners
If you're interested in using an alternative test runner (e.g. Jest or Mocha), check out
Playwright's [Third-Party Test Runner][playwright-test-runners] guide.
:::
### Write your tests
Playwright launches your app in development mode through the `_electron.launch` API.
@@ -229,8 +216,7 @@ To point this API to your Electron app, you can pass the path to your main proce
entry point (here, it is `main.js`).
```js {5} @ts-nocheck
const { _electron: electron } = require('playwright')
const { test } = require('@playwright/test')
const { test, _electron: electron } = require('@playwright/test')
test('launch app', async () => {
const electronApp = await electron.launch({ args: ['main.js'] })
@@ -242,9 +228,8 @@ test('launch app', async () => {
After that, you will access to an instance of Playwright's `ElectronApp` class. This
is a powerful class that has access to main process modules for example:
```js {6-11} @ts-nocheck
const { _electron: electron } = require('playwright')
const { test } = require('@playwright/test')
```js {5-10} @ts-nocheck
const { test, _electron: electron } = require('@playwright/test')
test('get isPackaged', async () => {
const electronApp = await electron.launch({ args: ['main.js'] })
@@ -263,8 +248,7 @@ It can also create individual [Page][playwright-page] objects from Electron Brow
For example, to grab the first BrowserWindow and save a screenshot:
```js {6-7} @ts-nocheck
const { _electron: electron } = require('playwright')
const { test } = require('@playwright/test')
const { test, _electron: electron } = require('@playwright/test')
test('save screenshot', async () => {
const electronApp = await electron.launch({ args: ['main.js'] })
@@ -275,12 +259,11 @@ test('save screenshot', async () => {
})
```
Putting all this together using the PlayWright Test runner, let's create a `example.spec.js`
Putting all this together using the Playwright test-runner, let's create a `example.spec.js`
test file with a single test and assertion:
```js title='example.spec.js' @ts-nocheck
const { _electron: electron } = require('playwright')
const { test, expect } = require('@playwright/test')
const { test, expect, _electron: electron } = require('@playwright/test')
test('example test', async () => {
const electronApp = await electron.launch({ args: ['.'] })
@@ -316,6 +299,7 @@ Running 1 test using 1 worker
:::info
Playwright Test will automatically run any files matching the `.*(test|spec)\.(js|ts|mjs)` regex.
You can customize this match in the [Playwright Test configuration options][playwright-test-config].
It also works with TypeScript out of the box.
:::
:::tip Further reading
@@ -473,10 +457,10 @@ test.after.always('cleanup', async t => {
[chrome-driver]: https://sites.google.com/chromium.org/driver/
[Puppeteer]: https://github.com/puppeteer/puppeteer
[playwright-intro]: https://playwright.dev/docs/intro
[playwright-electron]: https://playwright.dev/docs/api/class-electron/
[playwright-electronapplication]: https://playwright.dev/docs/api/class-electronapplication
[playwright-page]: https://playwright.dev/docs/api/class-page
[playwright-releases]: https://github.com/microsoft/playwright/releases
[playwright-releases]: https://playwright.dev/docs/release-notes
[playwright-test-config]: https://playwright.dev/docs/api/class-testconfig#test-config-test-match
[playwright-test-runners]: https://playwright.dev/docs/test-runners/
[Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/

View File

@@ -33,7 +33,7 @@ clicked.
## WebHID API
The [WebHID API](https://web.dev/hid/) can be used to access HID devices such
as keyboards and gamepads. Electron provides several APIs for working with
as keyboards and gamepads. Electron provides several APIs for working with
the WebHID API:
* The [`select-hid-device` event on the Session](../api/session.md#event-select-hid-device)

View File

@@ -9,7 +9,7 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
| Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported |
| ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- |
| 29.0.0 | 2023-Dec-07 | 2023-Jan-24 | 2023-Feb-20 | 2024-Aug-20 | M122 | v18.19 | ✅ |
| 29.0.0 | 2023-Dec-07 | 2024-Jan-24 | 2024-Feb-20 | 2024-Aug-20 | M122 | v18.19 | ✅ |
| 28.0.0 | 2023-Oct-11 | 2023-Nov-06 | 2023-Dec-05 | 2024-Jun-11 | M120 | v18.18 | ✅ |
| 27.0.0 | 2023-Aug-17 | 2023-Sep-13 | 2023-Oct-10 | 2024-Apr-16 | M118 | v18.17 | ✅ |
| 26.0.0 | 2023-Jun-01 | 2023-Jun-27 | 2023-Aug-15 | 2024-Feb-20 | M116 | v18.16 | ✅ |
@@ -38,6 +38,19 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
| 3.0.0 | -- | 2018-Jun-21 | 2018-Sep-18 | 2019-Jul-30 | M66 | v10.2 | 🚫 |
| 2.0.0 | -- | 2018-Feb-21 | 2018-May-01 | 2019-Apr-23 | M61 | v8.9 | 🚫 |
:::info Official support dates may change
Electron's official support policy is the latest 3 stable releases. Our stable
release and end-of-life dates are determined by Chromium, and may be subject to
change. While we try to keep our planned release and end-of-life dates frequently
updated here, future dates may change if affected by upstream scheduling changes,
and may not always be accurately reflected.
See [Chromium's public release schedule](https://chromiumdash.appspot.com/schedule) for
definitive information about Chromium's scheduled release dates.
:::
**Notes:**
* The `-alpha.1`, `-beta.1`, and `stable` dates are our solid release dates.
@@ -49,20 +62,10 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
* Since Electron 5, Electron has been publicizing its release dates ([see blog post](https://www.electronjs.org/blog/electron-5-0-timeline)).
* Since Electron 6, Electron major versions have been targeting every other Chromium major version. Each Electron stable should happen on the same day as Chrome stable ([see blog post](https://www.electronjs.org/blog/12-week-cadence)).
* Since Electron 16, Electron has been releasing major versions on an 8-week cadence in accordance to Chrome's change to a 4-week release cadence ([see blog post](https://www.electronjs.org/blog/8-week-cadence)).
* Electron temporarily extended support for Electron 22 until October 10, 2023, to support an extended end-of-life for Windows 7/8/8.1
## Version support policy
:::info
The Electron team will temporarily support Electron 22 until October 10, 2023.
This extended support is intended to help Electron developers who still need
support for Windows 7/8/8.1, which ended support in Electron 23. The October
support date follows the extended support dates from both Chromium and Microsoft.
On October 11, the Electron team will drop support back to the latest three
stable major versions.
:::
The latest three _stable_ major versions are supported by the Electron team.
For example, if the latest release is 6.1.x, then the 5.0.x as well
as the 4.2.x series are supported. We only support the latest minor release

View File

@@ -107,7 +107,7 @@ if (!inAppPurchase.canMakePayments()) {
inAppPurchase.getProducts(PRODUCT_IDS).then(products => {
// Check the parameters.
if (!Array.isArray(products) || products.length <= 0) {
console.log('Unable to retrieve the product informations.')
console.log('Unable to retrieve the product information.')
return
}

View File

@@ -24,7 +24,7 @@ careful to understand that the term "performance" means different things for
a Node.js backend than it does for an application running on a client.
This list is provided for your convenience and is, much like our
[security checklist][security] not meant to exhaustive. It is probably possible
[security checklist][security] not meant to be exhaustive. It is probably possible
to build a slow Electron app that follows all the steps outlined below. Electron
is a powerful development platform that enables you, the developer, to do more
or less whatever you want. All that freedom means that performance is largely
@@ -83,7 +83,7 @@ is not in fact the leanest or smallest one available.
The reasoning behind this recommendation is best illustrated with a real-world
example. During the early days of Electron, reliable detection of network
connectivity was a problem, resulting many apps to use a module that exposed a
connectivity was a problem, resulting in many apps using a module that exposed a
simple `isOnline()` method.
That module detected your network connectivity by attempting to reach out to a

View File

@@ -83,7 +83,7 @@ terminated as well.
The main process also controls your application's lifecycle through Electron's
[`app`][app] module. This module provides a large set of events and methods
that you can use to add custom application behaviour (for instance, programmatically
that you can use to add custom application behavior (for instance, programmatically
quitting your application, modifying the application dock, or showing an About panel).
As a practical example, the app shown in the [quick start guide][quick-start-lifecycle]

View File

@@ -17,7 +17,7 @@ further configuration. If you want to disable the sandbox for a process, see the
[Disabling the sandbox for a single process](#disabling-the-sandbox-for-a-single-process)
section.
## Sandbox behaviour in Electron
## Sandbox behavior in Electron
Sandboxed processes in Electron behave _mostly_ in the same way as Chromium's do, but
Electron has a few additional concepts to consider because it interfaces with Node.js.

View File

@@ -114,6 +114,8 @@ You should at least follow these steps to improve the security of your applicati
15. [Do not use `shell.openExternal` with untrusted content](#15-do-not-use-shellopenexternal-with-untrusted-content)
16. [Use a current version of Electron](#16-use-a-current-version-of-electron)
17. [Validate the `sender` of all IPC messages](#17-validate-the-sender-of-all-ipc-messages)
18. [Avoid usage of the `file://` protocol and prefer usage of custom protocols](#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols)
19. [Check which fuses you can change](#19-check-which-fuses-you-can-change)
To automate the detection of misconfigurations and insecure patterns, it is
possible to use
@@ -780,6 +782,28 @@ set of files.
Follow the [`protocol.handle`](../api/protocol.md#protocolhandlescheme-handler) examples to
learn how to serve files / content from a custom protocol.
### 19. Check which fuses you can change
Electron ships with a number of options that can be useful but a large portion of
applications probably don't need. In order to avoid having to build your own version of
Electron, these can be turned off or on using [Fuses](./fuses.md).
#### Why?
Some fuses, like `runAsNode` and `nodeCliInspect`, allow the application to behave differently
when run from the command line using specific environment variables or CLI arguments. These
can be used to execute commands on the device through your application.
This can let external scripts run commands that they potentially would not be allowed to, but
that your application might have the rights for.
#### How?
We've made a module, [`@electron/fuses`](https://npmjs.com/package/@electron/fuses), to make
flipping these fuses easy. Check out the README of that module for more details on usage and
potential error cases, and refer to
[How do I flip the fuses?](./fuses.md#how-do-i-flip-the-fuses) in our documentation.
[breaking-changes]: ../breaking-changes.md
[browser-window]: ../api/browser-window.md
[browser-view]: ../api/browser-view.md

View File

@@ -203,7 +203,7 @@ loading the HTML file so that the handler is guaranteed to be ready before
you send out the `invoke` call from the renderer.
```js {1,15} title="main.js"
const { app, BrowserWindow, ipcMain } = require('electron')
const { app, BrowserWindow, ipcMain } = require('electron/main')
const path = require('node:path')
const createWindow = () => {

View File

@@ -215,7 +215,6 @@ auto_filenames = {
"lib/browser/api/message-channel.ts",
"lib/browser/api/module-list.ts",
"lib/browser/api/native-theme.ts",
"lib/browser/api/net-client-request.ts",
"lib/browser/api/net-fetch.ts",
"lib/browser/api/net-log.ts",
"lib/browser/api/net.ts",
@@ -251,12 +250,12 @@ auto_filenames = {
"lib/browser/web-view-events.ts",
"lib/common/api/module-list.ts",
"lib/common/api/native-image.ts",
"lib/common/api/net-client-request.ts",
"lib/common/api/shell.ts",
"lib/common/define-properties.ts",
"lib/common/deprecate.ts",
"lib/common/init.ts",
"lib/common/ipc-messages.ts",
"lib/common/reset-search-paths.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-globals-provider.ts",
"package.json",
@@ -273,7 +272,6 @@ auto_filenames = {
"lib/common/define-properties.ts",
"lib/common/init.ts",
"lib/common/ipc-messages.ts",
"lib/common/reset-search-paths.ts",
"lib/common/web-view-methods.ts",
"lib/common/webpack-provider.ts",
"lib/renderer/api/clipboard.ts",
@@ -312,7 +310,6 @@ auto_filenames = {
"lib/common/define-properties.ts",
"lib/common/init.ts",
"lib/common/ipc-messages.ts",
"lib/common/reset-search-paths.ts",
"lib/common/webpack-provider.ts",
"lib/renderer/api/clipboard.ts",
"lib/renderer/api/context-bridge.ts",
@@ -332,10 +329,9 @@ auto_filenames = {
"typings/internal-electron.d.ts",
]
asar_bundle_deps = [
"lib/asar/fs-wrapper.ts",
"lib/asar/init.ts",
"lib/common/webpack-provider.ts",
node_bundle_deps = [
"lib/node/asar-fs-wrapper.ts",
"lib/node/init.ts",
"package.json",
"tsconfig.electron.json",
"tsconfig.json",
@@ -344,12 +340,15 @@ auto_filenames = {
]
utility_bundle_deps = [
"lib/browser/api/net-fetch.ts",
"lib/browser/message-port-main.ts",
"lib/common/api/net-client-request.ts",
"lib/common/define-properties.ts",
"lib/common/init.ts",
"lib/common/reset-search-paths.ts",
"lib/common/webpack-globals-provider.ts",
"lib/utility/api/exports/electron.ts",
"lib/utility/api/module-list.ts",
"lib/utility/api/net.ts",
"lib/utility/init.ts",
"lib/utility/parent-port.ts",
"package.json",

View File

@@ -283,7 +283,6 @@ filenames = {
"shell/browser/api/electron_api_menu.h",
"shell/browser/api/electron_api_native_theme.cc",
"shell/browser/api/electron_api_native_theme.h",
"shell/browser/api/electron_api_net.cc",
"shell/browser/api/electron_api_net_log.cc",
"shell/browser/api/electron_api_net_log.h",
"shell/browser/api/electron_api_notification.cc",
@@ -309,8 +308,6 @@ filenames = {
"shell/browser/api/electron_api_system_preferences.h",
"shell/browser/api/electron_api_tray.cc",
"shell/browser/api/electron_api_tray.h",
"shell/browser/api/electron_api_url_loader.cc",
"shell/browser/api/electron_api_url_loader.h",
"shell/browser/api/electron_api_utility_process.cc",
"shell/browser/api/electron_api_utility_process.h",
"shell/browser/api/electron_api_view.cc",
@@ -548,8 +545,11 @@ filenames = {
"shell/common/api/electron_api_key_weak_map.h",
"shell/common/api/electron_api_native_image.cc",
"shell/common/api/electron_api_native_image.h",
"shell/common/api/electron_api_net.cc",
"shell/common/api/electron_api_shell.cc",
"shell/common/api/electron_api_testing.cc",
"shell/common/api/electron_api_url_loader.cc",
"shell/common/api/electron_api_url_loader.h",
"shell/common/api/electron_api_v8_util.cc",
"shell/common/api/electron_bindings.cc",
"shell/common/api/electron_bindings.h",

View File

@@ -23,6 +23,8 @@ libcxx_headers = [
"//third_party/libc++/src/include/__algorithm/find_first_of.h",
"//third_party/libc++/src/include/__algorithm/find_if.h",
"//third_party/libc++/src/include/__algorithm/find_if_not.h",
"//third_party/libc++/src/include/__algorithm/find_segment_if.h",
"//third_party/libc++/src/include/__algorithm/fold.h",
"//third_party/libc++/src/include/__algorithm/for_each.h",
"//third_party/libc++/src/include/__algorithm/for_each_n.h",
"//third_party/libc++/src/include/__algorithm/for_each_segment.h",
@@ -88,6 +90,7 @@ libcxx_headers = [
"//third_party/libc++/src/include/__algorithm/pstl_backends/cpu_backends/transform_reduce.h",
"//third_party/libc++/src/include/__algorithm/pstl_copy.h",
"//third_party/libc++/src/include/__algorithm/pstl_count.h",
"//third_party/libc++/src/include/__algorithm/pstl_equal.h",
"//third_party/libc++/src/include/__algorithm/pstl_fill.h",
"//third_party/libc++/src/include/__algorithm/pstl_find.h",
"//third_party/libc++/src/include/__algorithm/pstl_for_each.h",
@@ -107,6 +110,7 @@ libcxx_headers = [
"//third_party/libc++/src/include/__algorithm/ranges_any_of.h",
"//third_party/libc++/src/include/__algorithm/ranges_binary_search.h",
"//third_party/libc++/src/include/__algorithm/ranges_clamp.h",
"//third_party/libc++/src/include/__algorithm/ranges_contains.h",
"//third_party/libc++/src/include/__algorithm/ranges_copy.h",
"//third_party/libc++/src/include/__algorithm/ranges_copy_backward.h",
"//third_party/libc++/src/include/__algorithm/ranges_copy_if.h",
@@ -838,6 +842,7 @@ libcxx_headers = [
"//third_party/libc++/src/include/__type_traits/void_t.h",
"//third_party/libc++/src/include/__undef_macros",
"//third_party/libc++/src/include/__utility/as_const.h",
"//third_party/libc++/src/include/__utility/as_lvalue.h",
"//third_party/libc++/src/include/__utility/auto_cast.h",
"//third_party/libc++/src/include/__utility/cmp.h",
"//third_party/libc++/src/include/__utility/convert_to_integral.h",
@@ -851,6 +856,7 @@ libcxx_headers = [
"//third_party/libc++/src/include/__utility/integer_sequence.h",
"//third_party/libc++/src/include/__utility/is_pointer_in_range.h",
"//third_party/libc++/src/include/__utility/move.h",
"//third_party/libc++/src/include/__utility/no_destroy.h",
"//third_party/libc++/src/include/__utility/pair.h",
"//third_party/libc++/src/include/__utility/piecewise_construct.h",
"//third_party/libc++/src/include/__utility/priority_tag.h",
@@ -910,10 +916,8 @@ libcxx_headers = [
"//third_party/libc++/src/include/expected",
"//third_party/libc++/src/include/experimental/__config",
"//third_party/libc++/src/include/experimental/__memory",
"//third_party/libc++/src/include/experimental/__simd/abi_tag.h",
"//third_party/libc++/src/include/experimental/__simd/aligned_tag.h",
"//third_party/libc++/src/include/experimental/__simd/declaration.h",
"//third_party/libc++/src/include/experimental/__simd/internal_declaration.h",
"//third_party/libc++/src/include/experimental/__simd/reference.h",
"//third_party/libc++/src/include/experimental/__simd/scalar.h",
"//third_party/libc++/src/include/experimental/__simd/simd.h",
@@ -921,23 +925,12 @@ libcxx_headers = [
"//third_party/libc++/src/include/experimental/__simd/traits.h",
"//third_party/libc++/src/include/experimental/__simd/utility.h",
"//third_party/libc++/src/include/experimental/__simd/vec_ext.h",
"//third_party/libc++/src/include/experimental/deque",
"//third_party/libc++/src/include/experimental/forward_list",
"//third_party/libc++/src/include/experimental/iterator",
"//third_party/libc++/src/include/experimental/list",
"//third_party/libc++/src/include/experimental/map",
"//third_party/libc++/src/include/experimental/memory",
"//third_party/libc++/src/include/experimental/memory_resource",
"//third_party/libc++/src/include/experimental/propagate_const",
"//third_party/libc++/src/include/experimental/regex",
"//third_party/libc++/src/include/experimental/set",
"//third_party/libc++/src/include/experimental/simd",
"//third_party/libc++/src/include/experimental/string",
"//third_party/libc++/src/include/experimental/type_traits",
"//third_party/libc++/src/include/experimental/unordered_map",
"//third_party/libc++/src/include/experimental/unordered_set",
"//third_party/libc++/src/include/experimental/utility",
"//third_party/libc++/src/include/experimental/vector",
"//third_party/libc++/src/include/ext/__hash",
"//third_party/libc++/src/include/ext/hash_map",
"//third_party/libc++/src/include/ext/hash_set",

View File

@@ -1,3 +0,0 @@
import { wrapFsWithAsar } from './fs-wrapper';
wrapFsWithAsar(require('fs'));

View File

@@ -38,6 +38,8 @@ const spawnUpdate = async function (args: string[], options: { detached: boolean
spawnedProcess.stderr.on('data', (data) => { stderr += data; });
spawnedProcess.on('error', (error) => {
spawnedProcess = undefined;
spawnedArgs = [];
reject(error);
});

View File

@@ -1,6 +1,6 @@
import { net, IncomingMessage, Session as SessionT } from 'electron/main';
import { ClientRequestConstructorOptions, ClientRequest, IncomingMessage, Session as SessionT } from 'electron/main';
import { Readable, Writable, isReadable } from 'stream';
import { allowAnyProtocol } from '@electron/internal/browser/api/net-client-request';
import { allowAnyProtocol } from '@electron/internal/common/api/net-client-request';
function createDeferredPromise<T, E extends Error = Error> (): { promise: Promise<T>; resolve: (x: T) => void; reject: (e: E) => void; } {
let res: (x: T) => void;
@@ -13,7 +13,8 @@ function createDeferredPromise<T, E extends Error = Error> (): { promise: Promis
return { promise, resolve: res!, reject: rej! };
}
export function fetchWithSession (input: RequestInfo, init: (RequestInit & {bypassCustomProtocolHandlers?: boolean}) | undefined, session: SessionT): Promise<Response> {
export function fetchWithSession (input: RequestInfo, init: (RequestInit & {bypassCustomProtocolHandlers?: boolean}) | undefined, session: SessionT | undefined,
request: (options: ClientRequestConstructorOptions | string) => ClientRequest) {
const p = createDeferredPromise<Response>();
let req: Request;
try {
@@ -73,7 +74,7 @@ export function fetchWithSession (input: RequestInfo, init: (RequestInit & {bypa
// We can't set credentials to same-origin unless there's an origin set.
const credentials = req.credentials === 'same-origin' && !origin ? 'include' : req.credentials;
const r = net.request(allowAnyProtocol({
const r = request(allowAnyProtocol({
session,
method: req.method,
url: req.url,

View File

@@ -1,10 +1,13 @@
import { IncomingMessage, session } from 'electron/main';
import { app, IncomingMessage, session } from 'electron/main';
import type { ClientRequestConstructorOptions } from 'electron/main';
import { ClientRequest } from '@electron/internal/browser/api/net-client-request';
import { ClientRequest } from '@electron/internal/common/api/net-client-request';
const { isOnline } = process._linkedBinding('electron_browser_net');
const { isOnline } = process._linkedBinding('electron_common_net');
export function request (options: ClientRequestConstructorOptions | string, callback?: (message: IncomingMessage) => void) {
if (!app.isReady()) {
throw new Error('net module can only be used after app is ready');
}
return new ClientRequest(options, callback);
}

View File

@@ -1,8 +1,9 @@
import { fetchWithSession } from '@electron/internal/browser/api/net-fetch';
import { net } from 'electron/main';
const { fromPartition, fromPath, Session } = process._linkedBinding('electron_browser_session');
Session.prototype.fetch = function (input: RequestInfo, init?: RequestInit) {
return fetchWithSession(input, init, this);
return fetchWithSession(input, init, this, net.request);
};
export default {

View File

@@ -235,6 +235,7 @@ WebContents.prototype.printToPDF = async function (options) {
pageRanges: checkType(options.pageRanges ?? '', 'string', 'pageRanges'),
preferCSSPageSize: checkType(options.preferCSSPageSize ?? false, 'boolean', 'preferCSSPageSize'),
generateTaggedPDF: checkType(options.generateTaggedPDF ?? false, 'boolean', 'generateTaggedPDF'),
generateDocumentOutline: checkType(options.generateDocumentOutline ?? false, 'boolean', 'generateDocumentOutline'),
...parsePageSize(options.pageSize ?? 'letter')
};

View File

@@ -14,7 +14,7 @@ interface GuestInstance {
}
const webViewManager = process._linkedBinding('electron_browser_web_view_manager');
const netBinding = process._linkedBinding('electron_browser_net');
const netBinding = process._linkedBinding('electron_common_net');
const supportedWebViewEvents = Object.keys(webViewEvents);

View File

@@ -3,6 +3,8 @@ import * as fs from 'fs';
import * as path from 'path';
import type * as defaultMenuModule from '@electron/internal/browser/default-menu';
import type * as url from 'url';
import type * as v8 from 'v8';
const Module = require('module') as NodeJS.ModuleInternal;
@@ -10,9 +12,6 @@ const Module = require('module') as NodeJS.ModuleInternal;
// we need to restore it here.
process.argv.splice(1, 1);
// Clear search paths.
require('../common/reset-search-paths');
// Import common settings.
require('@electron/internal/common/init');
@@ -135,7 +134,7 @@ if (packageJson.desktopName != null) {
// Set v8 flags, deliberately lazy load so that apps that do not use this
// feature do not pay the price
if (packageJson.v8Flags != null) {
require('v8').setFlagsFromString(packageJson.v8Flags);
(require('v8') as typeof v8).setFlagsFromString(packageJson.v8Flags);
}
app.setAppPath(packagePath);
@@ -198,7 +197,7 @@ if (packagePath) {
// Finally load app's main.js and transfer control to C++.
if ((packageJson.type === 'module' && !mainStartupScript.endsWith('.cjs')) || mainStartupScript.endsWith('.mjs')) {
const { loadESM } = __non_webpack_require__('internal/process/esm_loader');
const main = require('url').pathToFileURL(path.join(packagePath, mainStartupScript));
const main = (require('url') as typeof url).pathToFileURL(path.join(packagePath, mainStartupScript));
loadESM(async (esmLoader: any) => {
try {
await esmLoader.import(main.toString(), undefined, Object.create(null));

View File

@@ -1,14 +1,15 @@
import * as url from 'url';
import { Readable, Writable } from 'stream';
import { app } from 'electron/main';
import type { ClientRequestConstructorOptions, UploadProgress } from 'electron/main';
import type {
ClientRequestConstructorOptions,
UploadProgress
} from 'electron/common';
const {
isValidHeaderName,
isValidHeaderValue,
createURLLoader
} = process._linkedBinding('electron_browser_net');
const { Session } = process._linkedBinding('electron_browser_session');
} = process._linkedBinding('electron_common_net');
const kHttpProtocols = new Set(['http:', 'https:']);
@@ -283,14 +284,17 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod
const key = name.toLowerCase();
urlLoaderOptions.headers[key] = { name, value };
}
if (options.session) {
if (!(options.session instanceof Session)) { throw new TypeError('`session` should be an instance of the Session class'); }
urlLoaderOptions.session = options.session;
} else if (options.partition) {
if (typeof options.partition === 'string') {
urlLoaderOptions.partition = options.partition;
} else {
throw new TypeError('`partition` should be a string');
if (process.type !== 'utility') {
const { Session } = process._linkedBinding('electron_browser_session');
if (options.session) {
if (!(options.session instanceof Session)) { throw new TypeError('`session` should be an instance of the Session class'); }
urlLoaderOptions.session = options.session;
} else if (options.partition) {
if (typeof options.partition === 'string') {
urlLoaderOptions.partition = options.partition;
} else {
throw new TypeError('`partition` should be a string');
}
}
}
return urlLoaderOptions;
@@ -312,10 +316,6 @@ export class ClientRequest extends Writable implements Electron.ClientRequest {
constructor (options: ClientRequestConstructorOptions | string, callback?: (message: IncomingMessage) => void) {
super({ autoDestroy: true });
if (!app.isReady()) {
throw new Error('net module can only be used after app is ready');
}
if (callback) {
this.once('response', callback);
}

View File

@@ -1,6 +1,7 @@
import * as util from 'util';
import type * as stream from 'stream';
const timers = require('timers');
import timers = require('timers');
type AnyFn = (...args: any[]) => any
@@ -62,7 +63,7 @@ if (process.type === 'browser' ||
if (process.platform === 'win32') {
// Always returns EOF for stdin stream.
const { Readable } = require('stream');
const { Readable } = require('stream') as typeof stream;
const stdin = new Readable();
stdin.push(null);
Object.defineProperty(process, 'stdin', {
@@ -73,3 +74,43 @@ if (process.platform === 'win32') {
}
});
}
const Module = require('module') as NodeJS.ModuleInternal;
// Make a fake Electron module that we will insert into the module cache
const makeElectronModule = (name: string) => {
const electronModule = new Module('electron', null);
electronModule.id = 'electron';
electronModule.loaded = true;
electronModule.filename = name;
Object.defineProperty(electronModule, 'exports', {
get: () => require('electron')
});
Module._cache[name] = electronModule;
};
makeElectronModule('electron');
makeElectronModule('electron/common');
if (process.type === 'browser') {
makeElectronModule('electron/main');
}
if (process.type === 'renderer') {
makeElectronModule('electron/renderer');
}
const originalResolveFilename = Module._resolveFilename;
// 'electron/main', 'electron/renderer' and 'electron/common' are module aliases
// of the 'electron' module for TypeScript purposes, i.e., the types for
// 'electron/main' consist of only main process modules, etc. It is intentional
// that these can be `require()`-ed from both the main process as well as the
// renderer process regardless of the names, they're superficial for TypeScript
// only.
const electronModuleNames = new Set(['electron', 'electron/main', 'electron/renderer', 'electron/common']);
Module._resolveFilename = function (request, parent, isMain, options) {
if (electronModuleNames.has(request)) {
return 'electron';
} else {
return originalResolveFilename(request, parent, isMain, options);
}
};

View File

@@ -1,69 +0,0 @@
import * as path from 'path';
const Module = require('module') as NodeJS.ModuleInternal;
// We do not want to allow use of the VM module in the renderer process as
// it conflicts with Blink's V8::Context internal logic.
if (process.type === 'renderer') {
const _load = Module._load;
Module._load = function (request: string) {
if (request === 'vm') {
console.warn('The vm module of Node.js is deprecated in the renderer process and will be removed.');
}
return _load.apply(this, arguments as any);
};
}
// Prevent Node from adding paths outside this app to search paths.
const resourcesPathWithTrailingSlash = process.resourcesPath + path.sep;
const originalNodeModulePaths = Module._nodeModulePaths;
Module._nodeModulePaths = function (from: string) {
const paths: string[] = originalNodeModulePaths(from);
const fromPath = path.resolve(from) + path.sep;
// If "from" is outside the app then we do nothing.
if (fromPath.startsWith(resourcesPathWithTrailingSlash)) {
return paths.filter(function (candidate) {
return candidate.startsWith(resourcesPathWithTrailingSlash);
});
} else {
return paths;
}
};
// Make a fake Electron module that we will insert into the module cache
const makeElectronModule = (name: string) => {
const electronModule = new Module('electron', null);
electronModule.id = 'electron';
electronModule.loaded = true;
electronModule.filename = name;
Object.defineProperty(electronModule, 'exports', {
get: () => require('electron')
});
Module._cache[name] = electronModule;
};
makeElectronModule('electron');
makeElectronModule('electron/common');
if (process.type === 'browser') {
makeElectronModule('electron/main');
}
if (process.type === 'renderer') {
makeElectronModule('electron/renderer');
}
const originalResolveFilename = Module._resolveFilename;
// 'electron/main', 'electron/renderer' and 'electron/common' are module aliases
// of the 'electron' module for TypeScript purposes, i.e., the types for
// 'electron/main' consist of only main process modules, etc. It is intentional
// that these can be `require()`-ed from both the main process as well as the
// renderer process regardless of the names, they're superficial for TypeScript
// only.
const electronModuleNames = new Set(['electron', 'electron/main', 'electron/renderer', 'electron/common']);
Module._resolveFilename = function (request, parent, isMain, options) {
if (electronModuleNames.has(request)) {
return 'electron';
} else {
return originalResolveFilename(request, parent, isMain, options);
}
};

View File

@@ -2,7 +2,9 @@ import { Buffer } from 'buffer';
import { constants } from 'fs';
import * as path from 'path';
import * as util from 'util';
import type * as Crypto from 'crypto';
import type * as os from 'os';
const asar = process._linkedBinding('electron_common_asar');
@@ -255,7 +257,7 @@ export const wrapFsWithAsar = (fs: Record<string, any>) => {
if (!process.env.ELECTRON_LOG_ASAR_READS) return;
if (!logFDs.has(asarPath)) {
const logFilename = `${path.basename(asarPath, '.asar')}-access-log.txt`;
const logPath = path.join(require('os').tmpdir(), logFilename);
const logPath = path.join((require('os') as typeof os).tmpdir(), logFilename);
logFDs.set(asarPath, fs.openSync(logPath, 'a'));
}
fs.writeSync(logFDs.get(asarPath), `${offset}: ${filePath}\n`);

49
lib/node/init.ts Normal file
View File

@@ -0,0 +1,49 @@
// Initialize ASAR support in fs module.
import { wrapFsWithAsar } from './asar-fs-wrapper';
wrapFsWithAsar(require('fs'));
// Hook child_process.fork.
import cp = require('child_process'); // eslint-disable-line import/first
const originalFork = cp.fork;
cp.fork = (modulePath, args?, options?: cp.ForkOptions) => {
// Parse optional args.
if (args == null) {
args = [];
} else if (typeof args === 'object' && !Array.isArray(args)) {
options = args as cp.ForkOptions;
args = [];
}
// Fallback to original fork to report arg type errors.
if (typeof modulePath !== 'string' || !Array.isArray(args) ||
(typeof options !== 'object' && typeof options !== 'undefined')) {
return originalFork(modulePath, args, options);
}
// When forking a child script, we setup a special environment to make
// the electron binary run like upstream Node.js.
options = options ?? {};
options.env = Object.create(options.env || process.env);
options.env!.ELECTRON_RUN_AS_NODE = '1';
// On mac the child script runs in helper executable.
if (!options.execPath && process.platform === 'darwin') {
options.execPath = process.helperExecPath;
}
return originalFork(modulePath, args, options);
};
// Prevent Node from adding paths outside this app to search paths.
import path = require('path'); // eslint-disable-line import/first
const Module = require('module') as NodeJS.ModuleInternal;
const resourcesPathWithTrailingSlash = process.resourcesPath + path.sep;
const originalNodeModulePaths = Module._nodeModulePaths;
Module._nodeModulePaths = function (from) {
const paths: string[] = originalNodeModulePaths(from);
const fromPath = path.resolve(from) + path.sep;
// If "from" is outside the app then we do nothing.
if (fromPath.startsWith(resourcesPathWithTrailingSlash)) {
return paths.filter(function (candidate) {
return candidate.startsWith(resourcesPathWithTrailingSlash);
});
} else {
return paths;
}
};

View File

@@ -7,6 +7,16 @@ import type * as ipcRendererUtilsModule from '@electron/internal/renderer/ipc-re
const Module = require('module') as NodeJS.ModuleInternal;
// We do not want to allow use of the VM module in the renderer process as
// it conflicts with Blink's V8::Context internal logic.
const originalModuleLoad = Module._load;
Module._load = function (request: string) {
if (request === 'vm') {
console.warn('The vm module of Node.js is deprecated in the renderer process and will be removed.');
}
return originalModuleLoad.apply(this, arguments as any);
};
// Make sure globals like "process" and "global" are always available in preload
// scripts even after they are deleted in "loaded" script.
//
@@ -33,9 +43,6 @@ Module.wrapper = [
// init.js, we need to restore it here.
process.argv.splice(1, 1);
// Clear search paths.
require('../common/reset-search-paths');
// Import common settings.
require('@electron/internal/common/init');

View File

@@ -1,4 +1,5 @@
import * as events from 'events';
import { setImmediate, clearImmediate } from 'timers';
import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages';
import type * as ipcRendererUtilsModule from '@electron/internal/renderer/ipc-renderer-internal-utils';
@@ -126,7 +127,6 @@ function runPreloadScript (preloadSrc: string) {
// eval in window scope
const preloadFn = binding.createPreloadScript(preloadWrapperSrc);
const { setImmediate, clearImmediate } = require('timers');
const exports = {};
preloadFn(preloadRequire, preloadProcess, Buffer, global, setImmediate, clearImmediate, exports, { exports });

View File

@@ -1,2 +1,4 @@
// Utility side modules, please sort alphabetically.
export const utilityNodeModuleList: ElectronInternal.ModuleEntry[] = [];
export const utilityNodeModuleList: ElectronInternal.ModuleEntry[] = [
{ name: 'net', loader: () => require('./net') }
];

22
lib/utility/api/net.ts Normal file
View File

@@ -0,0 +1,22 @@
import { IncomingMessage } from 'electron/utility';
import type { ClientRequestConstructorOptions } from 'electron/utility';
import { ClientRequest } from '@electron/internal/common/api/net-client-request';
import { fetchWithSession } from '@electron/internal/browser/api/net-fetch';
const { isOnline, resolveHost } = process._linkedBinding('electron_common_net');
export function request (options: ClientRequestConstructorOptions | string, callback?: (message: IncomingMessage) => void) {
return new ClientRequest(options, callback);
}
export function fetch (input: RequestInfo, init?: RequestInit): Promise<Response> {
return fetchWithSession(input, init, undefined, request);
}
exports.resolveHost = resolveHost;
exports.isOnline = isOnline;
Object.defineProperty(exports, 'online', {
get: () => isOnline()
});

View File

@@ -1,3 +1,4 @@
import { EventEmitter } from 'events';
import { pathToFileURL } from 'url';
import { ParentPort } from '@electron/internal/utility/parent-port';
@@ -9,12 +10,11 @@ const entryScript: string = v8Util.getHiddenValue(process, '_serviceStartupScrip
// we need to restore it here.
process.argv.splice(1, 1, entryScript);
// Clear search paths.
require('../common/reset-search-paths');
// Import common settings.
require('@electron/internal/common/init');
process._linkedBinding('electron_browser_event_emitter').setEventEmitterPrototype(EventEmitter.prototype);
const parentPort: ParentPort = new ParentPort();
Object.defineProperty(process, 'parentPort', {
enumerable: true,

View File

@@ -6,9 +6,6 @@ const Module = require('module') as NodeJS.ModuleInternal;
// init.js, we need to restore it here.
process.argv.splice(1, 1);
// Clear search paths.
require('../common/reset-search-paths');
// Import common settings.
require('@electron/internal/common/init');

View File

@@ -33,7 +33,6 @@ worker_context_will_destroy.patch
frame_host_manager.patch
crashpad_pid_check.patch
network_service_allow_remote_certificate_verification_logic.patch
disable_color_correct_rendering.patch
add_contentgpuclient_precreatemessageloop_callback.patch
picture-in-picture.patch
disable_compositor_recycling.patch
@@ -49,7 +48,6 @@ feat_add_support_for_overriding_the_base_spellchecker_download_url.patch
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
allow_in-process_windows_to_have_different_web_prefs.patch
refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
crash_allow_setting_more_options.patch
@@ -127,5 +125,7 @@ fix_activate_background_material_on_windows.patch
feat_allow_passing_of_objecttemplate_to_objecttemplatebuilder.patch
chore_remove_check_is_test_on_script_injection_tracker.patch
fix_restore_original_resize_performance_on_macos.patch
fix_font_flooding_in_dev_tools.patch
feat_allow_code_cache_in_custom_schemes.patch
build_run_reclient_cfg_generator_after_chrome.patch
fix_suppress_clang_-wimplicit-const-int-float-conversion_in.patch
cherry-pick-e7ffe20ebfac.patch

View File

@@ -10,7 +10,7 @@ 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 8d9c853f7fe861ed7ff790fa2c02706b3a2c7264..fa9717eeb7a6f46aebf14d1fc00e2b19741b55a2 100644
index 3f18e426a88127090a6f62a08a5e09185f704c35..a04b115c45a24936a5418af179d6e35312c6fd31 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -264,6 +264,10 @@ int GpuMain(MainFunctionParams parameters) {

View File

@@ -10,10 +10,10 @@ 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 c302f3e672cea9b73591048cf581f3e81078d5cb..eb1d1b0b59e687b996e76c205a8712346089c04b 100644
index 2f05e37b8513bc28d199f81130e55063643a7c49..a03a0f4294843962c7c670c96c1df0027eab641f 100644
--- a/content/public/renderer/render_frame_observer.h
+++ b/content/public/renderer/render_frame_observer.h
@@ -140,6 +140,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
@@ -146,6 +146,8 @@ class CONTENT_EXPORT RenderFrameObserver
virtual void DidHandleOnloadEvents() {}
virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
int32_t world_id) {}
@@ -23,10 +23,10 @@ index c302f3e672cea9b73591048cf581f3e81078d5cb..eb1d1b0b59e687b996e76c205a871234
int32_t world_id) {}
virtual void DidClearWindowObject() {}
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 9bea02ba22dc601e57406513ed02c8704bf587de..ccd3c27b7537f9c1adce9d32137d0e596be7c545 100644
index f5a6fde5af92e6a8258ac80e242f7ea21e946d1a..b53c0ad1e752428ab8df1356606e7b1add8c4ba0 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4565,6 +4565,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
@@ -4582,6 +4582,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
observer.DidCreateScriptContext(context, world_id);
}
@@ -40,10 +40,10 @@ index 9bea02ba22dc601e57406513ed02c8704bf587de..ccd3c27b7537f9c1adce9d32137d0e59
int world_id) {
for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 6fa0c635d1080cf2d7dbc0c7bd2c9bb5c083b986..dee1c7e60a998fd1947b4ff542872de0eb8d87cd 100644
index b229bc3ebfee7d8cb3c874b44a4bcc588f37c3ad..75e05f339a5877215e33c095e5714089d96a035a 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -621,6 +621,8 @@ class CONTENT_EXPORT RenderFrameImpl
@@ -638,6 +638,8 @@ class CONTENT_EXPORT RenderFrameImpl
void DidObserveLayoutShift(double score, bool after_input_or_scroll) override;
void DidCreateScriptContext(v8::Local<v8::Context> context,
int world_id) override;
@@ -53,10 +53,10 @@ index 6fa0c635d1080cf2d7dbc0c7bd2c9bb5c083b986..dee1c7e60a998fd1947b4ff542872de0
int world_id) override;
void DidChangeScrollOffset() override;
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
index ac82f8a9c14546d09e0181da93fbc361dc09dd78..94e177829c75ba3f4b33b4ca0802173e7faa1b92 100644
index 3bc8608e6954aa607c224665e7720d6580f35e22..b9e4ef7ae602b00131c3cafebb92fb9875158833 100644
--- a/third_party/blink/public/web/web_local_frame_client.h
+++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -619,6 +619,9 @@ class BLINK_EXPORT WebLocalFrameClient {
@@ -634,6 +634,9 @@ class BLINK_EXPORT WebLocalFrameClient {
virtual void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) {}
@@ -67,10 +67,10 @@ index ac82f8a9c14546d09e0181da93fbc361dc09dd78..94e177829c75ba3f4b33b4ca0802173e
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 e22ccf32a9e3c596e44506244f284f1c2be86762..65ff494dc7c5676fbb534c1dd1854010c507a1eb 100644
index 28b22dd1ae04b404a6081f67306cec7c18ceff80..c15355bf971294b99e9bb484faad84ff760398eb 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
@@ -202,6 +202,7 @@ void LocalWindowProxy::Initialize() {
@@ -204,6 +204,7 @@ void LocalWindowProxy::Initialize() {
}
InstallConditionalFeatures();
@@ -79,7 +79,7 @@ index e22ccf32a9e3c596e44506244f284f1c2be86762..65ff494dc7c5676fbb534c1dd1854010
if (World().IsMainWorld()) {
probe::DidCreateMainWorldContext(GetFrame());
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
index e982a11fc5412a9dce2ecde8af2fdaab4b2d56e7..a2169ba91e8856667b300672ed1a64841bf9c3a6 100644
index 2709519d0bbf33548704c14a99324b504d27ccbf..aa3c2d3c1ea73da128616fe676ac09e2095623f5 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -302,6 +302,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
@@ -92,10 +92,10 @@ index e982a11fc5412a9dce2ecde8af2fdaab4b2d56e7..a2169ba91e8856667b300672ed1a6484
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 150f4280ec4c3829c14da8166ab2a4e9c043d551..b9dd77befa57677fa2b1f507c90cf0bedd09eafa 100644
index 6139aed9ebbb459d4d7027312c0f15b669fedfb6..db566ba272b1eff5e67547c5d82bf7420def7285 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
@@ -283,6 +283,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -289,6 +289,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
web_frame_->Client()->DidCreateScriptContext(context, world_id);
}
@@ -110,7 +110,7 @@ index 150f4280ec4c3829c14da8166ab2a4e9c043d551..b9dd77befa57677fa2b1f507c90cf0be
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 19b6d04a1dc5ae33fa1ede248fd580a4eb95ede6..2b238811b634f449a90ee7cf5d19c2e55343eb10 100644
index 8a16e37c32d29d21b0358f2a9dbe61b962d615a7..a1a73ebbeb0288f7e14280fa277451e046a65c9e 100644
--- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
+++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
@@ -84,6 +84,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
@@ -123,10 +123,10 @@ index 19b6d04a1dc5ae33fa1ede248fd580a4eb95ede6..2b238811b634f449a90ee7cf5d19c2e5
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 97bd9953e14088517a80b44c244f2bacf3b699bb..e67b3126f1082ecd2b6867ae01ab30d4c6ea41c5 100644
index 3791d7d3dee7e84e096763f8b4fb3f8aacca96aa..e24d74982ffd7e338fe3870281b0d3d7b85a7cdf 100644
--- a/third_party/blink/renderer/core/loader/empty_clients.h
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -406,6 +406,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
@@ -410,6 +410,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
void DidCreateScriptContext(v8::Local<v8::Context>,
int32_t world_id) override {}

View File

@@ -7,12 +7,12 @@ Ensure that licenses for the dependencies introduced by Electron
are included in `LICENSES.chromium.html`
diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py
index 71dbd96a807f338752dd45bbb81a4b0e7ff63ca2..659caaf9e1ab93954704b2e5dbe7ddedc11f6a6d 100755
index cc7b17e13c4c8b9e483df9a097b23935ab2e56bc..b89810659dab27dd8150c0b7185ea2b679ab98a4 100755
--- a/tools/licenses/licenses.py
+++ b/tools/licenses/licenses.py
@@ -415,6 +415,31 @@ SPECIAL_CASES = {
@@ -336,6 +336,31 @@ SPECIAL_CASES = {
"License": "Apache 2.0",
"License File": ["//third_party/selenium-atoms/LICENSE.closure"],
"License File": ["//third_party/dawn/third_party/khronos/LICENSE"],
},
+ os.path.join('third_party', 'electron_node'): {
+ "Name": "Node.js",

View File

@@ -8,62 +8,63 @@ decorations in maximized mode where needed, preventing empty space caused
by decoration shadows and rounded titlebars around the window while maximized.
diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc
index ce42101bdec901047af1f97287d83879541ab53e..785382fdc0f47ff31baef16da13eab688be3689d 100644
index 6fe20b867372362b6cdb847b9f3e84d9cabe8c9e..69176dd5d3356b5222caf0f34a3402e3235d657b 100644
--- a/ui/gtk/gtk_ui.cc
+++ b/ui/gtk/gtk_ui.cc
@@ -527,12 +527,13 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
return std::make_unique<gtk::NavButtonProviderGtk>();
@@ -521,11 +521,12 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
}
-ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame) {
+ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame, bool maximized) {
auto& provider =
- solid_frame ? solid_frame_provider_ : transparent_frame_provider_;
- if (!provider) {
- provider = std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame);
- }
+ maximized
+ ? (solid_frame ? solid_maximized_frame_provider_ : transparent_maximized_frame_provider_)
+ : (solid_frame ? solid_frame_provider_ : transparent_frame_provider_);
+ if (!provider)
+ provider = std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame, maximized);
ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame,
- bool tiled) {
- auto& provider = frame_providers_[solid_frame][tiled];
+ bool tiled,
+ bool maximized) {
+ auto& provider = frame_providers_[solid_frame][tiled][maximized];
if (!provider) {
provider =
- std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame, tiled);
+ std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame, tiled, maximized);
}
return provider.get();
}
diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h
index 38c1297588f30cc81d48cfd2321845815bb93ea5..0f4141d2146c38f054b060ddfa06a9f68ee2179c 100644
index 14e24ffcb183531eb9b3d426673b87f6af9b9241..7f3e058431c6dd2e32cd00fa7491d614ec4c48eb 100644
--- a/ui/gtk/gtk_ui.h
+++ b/ui/gtk/gtk_ui.h
@@ -110,7 +110,7 @@ class GtkUi : public ui::LinuxUiAndTheme {
bool PreferDarkTheme() const override;
@@ -111,7 +111,8 @@ class GtkUi : public ui::LinuxUiAndTheme {
void SetDarkTheme(bool dark) override;
std::unique_ptr<ui::NavButtonProvider> CreateNavButtonProvider() override;
- ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override;
+ ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) override;
ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame,
- bool tiled) override;
+ bool tiled,
+ bool maximized) override;
private:
using TintMap = std::map<int, color_utils::HSL>;
@@ -203,6 +203,8 @@ class GtkUi : public ui::LinuxUiAndTheme {
// while Chrome is running.
std::unique_ptr<ui::WindowFrameProvider> solid_frame_provider_;
std::unique_ptr<ui::WindowFrameProvider> transparent_frame_provider_;
+ std::unique_ptr<ui::WindowFrameProvider> solid_maximized_frame_provider_;
+ std::unique_ptr<ui::WindowFrameProvider> transparent_maximized_frame_provider_;
@@ -204,7 +205,7 @@ class GtkUi : public ui::LinuxUiAndTheme {
// while Chrome is running. This 2D array is indexed first by whether the
// frame is translucent (0) or solid(1), then by whether the frame is normal
// (0) or tiled (1).
- std::unique_ptr<ui::WindowFrameProvider> frame_providers_[2][2];
+ std::unique_ptr<ui::WindowFrameProvider> frame_providers_[2][2][2];
// Objects to notify when the window frame button order changes.
base::ObserverList<ui::WindowButtonOrderObserver>::Unchecked
diff --git a/ui/gtk/window_frame_provider_gtk.cc b/ui/gtk/window_frame_provider_gtk.cc
index 1f4eeebe54780a4927104d7cdaa4f7cfae6e7d2a..64d243287a367ff4201efebeda95f553c33f5d9b 100644
index 794efdb773422ddc12ccbe013a13aadeb980b487..a60bbd76141f06202343c68e78688a95179b0083 100644
--- a/ui/gtk/window_frame_provider_gtk.cc
+++ b/ui/gtk/window_frame_provider_gtk.cc
@@ -39,17 +39,20 @@ std::string GetThemeName() {
return theme_string;
}
@@ -30,20 +30,23 @@ constexpr int kMaxFrameSizeDip = 64;
// will get an incorrect hint as to which pixels are fully opaque.
constexpr int kMaxCornerRadiusDip = 32;
-GtkCssContext WindowContext(bool solid_frame, bool focused) {
+GtkCssContext WindowContext(bool solid_frame, bool maximized, bool focused) {
-GtkCssContext WindowContext(bool solid_frame, bool tiled, bool focused) {
+GtkCssContext WindowContext(bool solid_frame, bool tiled, bool maximized, bool focused) {
std::string selector = "window.background.";
selector += solid_frame ? "solid-csd" : "csd";
if (tiled) {
selector += ".tiled";
}
+ if (maximized) {
+ selector += ".maximized";
+ }
@@ -73,141 +74,143 @@ index 1f4eeebe54780a4927104d7cdaa4f7cfae6e7d2a..64d243287a367ff4201efebeda95f553
return AppendCssNodeToStyleContext({}, selector);
}
-GtkCssContext DecorationContext(bool solid_frame, bool focused) {
- auto context = WindowContext(solid_frame, focused);
+GtkCssContext DecorationContext(bool solid_frame, bool maximized, bool focused) {
+ auto context = WindowContext(solid_frame, maximized, focused);
-GtkCssContext DecorationContext(bool solid_frame, bool tiled, bool focused) {
- auto context = WindowContext(solid_frame, tiled, focused);
+GtkCssContext DecorationContext(bool solid_frame, bool tiled, bool maximized, bool focused) {
+ auto context = WindowContext(solid_frame, tiled, maximized, focused);
// GTK4 renders the decoration directly on the window.
if (!GtkCheckVersion(4)) {
context = AppendCssNodeToStyleContext(context, "decoration");
@@ -68,8 +71,8 @@ GtkCssContext DecorationContext(bool solid_frame, bool focused) {
@@ -62,8 +65,8 @@ GtkCssContext DecorationContext(bool solid_frame, bool tiled, bool focused) {
return context;
}
-GtkCssContext HeaderContext(bool solid_frame, bool focused) {
- auto context = WindowContext(solid_frame, focused);
+GtkCssContext HeaderContext(bool solid_frame, bool maximized, bool focused) {
+ auto context = WindowContext(solid_frame, maximized, focused);
-GtkCssContext HeaderContext(bool solid_frame, bool tiled, bool focused) {
- auto context = WindowContext(solid_frame, tiled, focused);
+GtkCssContext HeaderContext(bool solid_frame, bool tiled, bool maximized, bool focused) {
+ auto context = WindowContext(solid_frame, tiled, maximized, focused);
context =
AppendCssNodeToStyleContext(context, "headerbar.header-bar.titlebar");
if (!focused) {
@@ -125,8 +128,8 @@ int ComputeTopCornerRadius() {
@@ -120,8 +123,8 @@ int ComputeTopCornerRadius() {
// need to experimentally determine the corner radius by rendering a sample.
// Additionally, in GTK4, the headerbar corners get clipped by the window
// rather than the headerbar having its own rounded corners.
- auto context = GtkCheckVersion(4) ? DecorationContext(false, false)
- : HeaderContext(false, false);
+ auto context = GtkCheckVersion(4) ? DecorationContext(false, false, false)
+ : HeaderContext(false, false, false);
- auto context = GtkCheckVersion(4) ? DecorationContext(false, false, false)
- : HeaderContext(false, false, false);
+ auto context = GtkCheckVersion(4) ? DecorationContext(false, false, false, false)
+ : HeaderContext(false, false, false, false);
ApplyCssToContext(context, R"(window, headerbar {
background-image: none;
background-color: black;
@@ -159,7 +162,7 @@ int ComputeTopCornerRadius() {
@@ -155,7 +158,7 @@ int ComputeTopCornerRadius() {
bool HeaderIsTranslucent() {
// The arbitrary square size to render a sample header.
constexpr int kHeaderSize = 32;
- auto context = HeaderContext(false, false);
+ auto context = HeaderContext(false, false, false);
- auto context = HeaderContext(false, false, false);
+ auto context = HeaderContext(false, false, false, false);
double opacity = GetOpacityFromContext(context);
if (opacity < 1.0) {
return true;
@@ -216,8 +219,8 @@ void WindowFrameProviderGtk::Asset::CloneFrom(
@@ -206,8 +209,8 @@ void WindowFrameProviderGtk::Asset::CloneFrom(
unfocused_bitmap = src.unfocused_bitmap;
}
-WindowFrameProviderGtk::WindowFrameProviderGtk(bool solid_frame)
- : solid_frame_(solid_frame) {}
+WindowFrameProviderGtk::WindowFrameProviderGtk(bool solid_frame, bool maximized)
+ : solid_frame_(solid_frame), maximized_(maximized) {}
-WindowFrameProviderGtk::WindowFrameProviderGtk(bool solid_frame, bool tiled)
- : solid_frame_(solid_frame), tiled_(tiled) {
+WindowFrameProviderGtk::WindowFrameProviderGtk(bool solid_frame, bool tiled, bool maximized)
+ : solid_frame_(solid_frame), tiled_(tiled), maximized_(maximized) {
GtkSettings* settings = gtk_settings_get_default();
// Unretained() is safe since WindowFrameProviderGtk will own the signals.
auto callback = base::BindRepeating(&WindowFrameProviderGtk::OnThemeChanged,
@@ -325,7 +328,7 @@ void WindowFrameProviderGtk::PaintWindowFrame(gfx::Canvas* canvas,
WindowFrameProviderGtk::~WindowFrameProviderGtk() = default;
@@ -325,7 +328,7 @@ void WindowFrameProviderGtk::PaintWindowFrame(
top_area_height_dip * scale - effective_frame_thickness_px.top();
auto header = PaintHeaderbar({client_bounds_px.width(), top_area_height_px},
- HeaderContext(solid_frame_, focused), scale);
+ HeaderContext(solid_frame_, maximized_, focused), scale);
auto header =
PaintHeaderbar({client_bounds_px.width(), top_area_height_px},
- HeaderContext(solid_frame_, tiled_, focused), scale);
+ HeaderContext(solid_frame_, tiled_, maximized_, focused), scale);
image = gfx::ImageSkia::CreateFrom1xBitmap(header);
// In GTK4, the headerbar gets clipped by the window.
if (GtkCheckVersion(4)) {
@@ -358,7 +361,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
@@ -352,7 +355,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
gfx::Rect frame_bounds_dip(kMaxFrameSizeDip, kMaxFrameSizeDip,
2 * kMaxFrameSizeDip, 2 * kMaxFrameSizeDip);
- auto focused_context = DecorationContext(solid_frame_, true);
+ auto focused_context = DecorationContext(solid_frame_, maximized_, true);
- auto focused_context = DecorationContext(solid_frame_, tiled_, true);
+ auto focused_context = DecorationContext(solid_frame_, tiled_, maximized_, true);
frame_bounds_dip.Inset(-GtkStyleContextGetPadding(focused_context));
frame_bounds_dip.Inset(-GtkStyleContextGetBorder(focused_context));
gfx::Size bitmap_size(BitmapSizePx(asset), BitmapSizePx(asset));
@@ -366,7 +369,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
PaintBitmap(bitmap_size, frame_bounds_dip, focused_context, scale);
@@ -360,7 +363,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
focused_context, scale);
asset.unfocused_bitmap =
PaintBitmap(bitmap_size, frame_bounds_dip,
- DecorationContext(solid_frame_, false), scale);
+ DecorationContext(solid_frame_, maximized_, false), scale);
PaintBitmap(bitmap_size, gfx::RectF(frame_bounds_dip),
- DecorationContext(solid_frame_, tiled_, false), scale);
+ DecorationContext(solid_frame_, tiled_, maximized_, false), scale);
// In GTK4, there's no way to obtain the frame thickness from CSS values
// directly, so we must determine it experimentally based on the drawn
diff --git a/ui/gtk/window_frame_provider_gtk.h b/ui/gtk/window_frame_provider_gtk.h
index 32c3d63ae4598339965c58443a8c2d12b99fb89a..91496d957b8291cd37948e237a1cc4bf605848b0 100644
index 91236ec07c01ca14248b997577ae887c0c396cd2..d70639d2ba40e325bbbbf6117741c13354984ed5 100644
--- a/ui/gtk/window_frame_provider_gtk.h
+++ b/ui/gtk/window_frame_provider_gtk.h
@@ -14,7 +14,7 @@ namespace gtk {
@@ -18,7 +18,7 @@ namespace gtk {
class WindowFrameProviderGtk : public ui::WindowFrameProvider {
public:
- explicit WindowFrameProviderGtk(bool solid_frame);
+ explicit WindowFrameProviderGtk(bool solid_frame, bool maximized);
- WindowFrameProviderGtk(bool solid_frame, bool tiled);
+ WindowFrameProviderGtk(bool solid_frame, bool tiled, bool maximized);
WindowFrameProviderGtk(const WindowFrameProviderGtk&) = delete;
WindowFrameProviderGtk& operator=(const WindowFrameProviderGtk&) = delete;
@@ -72,6 +72,9 @@ class WindowFrameProviderGtk : public ui::WindowFrameProvider {
// Cached bitmaps and metrics. The scale is rounded to percent.
base::flat_map<int, Asset> assets_;
+
@@ -70,6 +70,8 @@ class WindowFrameProviderGtk : public ui::WindowFrameProvider {
// Input parameters used for drawing.
const bool solid_frame_;
const bool tiled_;
+ // Whether to draw the window decorations as maximized.
+ bool maximized_;
};
+ const bool maximized_;
} // namespace gtk
// Scale-independent metric calculated based on the bitmaps.
gfx::Insets frame_thickness_dip_;
diff --git a/ui/linux/fallback_linux_ui.cc b/ui/linux/fallback_linux_ui.cc
index 2b67f6ebcae4f0495b73c750e73250921fa0ac04..796b44df8c8b9a63ba97e28f14e457d724c8ae50 100644
index 3e8f30a90b8623dd00b882fb4dd1467d1a91689e..711b646621ba0bdabd15aef8929bdf48e0e52f88 100644
--- a/ui/linux/fallback_linux_ui.cc
+++ b/ui/linux/fallback_linux_ui.cc
@@ -135,7 +135,7 @@ FallbackLinuxUi::CreateNavButtonProvider() {
}
@@ -136,7 +136,8 @@ FallbackLinuxUi::CreateNavButtonProvider() {
ui::WindowFrameProvider* FallbackLinuxUi::GetWindowFrameProvider(
- bool solid_frame) {
+ bool solid_frame, bool maximized) {
bool solid_frame,
- bool tiled) {
+ bool tiled,
+ bool maximized) {
return nullptr;
}
diff --git a/ui/linux/fallback_linux_ui.h b/ui/linux/fallback_linux_ui.h
index 9a6a5a7f21c318d3009df1766a7789f9c7597339..9454e8f8e622a5b92f980fdf6c1f68d6c4795cf7 100644
index 1de7b4a16637b2d719f0162f43af48dfc9af5d6a..61a75cd3e3226e115bbcd5b7837d3e2d9c1e8d65 100644
--- a/ui/linux/fallback_linux_ui.h
+++ b/ui/linux/fallback_linux_ui.h
@@ -68,7 +68,7 @@ class FallbackLinuxUi : public LinuxUiAndTheme {
bool PreferDarkTheme() const override;
@@ -69,7 +69,8 @@ class FallbackLinuxUi : public LinuxUiAndTheme {
void SetDarkTheme(bool dark) override;
std::unique_ptr<ui::NavButtonProvider> CreateNavButtonProvider() override;
- ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override;
+ ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) override;
ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame,
- bool tiled) override;
+ bool tiled,
+ bool maximized) override;
private:
std::string default_font_family_;
diff --git a/ui/linux/linux_ui.h b/ui/linux/linux_ui.h
index 9cc65cf5713464e5964e9aa2109c281055e5b70f..014d1145e44e5e9420846476d4349070c78852d0 100644
index 69f678a91012f92351a9d487700316d432248e53..b43f2c977091ed2de695ea0fc1707d5ba4afe092 100644
--- a/ui/linux/linux_ui.h
+++ b/ui/linux/linux_ui.h
@@ -316,7 +316,7 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUiTheme {
// if transparency is unsupported and the frame should be rendered opaque.
@@ -317,7 +317,8 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUiTheme {
// The returned object is not owned by the caller and will remain alive until
// the process ends.
- virtual WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) = 0;
+ virtual WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) = 0;
virtual WindowFrameProvider* GetWindowFrameProvider(bool solid_frame,
- bool tiled) = 0;
+ bool tiled,
+ bool maximized) = 0;
protected:
LinuxUiTheme();

View File

@@ -8,7 +8,7 @@ was removed as part of the Raw Clipboard API scrubbing.
https://bugs.chromium.org/p/chromium/issues/detail?id=1217643
diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc
index e27df1c5b234490a2679fc3428e59b92970f1ec0..54a0be1dde7d059f5102ead4a77b828eff1eeadb 100644
index 5f28fee3f6d5e25a318e352f237cea2666671845..9bd5250012249ef0ac7b4013b448acc747dc9736 100644
--- a/ui/base/clipboard/scoped_clipboard_writer.cc
+++ b/ui/base/clipboard/scoped_clipboard_writer.cc
@@ -239,6 +239,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting(

View File

@@ -30,7 +30,7 @@ index 23b17b4a46a31cb005e36bb1bbadba6cc3ea6b3c..b86862dcf5232fc6971293fe2c9f17c9
} // namespace blink
diff --git a/third_party/blink/renderer/core/exported/web_message_port_converter.cc b/third_party/blink/renderer/core/exported/web_message_port_converter.cc
index 6a6cb3d4ef0e454d18cf47cd971240d0dabea9fb..10ea1b43e5caa7c6c0f6c9ff5182a712ca422f9b 100644
index 6a6cb3d4ef0e454d18cf47cd971240d0dabea9fb..bd90d018d5c3e33a41b17b1d015ac25d340f8666 100644
--- a/third_party/blink/renderer/core/exported/web_message_port_converter.cc
+++ b/third_party/blink/renderer/core/exported/web_message_port_converter.cc
@@ -6,6 +6,7 @@
@@ -53,7 +53,7 @@ index 6a6cb3d4ef0e454d18cf47cd971240d0dabea9fb..10ea1b43e5caa7c6c0f6c9ff5182a712
+ CHECK(execution_context);
+ auto* port = MakeGarbageCollected<MessagePort>(*execution_context);
+ port->Entangle(std::move(port_channel));
+ return ToV8(port, context->Global(), context->GetIsolate());
+ return port->ToV8(context->GetIsolate(), context->Global());
+}
+
} // namespace blink

View File

@@ -6,7 +6,7 @@ Subject: allow disabling blink scheduler throttling per RenderView
This allows us to disable throttling for hidden windows.
diff --git a/content/browser/renderer_host/navigation_controller_impl_unittest.cc b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
index ed1cd91f4ec979f5a194a110ce9fc6ae3459cd09..812534c3834094f762b81daea204c85eea89e235 100644
index c32059af794851fdea8aae15157f05acdcc60e0a..92340d0aa8d893fc781ed59cc4aa51b5543de6d9 100644
--- a/content/browser/renderer_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/renderer_host/navigation_controller_impl_unittest.cc
@@ -163,6 +163,12 @@ class MockPageBroadcast : public blink::mojom::PageBroadcast {
@@ -23,10 +23,10 @@ index ed1cd91f4ec979f5a194a110ce9fc6ae3459cd09..812534c3834094f762b81daea204c85e
return receiver_.BindNewEndpointAndPassDedicatedRemote();
}
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index 401a00dba286c3c7a45bbcdd69f32fc21eb2daf7..9f6d393c9a7c7ce8d9d1049c2259f8837ab8371e 100644
index caa732b8f72d30b5dd87c40d02039d79dbf4b413..a760db11ecb79534345fe78ae83bc6bda977db9e 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -713,6 +713,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -712,6 +712,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
}
@@ -39,7 +39,7 @@ index 401a00dba286c3c7a45bbcdd69f32fc21eb2daf7..9f6d393c9a7c7ce8d9d1049c2259f883
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 afd5368ffd7c7ef5db6e30b7468554d8ec07c77a..1b0c498edd71987f004bc20e9d7957cca6526edd 100644
index a94977d7a76ae9952bbba0efe59a7cb5021a1c84..11c4f890eaeae1329ca5a6634a698aef7a288fb4 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -139,6 +139,7 @@ class CONTENT_EXPORT RenderViewHostImpl
@@ -51,10 +51,10 @@ index afd5368ffd7c7ef5db6e30b7468554d8ec07c77a..1b0c498edd71987f004bc20e9d7957cc
void SendRendererPreferencesToRenderer(
const blink::RendererPreferences& preferences);
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index f14a7c55f6db46d9684639fcac3a203af792d65a..8cb43ab350c24d8193ccdbf3f2596d926ff552b1 100644
index d78f00cbb877b64892b9871252d79796fd4cabb8..4d2de00328f0b6437789612b14a53aae79eb15ab 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -564,8 +564,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
@@ -559,8 +559,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
// OnShowWithPageVisibility will not call NotifyHostAndDelegateOnWasShown,
// which updates `visibility_`, unless the host is hidden. Make sure no update
// is needed.
@@ -80,7 +80,7 @@ index 9979c25ecd57e68331b628a518368635db5c2027..f65bfbbb663a5bb0511ffa389d3163e0
// This interface should only be implemented inside content.
friend class RenderViewHostImpl;
diff --git a/content/test/test_page_broadcast.h b/content/test/test_page_broadcast.h
index cb660e85d7ed08496483bc7b857b5f273efb94d3..2f9b3937106c1927b38bc43a641fa982044874d3 100644
index 603798ae0d45836f1bf3e6608761ce1467303310..2d8caa06e418f123d7565b96d40c66fb51617a6d 100644
--- a/content/test/test_page_broadcast.h
+++ b/content/test/test_page_broadcast.h
@@ -50,6 +50,7 @@ class TestPageBroadcast : public blink::mojom::PageBroadcast {
@@ -104,7 +104,7 @@ index ed73a6fe6d146eac904f0aa0d88facf055df503e..4bbc792068db75739a7ceb8ad01c85f9
+ SetSchedulerThrottling(bool allowed);
};
diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
index 6219eadefa976145469ec8be2fd312af1a955c7a..fdb76579679e1f4c5f43b934d4edaa2c6e32d43a 100644
index 2ba868f0efb2ee082d452bb011409f1b4c5c5e1e..6caab2df3cfc367c63839b7ac635d8d072ef8a57 100644
--- a/third_party/blink/public/web/web_view.h
+++ b/third_party/blink/public/web/web_view.h
@@ -378,6 +378,7 @@ class BLINK_EXPORT WebView {
@@ -116,7 +116,7 @@ index 6219eadefa976145469ec8be2fd312af1a955c7a..fdb76579679e1f4c5f43b934d4edaa2c
// 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 adb1c7ca2fcdf69d991f1355057adbd172c3989c..64228ce3fb2134b28ac153a6088c26049c6f203c 100644
index aafdfd4fffd0bf18a1444202e9f92f63bd458997..1b1628b5ba7b6920e149f881e8d5086ac9be0132 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -2421,6 +2421,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(
@@ -130,7 +130,7 @@ index adb1c7ca2fcdf69d991f1355057adbd172c3989c..64228ce3fb2134b28ac153a6088c2604
bool storing_in_bfcache = new_state->is_in_back_forward_cache &&
!old_state->is_in_back_forward_cache;
bool restoring_from_bfcache = !new_state->is_in_back_forward_cache &&
@@ -3904,10 +3908,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
@@ -3912,10 +3916,23 @@ PageScheduler* WebViewImpl::Scheduler() const {
return GetPage()->GetPageScheduler();
}
@@ -155,10 +155,10 @@ index adb1c7ca2fcdf69d991f1355057adbd172c3989c..64228ce3fb2134b28ac153a6088c2604
// Do not throttle if the page should be painting.
bool is_visible =
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 5a9992141dbbf6955beeb295145044a66fcaf754..42d57fd374ed307b5640dc57ed78d588e5ee5c65 100644
index 25566d1e5a3671c698e7352bc7600005a8bfcf3c..8dfb3b5b9026df92e28271258870c9eb588a6526 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -452,6 +452,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -453,6 +453,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
LocalDOMWindow* PagePopupWindow() const;
PageScheduler* Scheduler() const override;
@@ -166,7 +166,7 @@ index 5a9992141dbbf6955beeb295145044a66fcaf754..42d57fd374ed307b5640dc57ed78d588
void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
bool is_initial_state) override;
mojom::blink::PageVisibilityState GetVisibilityState() override;
@@ -917,6 +918,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
@@ -927,6 +928,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,7 +8,7 @@ WebPreferences of in-process child windows, rather than relying on
process-level command line switches, as before.
diff --git a/third_party/blink/common/web_preferences/web_preferences.cc b/third_party/blink/common/web_preferences/web_preferences.cc
index fa46daef1d7da536c434d41475d25ed8f8f933c6..37ae01f45d768afa4bfa538307cf2f08ba14b906 100644
index 2afa734a8f0d500f2dedf6db5703f1167669f566..33a013252d4de19206a92b2762329b7ca1514e87 100644
--- a/third_party/blink/common/web_preferences/web_preferences.cc
+++ b/third_party/blink/common/web_preferences/web_preferences.cc
@@ -144,6 +144,19 @@ WebPreferences::WebPreferences()
@@ -32,7 +32,7 @@ index fa46daef1d7da536c434d41475d25ed8f8f933c6..37ae01f45d768afa4bfa538307cf2f08
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 bd5d2f9ba30d847a44e70c1173eb49a5d3f4b6bb..3ef312b2e84427ec1bcc738e88d6425255a96b20 100644
index 9909d43a76d8bf5bd8e9b3523fe5be5f8740ad54..69bc9db9304547b272393727432f81d3510dd9cd 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
@@ -148,6 +148,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
@@ -56,7 +56,7 @@ index bd5d2f9ba30d847a44e70c1173eb49a5d3f4b6bb..3ef312b2e84427ec1bcc738e88d64252
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 65cf8211005546a8c527a679306e5ad6617cc046..0c08e298107d1aa0d0809691a98dd12b2c0aeb5a 100644
index 48134e1dd50c297ed987e4f8068612c420f038a3..a7902ae02436fe820feeb01a73ccd0a3e9b00946 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 @@
@@ -88,7 +88,7 @@ index 65cf8211005546a8c527a679306e5ad6617cc046..0c08e298107d1aa0d0809691a98dd12b
// This flags corresponds to a Page's Settings' setCookieEnabled state. It
// only controls whether or not the "document.cookie" field is properly
diff --git a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
index c5cf0543740b47c12b0cd211a64152d8abee1d21..c1ffebd09f2547454bd1551cf5fc576dd384fac2 100644
index 07d93df1824f4fb8d9b415f4cc1d6152d7f14355..c4fa257d9cbbe84065b8f092a78a91f52d64484e 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 @@
@@ -153,7 +153,7 @@ index c5cf0543740b47c12b0cd211a64152d8abee1d21..c1ffebd09f2547454bd1551cf5fc576d
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 d03fc2e4ccef645e31bab838dabf76ade7a35de8..ca35e4d6cf8fc49b8275a4b49bc4da8019282c3d 100644
index e7c11ab3f46a12b860340f30dc09508c9e1af78b..e883537595b8b924faf121a4ce6866a4dc8b9567 100644
--- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
+++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
@@ -9,6 +9,7 @@ import "third_party/blink/public/mojom/css/preferred_contrast.mojom";

View File

@@ -6,7 +6,7 @@ Subject: allow new privileges in unsandboxed child processes
This allows unsandboxed child process to launch setuid processes on Linux.
diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc
index 321faab043958d4be412f7b1f50931d0d9d42886..94d18b775d432cfeeb4d2db6091adda179dc6e6b 100644
index e21cd3f9c447d67299c034e2b9f212f251c5deca..795ad47165f2f02e816f424ce74391a435c61a32 100644
--- a/content/browser/child_process_launcher_helper_linux.cc
+++ b/content/browser/child_process_launcher_helper_linux.cc
@@ -63,6 +63,15 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(

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 30afdfc488f608851dd382d01aa5221c26d18180..e3a0540c933fc76a8f8717aca8e39f49d52ec033 100644
index ffafdacb3e0171f81d22fa1736012b92e9df2ba9..dad79e82221c15b887cfde9a35ff7447989da62a 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(
@@ -33,7 +33,7 @@ index 30afdfc488f608851dd382d01aa5221c26d18180..e3a0540c933fc76a8f8717aca8e39f49
void SimpleMenuModel::SetMinorText(size_t index,
const std::u16string& minor_text) {
items_[ValidateItemIndex(index)].minor_text = minor_text;
@@ -422,6 +432,12 @@ std::u16string SimpleMenuModel::GetLabelAt(size_t index) const {
@@ -428,6 +438,12 @@ std::u16string SimpleMenuModel::GetLabelAt(size_t index) const {
return items_[ValidateItemIndex(index)].label;
}
@@ -47,10 +47,10 @@ index 30afdfc488f608851dd382d01aa5221c26d18180..e3a0540c933fc76a8f8717aca8e39f49
return items_[ValidateItemIndex(index)].minor_text;
}
diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
index c17c0242f07da0d66272691704c925147642a326..796635cd604c7ea831d98b2f07382a659588ab58 100644
index 1539464b1942db2a5e493022109a1c8dc247dc5a..b3979cbccf8eb2f0145e050e11ecbb6303c38d46 100644
--- a/ui/base/models/simple_menu_model.h
+++ b/ui/base/models/simple_menu_model.h
@@ -54,6 +54,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -55,6 +55,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
// Some command ids have labels and icons that change over time.
virtual bool IsItemForCommandIdDynamic(int command_id) const;
virtual std::u16string GetLabelForCommandId(int command_id) const;
@@ -58,7 +58,7 @@ index c17c0242f07da0d66272691704c925147642a326..796635cd604c7ea831d98b2f07382a65
// Gets the icon for the item with the specified id.
virtual ImageModel GetIconForCommandId(int command_id) const;
@@ -173,6 +174,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -174,6 +175,9 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
// Sets the label for the item at |index|.
void SetLabel(size_t index, const std::u16string& label);
@@ -68,7 +68,7 @@ index c17c0242f07da0d66272691704c925147642a326..796635cd604c7ea831d98b2f07382a65
// Sets the minor text for the item at |index|.
void SetMinorText(size_t index, const std::u16string& minor_text);
@@ -211,6 +215,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -216,6 +220,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
ui::MenuSeparatorType GetSeparatorTypeAt(size_t index) const override;
int GetCommandIdAt(size_t index) const override;
std::u16string GetLabelAt(size_t index) const override;
@@ -76,7 +76,7 @@ index c17c0242f07da0d66272691704c925147642a326..796635cd604c7ea831d98b2f07382a65
std::u16string GetMinorTextAt(size_t index) const override;
ImageModel GetMinorIconAt(size_t index) const override;
bool IsItemDynamicAt(size_t index) const override;
@@ -250,6 +255,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -255,6 +260,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
int command_id = 0;
ItemType type = TYPE_COMMAND;
std::u16string label;

View File

@@ -49,10 +49,10 @@ index a1732d9bf9267e52a74350483fa946b5a0a0662b..25d36b301309ac9f8c1a4d75545fa741
// 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 5987aaa537ea37ef6c1145b606d5aee5b5511c0a..3d564401f00f9b65ea232470602d5215caf0d94f 100644
index 7585e65fabd7374309bdf165830038305ea5a538..c7547b2e7bae19db54635834a52116ec654629d6 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -674,10 +674,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -672,10 +672,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
}
DCHECK(!view_ || !view_->IsAttached());
@@ -63,7 +63,7 @@ index 5987aaa537ea37ef6c1145b606d5aee5b5511c0a..3d564401f00f9b65ea232470602d5215
if (!Client())
return false;
@@ -725,6 +721,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
@@ -723,6 +719,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
DCHECK(!view_->IsAttached());
Client()->WillBeDetached();

View File

@@ -6,7 +6,7 @@ Subject: boringssl BUILD.gn
Build BoringSSL with some extra functions that nodejs needs.
diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn
index bd3979751ce110a3086625efb743362293bb0006..f888810423c8a42a9811efdff295f90b130bfee1 100644
index e342a39e8d4a8d178baf90bfe0b355d08b51f776..a820b342e553d58b1967c0deefdf1b6ae333babd 100644
--- a/third_party/boringssl/BUILD.gn
+++ b/third_party/boringssl/BUILD.gn
@@ -56,6 +56,21 @@ config("no_asm_config") {

View File

@@ -8,14 +8,13 @@ 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 85e831614b7f02c6a8537b4a67968bff8ca0c6e0..2394926bacf2e02716facd5ed8458e4ebfc449a1 100644
index f82e41ee24e1dad66fc983492b3bc6461d6a254c..5abab1e18398118ac928d60df302f9f545d27b9f 100644
--- a/base/trace_event/builtin_categories.h
+++ b/base/trace_event/builtin_categories.h
@@ -82,6 +82,8 @@
@@ -82,6 +82,7 @@
X("drm") \
X("drmcursor") \
X("dwrite") \
+ X("DXVA_Decoding") \
+ X("electron") \
X("evdev") \
X("event") \

View File

@@ -6,7 +6,7 @@ Subject: build: allow electron to use exec_script
This is similar to the //build usecase so we're OK adding ourselves here
diff --git a/.gn b/.gn
index 321877844bd21408fef009159dea6cf84c25d260..1dbf8b70c3ef4a567691268034f58787e3ac0192 100644
index afe0b3e90fafb9413cc49198cf3ad5d66d433b54..a8d83d6c95ebda9a898a383a8a1581d75da09f2e 100644
--- a/.gn
+++ b/.gn
@@ -167,4 +167,6 @@ exec_script_whitelist =

View File

@@ -11,16 +11,16 @@ 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 cc22e9c43562086396509548a4fe7e2f0ae22f80..705b0e067d8b702a5306334ae9d68eef2c11106d 100644
index d09e7aeb788550e7ecefb4b9c177dd26ecc5ad4c..c894dc421f55a94e541d00e05e2f05bfec907ab1 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -200,11 +200,16 @@ if (!is_android && !is_mac) {
@@ -195,11 +195,16 @@ if (!is_android && !is_mac && !is_fuchsia) {
"common/crash_keys.h",
]
+ if (!is_electron_build) {
+ deps = [
+ ":packed_resources_integrity",
+ ":packed_resources_integrity_header",
+ ]
+ }
+
@@ -28,62 +28,62 @@ index cc22e9c43562086396509548a4fe7e2f0ae22f80..705b0e067d8b702a5306334ae9d68eef
":chrome_dll",
":chrome_exe_version",
":copy_first_run",
- ":packed_resources_integrity",
- ":packed_resources_integrity_header",
":visual_elements_resources",
"//base",
"//build:branding_buildflags",
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 8704f445741b416c7763d53440cb410bd72d0fc4..a708ee20c84ee2cb667bcae5fc493803b3f044b7 100644
index 81dceec0b449c6fa90984f0bede8d3b94a93910a..32e5194b60f7db1d076e2ba3a884cce4e3133b02 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -4811,7 +4811,7 @@ static_library("browser") {
@@ -4755,7 +4755,7 @@ static_library("browser") {
# On Windows, the hashes are embedded in //chrome:chrome_initial rather
# than here in :chrome_dll.
- if (!is_win) {
+ if (!is_win && !is_electron_build) {
deps += [ "//chrome:packed_resources_integrity" ]
deps += [ "//chrome:packed_resources_integrity_header" ]
sources += [ "certificate_viewer_stub.cc" ]
}
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index cd439e952c39a02d326f114acf7da18eac404692..540ef46a5d7708d0385dd57c8e68579e52fb32d8 100644
index 005e321b191e69422c892c2001ffc98f9e198d14..e02717f068247e0c971e19374b8c2d2d0809fc5b 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -7156,7 +7156,6 @@ test("unit_tests") {
@@ -7220,7 +7220,6 @@ if (!is_fuchsia) {
deps += [
"//chrome:other_version",
- "//chrome:packed_resources_integrity",
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -7177,6 +7176,10 @@ test("unit_tests") {
"//ui/resources",
]
deps += [
"//chrome:other_version",
- "//chrome:packed_resources_integrity_header",
"//chrome//services/util_win:unit_tests",
"//chrome/app:chrome_dll_resources",
"//chrome/app:win_unit_tests",
@@ -7241,6 +7240,10 @@ if (!is_fuchsia) {
"//ui/resources",
]
+ if (!is_electron_build) {
+ deps += [ "//chrome:packed_resources_integrity" ]
+ }
+ if (!is_electron_build) {
+ deps += [ "//chrome:packed_resources_integrity_header" ]
+ }
+
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -8193,7 +8196,6 @@ test("unit_tests") {
}
ldflags = [
"/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
"/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
@@ -8259,7 +8262,6 @@ if (!is_fuchsia) {
}
deps += [
- "//chrome:packed_resources_integrity_hash",
"//chrome/browser/apps:icon_standardizer",
"//chrome/browser/apps/app_service",
"//chrome/browser/apps/app_service:app_registry_cache_waiter",
@@ -8285,6 +8287,10 @@ test("unit_tests") {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]
deps += [
- "//chrome:packed_resources_integrity_header",
"//chrome/browser/apps:icon_standardizer",
"//chrome/browser/apps/app_service",
"//chrome/browser/apps/app_service:app_registry_cache_waiter",
@@ -8352,6 +8354,10 @@ if (!is_fuchsia) {
"//ui/webui/resources/js/browser_command:mojo_bindings",
]
+ if (!is_electron_build) {
+ deps += [ "//chrome:packed_resources_integrity_hash" ]
+ }
+ if (!is_electron_build) {
+ deps += [ "//chrome:packed_resources_integrity_header" ]
+ }
+
data += [ "//ash/components/arc/test/data/icons/" ]
data += [ "//ash/components/arc/test/data/icons/" ]
if (include_js2gtest_tests && is_chromeos_ash) {
if (include_js2gtest_tests && is_chromeos_ash) {

View File

@@ -7,10 +7,10 @@ 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 d17711b23ea067e7a6a722b4af47210b48082076..1853ae383c34981d861ad6b28da1ff06e641d977 100644
index 70d0876e5a5351b81005a3cf5ffd7f7d3143db2e..a7a39d74d311797263fe25a8df295dc6178fdc7a 100644
--- a/buildtools/third_party/libc++/BUILD.gn
+++ b/buildtools/third_party/libc++/BUILD.gn
@@ -44,7 +44,11 @@ config("winver") {
@@ -45,7 +45,11 @@ config("winver") {
if (libcxx_is_shared) {
_libcxx_target_type = "shared_library"
} else {
@@ -23,7 +23,7 @@ index d17711b23ea067e7a6a722b4af47210b48082076..1853ae383c34981d861ad6b28da1ff06
}
target(_libcxx_target_type, "libc++") {
# Most things that need to depend on libc++ should do so via the implicit
@@ -52,6 +56,7 @@ target(_libcxx_target_type, "libc++") {
@@ -53,6 +57,7 @@ target(_libcxx_target_type, "libc++") {
# need to explicitly depend on libc++.
visibility = [
"//build/config:common_deps",

View File

@@ -6,7 +6,7 @@ Subject: build: make libcxx_abi_unstable false for electron
https://nornagon.medium.com/a-libc-odyssey-973e51649063
diff --git a/buildtools/third_party/libc++/__config_site b/buildtools/third_party/libc++/__config_site
index 862591058bacf2b526482c17eb84b204d1960422..6bce7ab7e33c602b8f733a3f39e6bdd778697b10 100644
index 1ae42c3a02cf5929b358a6fff3dd523fc24f444e..cc81747b1ad34e3d0b29f45d275be829dd3503ff 100644
--- a/buildtools/third_party/libc++/__config_site
+++ b/buildtools/third_party/libc++/__config_site
@@ -12,7 +12,6 @@

View File

@@ -9,10 +9,10 @@ This patch can be removed when we decide how we want to handle
enterprise content analysis.
diff --git a/components/enterprise/buildflags/buildflags.gni b/components/enterprise/buildflags/buildflags.gni
index 90658d1d090b5edd15339a7ca0f9ba4c0a341891..7d38d08c8ff51854deca9614176ec40dc50ad076 100644
index cbfe3299d44d0f34ebd1459f61707172753874f3..1ff8921df54e32396225f52d001bbf85c703a5cd 100644
--- a/components/enterprise/buildflags/buildflags.gni
+++ b/components/enterprise/buildflags/buildflags.gni
@@ -34,4 +34,4 @@ declare_args() {
@@ -41,4 +41,4 @@ declare_args() {
# These two flags are equivalent, but `enable_print_content_analysis` still
# needs to exist separately as it lives under //printing which cannot depend
# on //components.

View File

@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Thu, 28 Dec 2023 17:09:08 +1300
Subject: build: run reclient cfg generator after chrome
We can't run our generator after chromes in gclient hooks so instead we patch
their generator to run ours immediately after.
This can't be upstreamed though may be replaceable later with some upstream refactors
around reclient config generation.
diff --git a/buildtools/reclient_cfgs/configure_reclient_cfgs.py b/buildtools/reclient_cfgs/configure_reclient_cfgs.py
index 1aa4693d79fff57c96636d0513dcbd17c52f16f2..e62889f2e41b3dba2ce2d9113887123ccbb5ee73 100755
--- a/buildtools/reclient_cfgs/configure_reclient_cfgs.py
+++ b/buildtools/reclient_cfgs/configure_reclient_cfgs.py
@@ -328,4 +328,13 @@ def main():
if __name__ == "__main__":
- sys.exit(main())
+ r = main()
+ if r != 0:
+ sys.exit(r)
+
+ electron_script = os.path.join(CHROMIUM_SRC, 'third_party', 'engflow-reclient-configs', 'configure_reclient.py')
+ r = subprocess.call([sys.executable, electron_script, '--src_dir=src', '--force'])
+ if r != 0:
+ sys.exit(r)
+
+ print('done')

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 cddbb941507a880ac6e69955fca7f2a1b4fcd0e2..6b2c1207d3e226c095b84edf10e468d554b6ae1a 100644
index 9b37b8a18c5c09aaf76590f53060cab3190d676f..0a095cfd413f8cb7f30f8b143b29e5e829898ad0 100644
--- a/content/browser/renderer_host/render_frame_host_impl.cc
+++ b/content/browser/renderer_host/render_frame_host_impl.cc
@@ -8181,6 +8181,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -8272,6 +8272,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 cddbb941507a880ac6e69955fca7f2a1b4fcd0e2..6b2c1207d3e226c095b84edf10e468d5
&no_javascript_access);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 7680d447ea4883ad45f27e402719006b580a55ba..6f19be9694e46213636f6555e12b8679a48cb867 100644
index 21815a78d24295c9bcaef5b133dd9ded47d1070a..e9ce07551ccd183cb205aedba787b3a9700e2a2b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4479,6 +4479,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4516,6 +4516,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
auto* new_contents_impl = new_contents.get();
@@ -37,7 +37,7 @@ index 7680d447ea4883ad45f27e402719006b580a55ba..6f19be9694e46213636f6555e12b8679
// If the new frame has a name, make sure any SiteInstances that can find
// this named frame have proxies for it. Must be called after
// SetSessionStorageNamespace, since this calls CreateRenderView, which uses
@@ -4520,12 +4526,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4557,12 +4563,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
AddWebContentsDestructionObserver(new_contents_impl);
}
@@ -51,10 +51,10 @@ index 7680d447ea4883ad45f27e402719006b580a55ba..6f19be9694e46213636f6555e12b8679
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 d062bc29cfef239f9dc86278c2e01276cb334e54..a237c5817651532151c344f9f02c771c82a0ced9 100644
index 3051e35ee43835113aafd8645daca12d31e873e1..53cbd6008101e8ae6851f8da9d4e6537400ca608 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -602,6 +602,10 @@ struct CreateNewWindowParams {
@@ -603,6 +603,10 @@ struct CreateNewWindowParams {
// The navigation initiator's user activation and ad status.
blink.mojom.NavigationInitiatorActivationAndAdStatus
initiator_activation_and_ad_status;
@@ -66,10 +66,10 @@ index d062bc29cfef239f9dc86278c2e01276cb334e54..a237c5817651532151c344f9f02c771c
// 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 6db465a37369674b26fdc1b7406151b9d91daf45..990dc12632f0faa5a1e0d9b92073a1e5c7d41ffb 100644
index d004abc6fe3da01d605be1d7138d1809e4616662..7cef4b0c29e1b537cd172e19609744aaf4d90a11 100644
--- a/content/public/browser/content_browser_client.cc
+++ b/content/public/browser/content_browser_client.cc
@@ -709,6 +709,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -710,6 +710,8 @@ bool ContentBrowserClient::CanCreateWindow(
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -79,10 +79,10 @@ index 6db465a37369674b26fdc1b7406151b9d91daf45..990dc12632f0faa5a1e0d9b92073a1e5
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 1ec7c7299e7abf0be994e9d2518acdcfa38f1960..ac85bc0cc8a5bc557636fb1203c2e408dba0df1b 100644
index d0a5dbc45467019aba2d185187ebb16879775dc4..dbeebb4ed9aa1fcba31cc2ce7e2031a483f7f1fe 100644
--- a/content/public/browser/content_browser_client.h
+++ b/content/public/browser/content_browser_client.h
@@ -179,6 +179,7 @@ class NetworkService;
@@ -182,6 +182,7 @@ class NetworkService;
class TrustedURLLoaderHeaderClient;
} // namespace mojom
struct ResourceRequest;
@@ -90,7 +90,7 @@ index 1ec7c7299e7abf0be994e9d2518acdcfa38f1960..ac85bc0cc8a5bc557636fb1203c2e408
} // namespace network
namespace sandbox {
@@ -1162,6 +1163,8 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1166,6 +1167,8 @@ class CONTENT_EXPORT ContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -100,7 +100,7 @@ index 1ec7c7299e7abf0be994e9d2518acdcfa38f1960..ac85bc0cc8a5bc557636fb1203c2e408
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 8c0e628124ad6068d95935ac4960f2d744adb3fd..aa401c609d1062cfd4149bbd7677f66a2554c3b4 100644
index 55afe83e3052afb40176cb8ab6e974013e207ff5..4f9e32610e7e2c97c486be8693bd357b0d3e29f8 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -30,6 +30,17 @@ namespace content {
@@ -122,7 +122,7 @@ index 8c0e628124ad6068d95935ac4960f2d744adb3fd..aa401c609d1062cfd4149bbd7677f66a
const OpenURLParams& params) {
return nullptr;
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index 4b32bf8ccc4ed370e2d1a218ae1fd69a98e23636..b9168a2488f5c4977eba5856882b561e07195c7f 100644
index 0a80169aa10cf956e53df5866719fd27437dd050..c34e8d3822fa5aafb351a6b2119c7d49b283a4b0 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -16,6 +16,7 @@
@@ -148,10 +148,10 @@ index 4b32bf8ccc4ed370e2d1a218ae1fd69a98e23636..b9168a2488f5c4977eba5856882b561e
// typically happens when popups are created.
virtual void WebContentsCreated(WebContents* source_contents,
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 7eca286713f1972844de21cb2c8c8e808ab900f0..9bea02ba22dc601e57406513ed02c8704bf587de 100644
index 07bb68687683ac1458080659471212473d9e966a..f5a6fde5af92e6a8258ac80e242f7ea21e946d1a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -6559,6 +6559,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
@@ -6573,6 +6573,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
GetWebFrame()->IsAdScriptInStack());
@@ -163,7 +163,7 @@ index 7eca286713f1972844de21cb2c8c8e808ab900f0..9bea02ba22dc601e57406513ed02c870
// moved on send.
bool is_background_tab =
diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc
index 51de81df6cb5126a750dab43322f8fc1fc484d80..9cb924a1969eef8d3940cc261e286e10c6d84d5c 100644
index 3b2947c0e67e5478af6ff6bf9c8826398998713e..0220384453018b5509d02d78eb2a33d02719d3c7 100644
--- a/content/web_test/browser/web_test_content_browser_client.cc
+++ b/content/web_test/browser/web_test_content_browser_client.cc
@@ -512,6 +512,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
@@ -176,10 +176,10 @@ index 51de81df6cb5126a750dab43322f8fc1fc484d80..9cb924a1969eef8d3940cc261e286e10
bool opener_suppressed,
bool* no_javascript_access) {
diff --git a/content/web_test/browser/web_test_content_browser_client.h b/content/web_test/browser/web_test_content_browser_client.h
index 4869a7502ed31ad6101bd89f899325ffef427c0e..954037dc4fdc21b922debb7a123f1e93e788a908 100644
index 1b60d72c3728956e3879248d17cce0d93fc15c8f..f7c9ee76f3cc6545f97982493cf60c4e63217b95 100644
--- a/content/web_test/browser/web_test_content_browser_client.h
+++ b/content/web_test/browser/web_test_content_browser_client.h
@@ -86,6 +86,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -88,6 +88,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
const std::string& frame_name,
WindowOpenDisposition disposition,
const blink::mojom::WindowFeatures& features,
@@ -210,10 +210,10 @@ index bef5a989bac50c177f15f52fe87ac3790d553e85..65dcd2e3b51929400c8bfb6a98a4fb59
} // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
index 88b4060c027def288bda0b74427eb6fffbdbcad6..a126e5e0019da2a776ce927ca821f05cb509e094 100644
index 9f0640197516a86ff24bc07bf3fdb87416f2c1e3..09ed4fddc03094760f9e38b421504958a02e261b 100644
--- a/third_party/blink/renderer/core/frame/local_dom_window.cc
+++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
@@ -2180,6 +2180,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
@@ -2208,6 +2208,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
WebWindowFeatures window_features =
GetWindowFeaturesFromString(features, entered_window);

View File

@@ -0,0 +1,86 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aaron Leventhal <aleventhal@google.com>
Date: Sat, 27 Jan 2024 04:15:37 +0000
Subject: Ensure old children of objects that become leaves are cleared
Fixed: 1520335
Change-Id: I9cd2fa6bfbb59d43318b7b378e4267c53e139f97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5238389
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1252998}
diff --git a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
index 15a7ced45e36c76d6f2a7e6736e9ea3c1fd69cff..a94e88e79c4fb5ed1336a776eafe3e302f5d50f8 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
+++ b/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
@@ -4599,15 +4599,7 @@ void AXNodeObject::AddChildrenImpl() {
}
CHECK(NeedsToUpdateChildren());
-
- if (!CanHaveChildren()) {
- // TODO(crbug.com/1407397): Make sure this is no longer firing then
- // transform this block to CHECK(CanHaveChildren());
- DUMP_WILL_BE_NOTREACHED_NORETURN()
- << "Should not reach AddChildren() if CanHaveChildren() is false.\n"
- << ToString(true, true);
- return;
- }
+ CHECK(CanHaveChildren());
if (ShouldLoadInlineTextBoxes() && HasLayoutText(this)) {
AddInlineTextBoxChildren();
diff --git a/third_party/blink/renderer/modules/accessibility/ax_object.cc b/third_party/blink/renderer/modules/accessibility/ax_object.cc
index 39e950c537266783f64df29fe4460a01f4a8dbcc..c465d53e8728e0cd8b3d936e50c16f1973073fa6 100644
--- a/third_party/blink/renderer/modules/accessibility/ax_object.cc
+++ b/third_party/blink/renderer/modules/accessibility/ax_object.cc
@@ -5761,16 +5761,19 @@ void AXObject::UpdateChildrenIfNecessary() {
return;
}
- if (!CanHaveChildren()) {
- SetNeedsToUpdateChildren(false);
- return;
- }
-
CHECK(!AXObjectCache().IsFrozen())
<< "Object should have already had its children updated in "
"AXObjectCacheImpl::UpdateTreeIfNeeded(): "
<< ToString(true, true);
+ if (!CanHaveChildren()) {
+ // Clear any children in case the node previously allowed children.
+ ClearChildren();
+ SetNeedsToUpdateChildren(false);
+ child_cached_values_need_update_ = false;
+ return;
+ }
+
UpdateCachedAttributeValuesIfNeeded();
ClearChildren();
diff --git a/third_party/blink/web_tests/external/wpt/accessibility/crashtests/inert-br-child.html b/third_party/blink/web_tests/external/wpt/accessibility/crashtests/inert-br-child.html
new file mode 100644
index 0000000000000000000000000000000000000000..9c9039c3abac39b10c730a75221a1752910d0ded
--- /dev/null
+++ b/third_party/blink/web_tests/external/wpt/accessibility/crashtests/inert-br-child.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<!-- Test for crash when inert br gains illegal child -->
+<html>
+<dialog></dialog>
+<br>
+
+<script>
+requestAnimationFrame(() => {
+ requestAnimationFrame(() => {
+ document.querySelector('dialog').showModal();
+ const br = document.querySelector('br');
+ br.appendChild(document.createElement('fieldset'));
+ });
+});
+</script>
+
+</html>

View File

@@ -9,10 +9,10 @@ This is an experimental commit; but if it's successful,
This patch should be upstreamed and then removed from electron's code.
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index 2e4054890db7593aeddd4bb3270dc2acdfa831d4..51a5fe152ad1bf334f19963e2c38e37e50a2b3ad 100644
index f3f5944785e5e19c1c51e6a123ff459ec768d8b8..8314178cd18cc07ecd54d90216c1eaac7aab97e8 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -42,7 +42,6 @@
@@ -43,7 +43,6 @@
#include "chrome/browser/ui/views/user_education/browser_feature_promo_controller.h"
#include "chrome/common/buildflags.h"
#include "components/infobars/core/infobar_container.h"

View File

@@ -6,10 +6,10 @@ Subject: chore: add electron deps to gitignores
Makes things like "git status" quicker when developing electron locally
diff --git a/.gitignore b/.gitignore
index 22417f27125a44d481483439066d73e60348b414..82e5084b0e12231e5cc96a38d99b7238ebd0565c 100644
index 2f9164594b1bbf9f6d7af875ab65ee0cb24b1227..4c969db1812ef64647e9d8f139961911439d0551 100644
--- a/.gitignore
+++ b/.gitignore
@@ -210,6 +210,7 @@ vs-chromium-project.txt
@@ -208,6 +208,7 @@ vs-chromium-project.txt
/data
/delegate_execute
/device/serial/device_serial_mojo.xml
@@ -18,7 +18,7 @@ index 22417f27125a44d481483439066d73e60348b414..82e5084b0e12231e5cc96a38d99b7238
/googleurl
/gpu/gles2_conform_test
diff --git a/third_party/.gitignore b/third_party/.gitignore
index 3674dd13b4b2325790fbbdffb8631842594f9f8b..c31304f547a8ad07d846ea2c054360745ea409fd 100644
index 563c82b850ab9559c65719f3619a42feaed1fd69..9b6d8256ae1a8b92d4790da59fee4f8fa8df8411 100644
--- a/third_party/.gitignore
+++ b/third_party/.gitignore
@@ -51,6 +51,7 @@
@@ -29,7 +29,7 @@ index 3674dd13b4b2325790fbbdffb8631842594f9f8b..c31304f547a8ad07d846ea2c05436074
/elfutils/src
/espresso/lib/
/eyesfree/src
@@ -110,6 +111,7 @@
@@ -104,6 +105,7 @@
/mocha
/mockito/src
/nacl_sdk_binaries/
@@ -37,7 +37,7 @@ index 3674dd13b4b2325790fbbdffb8631842594f9f8b..c31304f547a8ad07d846ea2c05436074
/ninja/ninja*
/node/*.tar.gz
/node/linux/
@@ -153,6 +155,7 @@
@@ -148,6 +150,7 @@
/soda-win64
/speex
/sqlite4java/lib/

View File

@@ -7,7 +7,7 @@ With WCO, allow chromium to handle synthetic mouse events generated for touch
actions in the non-client caption area.
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 c72621c0e0fb4be2061ffa75196b6d0b6aa3e019..1247de97981b86f412c8e578b89059966f1554bc 100644
index e8a6da6bdb14eea3217a6824163364958552ba44..9949d73b85b5110711689c5ee3f8ba1a493cc976 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
@@ -1222,6 +1222,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
@@ -22,10 +22,10 @@ index c72621c0e0fb4be2061ffa75196b6d0b6aa3e019..1247de97981b86f412c8e578b8905996
DesktopWindowTreeHostWin::GetSingletonDesktopNativeCursorManager() {
return new DesktopNativeCursorManagerWin();
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
index 013f571b521682e3f3381fd9fabc6e949d624fa3..5b1cacf1e9ce082712762785cc9bfe2fe8269f2e 100644
index e963c861f7099f1b3873ece621e12917a7b181e5..dc02d69861292282fe88ea68a62fafaaffb0ef74 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
@@ -262,6 +262,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
@@ -261,6 +261,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
void HandleWindowSizeUnchanged() override;
void HandleWindowScaleFactorChanged(float window_scale_factor) override;
void HandleHeadlessWindowBoundsChanged(const gfx::Rect& bounds) override;
@@ -34,7 +34,7 @@ index 013f571b521682e3f3381fd9fabc6e949d624fa3..5b1cacf1e9ce082712762785cc9bfe2f
Widget* GetWidget();
const Widget* GetWidget() const;
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 9ddf5e7d00d81b292ecc66bdac911dbb2d1d3fd1..517d137e35e6a270136b7f8cda17695eb96d6896 100644
index ecabc717aa51fd636aed60a06120186ac4ee9de3..45d1e126667cfcd782ec82f4368f698f9107ec65 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -3114,15 +3114,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,

View File

@@ -7,7 +7,7 @@ This patch comes after Chromium removed the ScopedAllowIO API in favor
of explicitly adding ScopedAllowBlocking calls as friends.
diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
index 83339edeacdc7d52093cfc8e8cf38dcafb0353c1..68acd0c99eda3f9103317abdfd8b3d8f5466963d 100644
index 310851d978cada04c7d9d8938b28ed3062ded7d5..1e71b6235f9ac6fc9294d8ca8d9602fdfc048770 100644
--- a/base/threading/thread_restrictions.h
+++ b/base/threading/thread_restrictions.h
@@ -135,6 +135,7 @@ class KeyStorageLinux;
@@ -18,7 +18,7 @@ index 83339edeacdc7d52093cfc8e8cf38dcafb0353c1..68acd0c99eda3f9103317abdfd8b3d8f
class Profile;
class ProfileImpl;
class ScopedAllowBlockingForProfile;
@@ -275,6 +276,9 @@ class BackendImpl;
@@ -273,6 +274,9 @@ class BackendImpl;
class InFlightIO;
bool CleanupDirectorySync(const base::FilePath&);
} // namespace disk_cache
@@ -28,7 +28,7 @@ index 83339edeacdc7d52093cfc8e8cf38dcafb0353c1..68acd0c99eda3f9103317abdfd8b3d8f
namespace enterprise_connectors {
class LinuxKeyRotationCommand;
} // namespace enterprise_connectors
@@ -563,6 +567,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
@@ -572,6 +576,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
friend class ::DesktopNotificationBalloon;
friend class ::FirefoxProfileLock;
friend class ::GaiaConfig;
@@ -36,7 +36,7 @@ index 83339edeacdc7d52093cfc8e8cf38dcafb0353c1..68acd0c99eda3f9103317abdfd8b3d8f
friend class ::ProfileImpl;
friend class ::ScopedAllowBlockingForProfile;
friend class ::StartupTabProviderImpl;
@@ -601,6 +606,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
@@ -611,6 +616,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
friend class crosapi::LacrosThreadTypeDelegate;
friend class crypto::ScopedAllowBlockingForNSS; // http://crbug.com/59847
friend class drive::FakeDriveService;

View File

@@ -14,7 +14,7 @@ This change patches it out to prevent the DCHECK.
It can be removed once/if we see a better solution to the problem.
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
index 357b8e4d89b769e02ab18f0749832c897fa69c68..c3f903f40c816cd89a21519a13c9f798611f8ec6 100644
index c7cb7a275e885b049e8dd171fe15e1ce356ac6a4..91a19974c6ec14317c1b030f41091733dc7ebae9 100644
--- a/content/browser/site_instance_impl.cc
+++ b/content/browser/site_instance_impl.cc
@@ -211,7 +211,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForGuest(

View File

@@ -9,7 +9,7 @@ Electron does not support Profiles, so this Profile::FromBrowserContext()
call is not needed and will not link. This change patches it out.
diff --git a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
index 8d697fcca4fbbc37218c81bb2120e3ce64831cc4..efe0a26077abb4d13686f2bec0567be947184ea9 100644
index 928d4739c2cdec3aa4fcb207f0eb74b3de7d951b..e07df5fe3ae1caa541853074db3ef6e41bbb11da 100644
--- a/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
+++ b/chrome/browser/pdf/chrome_pdf_stream_delegate.cc
@@ -44,6 +44,7 @@ namespace {

View File

@@ -35,10 +35,10 @@ index 9433ce4602414df4999f6ced8b371d4e847819ce..f38afaafcd6710f9cfcef816bf152cd2
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 8309281d321256e118e7086b29692f63be6aa9e6..96c433b8a3a42bf477c6467595b58a50c46499b4 100644
index ef5c95be3340b98ae0a74784187590781f6a7892..532576e19e4e76d021a6905da40230960f04e1a8 100644
--- a/chrome/browser/ui/ash/ash_web_view_impl.cc
+++ b/chrome/browser/ui/ash/ash_web_view_impl.cc
@@ -111,10 +111,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
@@ -115,10 +115,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -52,10 +52,10 @@ index 8309281d321256e118e7086b29692f63be6aa9e6..96c433b8a3a42bf477c6467595b58a50
/*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 cfa7d6f8eeba0484a6e06a0ee8200bf5870cb9be..954ee85cc2307e812889cf8dd3980f2b07f6311f 100644
index 0daac30efcfe15d0b3072306e5c96d56883992ae..4f794d3843192871bc78b586467a90cc56301759 100644
--- a/chrome/browser/ui/ash/ash_web_view_impl.h
+++ b/chrome/browser/ui/ash/ash_web_view_impl.h
@@ -51,8 +51,7 @@ class AshWebViewImpl : public ash::AshWebView,
@@ -57,8 +57,7 @@ class AshWebViewImpl : public ash::AshWebView,
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -80,10 +80,10 @@ index aaaa61d5c3a1d5ade2fd355e38a3985ef5cc4e7d..b45746ba0f38a381a2ee5ca17f3a1685
}
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index c36f7833a9cbe91ca09a89728bc2811605658aaa..aa2d43da9c63302b9185e9f7bdef285e1499a2a3 100644
index a001626c9f47079d84a2a2d89101d2a87112b872..60365beee3e4e4637c0045646da0412fbf0d0099 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1885,12 +1885,11 @@ bool Browser::IsWebContentsCreationOverridden(
@@ -1900,12 +1900,11 @@ bool Browser::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -99,10 +99,10 @@ index c36f7833a9cbe91ca09a89728bc2811605658aaa..aa2d43da9c63302b9185e9f7bdef285e
WebContents* Browser::CreateCustomWebContents(
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 91ff945f74fd342e70b53f22640c2e144f719ae9..6c31d755390dd12ff3b4118f0b173377a696c1b8 100644
index f1f279121056f38c5baff7db9788fb9a8de9844c..580f4c6157fb9dcb28ca20fe42b0b0e7350dc2c7 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -890,8 +890,7 @@ class Browser : public TabStripModelObserver,
@@ -921,8 +921,7 @@ class Browser : public TabStripModelObserver,
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -141,10 +141,10 @@ index ca72b324bf7c3b81ac94b53f0ff454d2df177950..d60ef3075d126e2bbd50c8469f2bf67c
// The profile used for the presentation.
raw_ptr<Profile, DanglingUntriaged> otr_profile_;
diff --git a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
index 8b1ebe377d69d335e648ce32eb0c2de5077c3ede..82e984382b3a484919702ac1e0d7d9c21dee223b 100644
index e6f3267a7f57c2768af02f049c1c1b9ec0f7a16b..2d717040473c8dad1e643bb6b1db67e90398cf4c 100644
--- a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
+++ b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
@@ -77,8 +77,7 @@ class HatsNextWebDialog::HatsWebView : public views::WebView {
@@ -78,8 +78,7 @@ class HatsNextWebDialog::HatsWebView : public views::WebView {
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -218,10 +218,10 @@ index c5b0d3b23b8da318ae55fcac2515a1187f261469..16ed1f46c9afde0ff25750128b4fcff6
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 7ec03754ef46ed72886994c0eab7ce2596ee5fb4..2f6f997eede33373a3b7ef43885cde5cc5c1d8a0 100644
index 245e7c6e3228001d17e62b8ace3647023cac9a73..af25cd45d6f087bc6fd06916bd5c7ba4ef69ddef 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4385,8 +4385,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
@@ -4422,8 +4422,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
if (delegate_ && delegate_->IsWebContentsCreationOverridden(
source_site_instance, params.window_container_type,
@@ -232,7 +232,7 @@ index 7ec03754ef46ed72886994c0eab7ce2596ee5fb4..2f6f997eede33373a3b7ef43885cde5c
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 aa401c609d1062cfd4149bbd7677f66a2554c3b4..40ff83b2dc575463aeac3b20ae74abe8036a548c 100644
index 4f9e32610e7e2c97c486be8693bd357b0d3e29f8..20c5b249bdf65694b1dbe7a703141da7aa0029f7 100644
--- a/content/public/browser/web_contents_delegate.cc
+++ b/content/public/browser/web_contents_delegate.cc
@@ -138,8 +138,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
@@ -246,7 +246,7 @@ index aa401c609d1062cfd4149bbd7677f66a2554c3b4..40ff83b2dc575463aeac3b20ae74abe8
}
diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
index b9168a2488f5c4977eba5856882b561e07195c7f..db05eabb345e3759e24f85dd95c81e9af2f7f401 100644
index c34e8d3822fa5aafb351a6b2119c7d49b283a4b0..08425c4787f2181be57ebd37ca7388a994c168f7 100644
--- a/content/public/browser/web_contents_delegate.h
+++ b/content/public/browser/web_contents_delegate.h
@@ -324,8 +324,7 @@ class CONTENT_EXPORT WebContentsDelegate {
@@ -358,10 +358,10 @@ index 60acb83c8d76f71db689f9d188bb6e8f64a74ffb..aa6cee708d1e451b443bc26528b56cc8
->options()
->block_new_web_contents();
diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc
index 8c5324b8d2a6a5a2f1fb855a98b42ab2b669ce75..f8956250fa78ef0354c1b0f31e2c9bd93d3e82b8 100644
index cbe26a6ee46b24334a68beb8e14af07153da1646..53b0404811766209a045a69dfa579b5b42e46369 100644
--- a/ui/views/controls/webview/web_dialog_view.cc
+++ b/ui/views/controls/webview/web_dialog_view.cc
@@ -426,8 +426,7 @@ bool WebDialogView::IsWebContentsCreationOverridden(
@@ -434,8 +434,7 @@ bool WebDialogView::IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,
@@ -372,10 +372,10 @@ index 8c5324b8d2a6a5a2f1fb855a98b42ab2b669ce75..f8956250fa78ef0354c1b0f31e2c9bd9
return delegate_->HandleShouldOverrideWebContentsCreation();
return false;
diff --git a/ui/views/controls/webview/web_dialog_view.h b/ui/views/controls/webview/web_dialog_view.h
index 3c74782fa1353cde102dc85314124fe91325d49a..e7c362b675871051cdc963c7b01975d30820814d 100644
index 283a61a467498a0b397c9486b3ae43b9539ba352..ed90983c5304317a548d85748d93e2de3e2ffa2f 100644
--- a/ui/views/controls/webview/web_dialog_view.h
+++ b/ui/views/controls/webview/web_dialog_view.h
@@ -158,8 +158,7 @@ class WEBVIEW_EXPORT WebDialogView : public ClientView,
@@ -163,8 +163,7 @@ class WEBVIEW_EXPORT WebDialogView : public ClientView,
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
const GURL& opener_url,

View File

@@ -9,7 +9,7 @@ Electron when a session is non persistent we do not initialize the
ExtensionSystem, so this check is not relevant for Electron.
diff --git a/extensions/browser/script_injection_tracker.cc b/extensions/browser/script_injection_tracker.cc
index 3c05ded105420450ce4c0009a9f6b4090d28ff8d..d68b7d928763616b41368a586a46c59f18d4d579 100644
index 1750588ca30761a41dec3bb3f1bfe5ac4eee699c..b7042b745c9496ba9c637bb15eb1bc442d353ab4 100644
--- a/extensions/browser/script_injection_tracker.cc
+++ b/extensions/browser/script_injection_tracker.cc
@@ -169,7 +169,6 @@ std::vector<const UserScript*> GetLoadedDynamicScripts(

View File

@@ -87,21 +87,33 @@ index 943168e2c72c0aeb59f1ea21b14f2dc8e6cfd7e0..db3ca2ed0ba0994caa4d26436b942166
// Create an observer that registers a hot key for |accelerator|.
std::unique_ptr<gfx::SingletonHwndHotKeyObserver> observer =
diff --git a/content/browser/media/media_keys_listener_manager_impl.cc b/content/browser/media/media_keys_listener_manager_impl.cc
index 65fa0fdec6316183a0e13210c2860548adee68ae..fd95c8c5b62a447542e38bf69acc86303be8fd9a 100644
index 5703755f3468b579c3e26245928ded023b83be14..8bc58dd31b5822682fe13ad7ded1dc40892b296d 100644
--- a/content/browser/media/media_keys_listener_manager_impl.cc
+++ b/content/browser/media/media_keys_listener_manager_impl.cc
@@ -316,6 +316,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
case ui::VKEY_MEDIA_STOP:
system_media_controls_->SetIsStopEnabled(should_enable);
break;
+ case ui::VKEY_VOLUME_DOWN:
+ case ui::VKEY_VOLUME_UP:
+ case ui::VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}
@@ -395,6 +395,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
case ui::VKEY_MEDIA_STOP:
browser_system_media_controls_->SetIsStopEnabled(should_enable);
break;
+ case ui::VKEY_VOLUME_DOWN:
+ case ui::VKEY_VOLUME_UP:
+ case ui::VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}
@@ -437,6 +442,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
case ui::VKEY_MEDIA_STOP:
smc->SetIsStopEnabled(should_enable);
break;
+ case ui::VKEY_VOLUME_DOWN:
+ case ui::VKEY_VOLUME_UP:
+ case ui::VKEY_VOLUME_MUTE:
+ // Do nothing.
+ break;
default:
NOTREACHED();
}
diff --git a/ui/base/accelerators/media_keys_listener.cc b/ui/base/accelerators/media_keys_listener.cc
index db596585cbb44b3710636e3fc013f288966f604f..6d5557ee1a2c35ee15e695e024834184a525e2a7 100644
--- a/ui/base/accelerators/media_keys_listener.cc

View File

@@ -116,7 +116,7 @@ index eb5bcfe0234c39526d6d162434476fe9e32d8184..8480d07e2607eb3c8c16b54a02077c04
arguments.push_back("--monitor-self");
}
diff --git a/components/crash/core/app/crashpad_win.cc b/components/crash/core/app/crashpad_win.cc
index 9ab5fb1c822752854fc88ba0ee3d24ddca4dd107..11ae602ccc58cb2728911b28d6637079d2dcb359 100644
index 15addd5c5e6635ad3b5797d5986c79353590a583..f31ae6b9e8bfdcc32239d0f6859e29ea6b4112b1 100644
--- a/components/crash/core/app/crashpad_win.cc
+++ b/components/crash/core/app/crashpad_win.cc
@@ -91,6 +91,7 @@ bool PlatformCrashpadInitialization(

View File

@@ -7,7 +7,7 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.
diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
index 83da453659ed0007d2be4079e1b102245cc27268..79c2bbc0c8c3345fd58b6e18408062eeed94c85e 100644
index 5fa68db39e6ded11d4d0f6bee46c7938b2f011c0..48f1cdd0a7763242b81c7a54cad72700c8a42af1 100644
--- a/content/app/content_main_runner_impl.cc
+++ b/content/app/content_main_runner_impl.cc
@@ -39,6 +39,7 @@
@@ -48,7 +48,7 @@ index 83da453659ed0007d2be4079e1b102245cc27268..79c2bbc0c8c3345fd58b6e18408062ee
#endif // V8_USE_EXTERNAL_STARTUP_DATA
}
@@ -965,7 +972,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
@@ -967,7 +974,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
return TerminateForFatalInitializationError();
#endif // BUILDFLAG(IS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
@@ -58,7 +58,7 @@ index 83da453659ed0007d2be4079e1b102245cc27268..79c2bbc0c8c3345fd58b6e18408062ee
blink::TrialTokenValidator::SetOriginTrialPolicyGetter(
base::BindRepeating([]() -> blink::OriginTrialPolicy* {
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
index a687861c04b323102a8d2bfe22b24a964793cd9b..4a7a469111eaec3e1e76ee852bd5afbbc0da2956 100644
index 610938d92786cc033c19615364e5e45d54bf8ec6..11797f0429845bd3b654aff2bfa468460e4fd772 100644
--- a/content/public/app/content_main_delegate.cc
+++ b/content/public/app/content_main_delegate.cc
@@ -5,6 +5,7 @@
@@ -69,8 +69,8 @@ index a687861c04b323102a8d2bfe22b24a964793cd9b..4a7a469111eaec3e1e76ee852bd5afbb
#include "build/build_config.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/common/content_client.h"
@@ -87,6 +88,10 @@ absl::optional<int> ContentMainDelegate::PostEarlyInitialization(
return absl::nullopt;
@@ -87,6 +88,10 @@ std::optional<int> ContentMainDelegate::PostEarlyInitialization(
return std::nullopt;
}
+base::StringPiece ContentMainDelegate::GetBrowserV8SnapshotFilename() {
@@ -81,10 +81,10 @@ index a687861c04b323102a8d2bfe22b24a964793cd9b..4a7a469111eaec3e1e76ee852bd5afbb
return new ContentClient();
}
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
index c891c5649a6ae76c9f0f988359649ece0e8ac1d9..54e30c4dd82042c283e36cae767dcdd716f94292 100644
index 2b0919b9a56bd37a398109777dfd199d777a9f74..823f44ab0303ccd6c7502ec65560ddb555b551e7 100644
--- a/content/public/app/content_main_delegate.h
+++ b/content/public/app/content_main_delegate.h
@@ -9,6 +9,7 @@
@@ -10,6 +10,7 @@
#include <string>
#include <vector>
@@ -102,10 +102,10 @@ index c891c5649a6ae76c9f0f988359649ece0e8ac1d9..54e30c4dd82042c283e36cae767dcdd7
friend class ContentClientCreator;
friend class ContentClientInitializer;
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index 7cd74afcf678b90314120ee252decc381f90271a..3fe71efd30b945da209a5074d3cc9c718fc12381 100644
index f823cf647d1ae3d57fba3aa7a2325debcdf6050a..b7330ef0685c2afbef7937bf1b9502d5c2af7584 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -556,8 +556,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
@@ -563,8 +563,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
@@ -115,7 +115,7 @@ index 7cd74afcf678b90314120ee252decc381f90271a..3fe71efd30b945da209a5074d3cc9c71
if (g_mapped_snapshot) {
// TODO(crbug.com/802962): Confirm not loading different type of snapshot
// files in a process.
@@ -566,10 +565,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
@@ -573,10 +572,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
base::MemoryMappedFile::Region file_region;
base::File file =

View File

@@ -8,10 +8,10 @@ Allow registering custom protocols to handle service worker main script fetching
Refs https://bugs.chromium.org/p/chromium/issues/detail?id=996511
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
index 630b04c463843274790ad1f47ebee3cf47e334bd..54404051eeafa407561050254362c62497ec427b 100644
index c0ece46d3a4b380c6fc2764bf49344153653bcf2..3bffada8ba3f378d4c5a5b75d7f1bb9da5437a1f 100644
--- a/content/browser/service_worker/service_worker_context_wrapper.cc
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc
@@ -1916,6 +1916,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
@@ -1922,6 +1922,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
loader_factory_bundle_info =
context()->loader_factory_bundle_for_update_check()->Clone();
@@ -38,7 +38,7 @@ index 630b04c463843274790ad1f47ebee3cf47e334bd..54404051eeafa407561050254362c624
if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig(
browser_context(), scope)) {
// If this is a Service Worker for a WebUI, the WebUI's URLDataSource
@@ -1935,9 +1955,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
@@ -1941,9 +1961,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
features::kEnableServiceWorkersForChromeScheme) &&
scope.scheme_piece() == kChromeUIScheme) {
config->RegisterURLDataSource(browser_context());
@@ -49,7 +49,7 @@ index 630b04c463843274790ad1f47ebee3cf47e334bd..54404051eeafa407561050254362c624
.emplace(kChromeUIScheme, CreateWebUIServiceWorkerLoaderFactory(
browser_context(), kChromeUIScheme,
base::flat_set<std::string>()));
@@ -1945,9 +1963,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
@@ -1951,9 +1969,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
features::kEnableServiceWorkersForChromeUntrusted) &&
scope.scheme_piece() == kChromeUIUntrustedScheme) {
config->RegisterURLDataSource(browser_context());

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/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
index 2ca479b9fb0b41b66220c524e242d4927c138f1f..61a85717ceb02cd0e19297a143ba9b0de8496eeb 100644
index 98c93666f451aaa5fddcb5c476c58925db087d56..3a88e94b94594d938a5e61889102d5322850b1f6 100644
--- a/ui/base/clipboard/clipboard_win.cc
+++ b/ui/base/clipboard/clipboard_win.cc
@@ -914,10 +914,10 @@ SkBitmap ClipboardWin::ReadBitmapInternal(ClipboardBuffer buffer) const {
@@ -905,10 +905,10 @@ SkBitmap ClipboardWin::ReadBitmapInternal(ClipboardBuffer buffer) const {
void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
UINT cf_format = format.ToFormatEtc().cfFormat;

View File

@@ -8,7 +8,7 @@ Subject: desktop_media_list.patch
* Ensure "OnRefreshComplete()" even if there are no items in the list
diff --git a/chrome/browser/media/webrtc/desktop_media_list.h b/chrome/browser/media/webrtc/desktop_media_list.h
index 42da00a0f473928263df89f11d80830b6986292b..6a556939d0acfbd910ebb0923e198e2fe67fd43d 100644
index 02aff44a81ffdf70ee85686867778f2ef0e9eda2..0c6fccf16a11bbaff10115308e4b489490e5d3e6 100644
--- a/chrome/browser/media/webrtc/desktop_media_list.h
+++ b/chrome/browser/media/webrtc/desktop_media_list.h
@@ -107,7 +107,8 @@ class DesktopMediaList {
@@ -22,7 +22,7 @@ index 42da00a0f473928263df89f11d80830b6986292b..6a556939d0acfbd910ebb0923e198e2f
virtual int GetSourceCount() const = 0;
virtual const Source& GetSource(int index) const = 0;
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc
index 489e6f7b7b0bb52b938a4fc137b983f3330cd4d2..1f2754dae9b81a7d233539a7e4e6ac77b3c5941f 100644
index 0389599ac786b6abd61ca921347fe12ddd5d0ee7..780927301744ea7312f230cec76a24a33d71f767 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
@@ -69,12 +69,12 @@ void DesktopMediaListBase::StartUpdating(DesktopMediaListObserver* observer) {
@@ -41,7 +41,7 @@ index 489e6f7b7b0bb52b938a4fc137b983f3330cd4d2..1f2754dae9b81a7d233539a7e4e6ac77
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 2cd1000b90fb5af464f81ac25b63092b638c6d40..8f18adb5641b3fa5f9defd3490e20a5d86b672e9 100644
index cb9be1e80b11c4b5839a0c281d49a0b8d4918a57..7aa54e5cb77b53c247c577dec1637da1ac290c2c 100644
--- a/chrome/browser/media/webrtc/desktop_media_list_base.h
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.h
@@ -39,7 +39,7 @@ class DesktopMediaListBase : public DesktopMediaList {
@@ -54,7 +54,7 @@ index 2cd1000b90fb5af464f81ac25b63092b638c6d40..8f18adb5641b3fa5f9defd3490e20a5d
const Source& GetSource(int index) const override;
DesktopMediaList::Type GetMediaListType() const override;
diff --git a/chrome/browser/media/webrtc/fake_desktop_media_list.cc b/chrome/browser/media/webrtc/fake_desktop_media_list.cc
index 832e0da5271d6ac92466c84dba6917041f825f96..068e7f57be13a89889047abeddd07dfc03b1fce0 100644
index 16c21bb299683e7b45245701618527dd4c6769a0..43bbc94f68c455d33ab3fa1995d5e33d9eb87c9b 100644
--- a/chrome/browser/media/webrtc/fake_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/fake_desktop_media_list.cc
@@ -79,7 +79,8 @@ void FakeDesktopMediaList::StartUpdating(DesktopMediaListObserver* observer) {
@@ -68,7 +68,7 @@ index 832e0da5271d6ac92466c84dba6917041f825f96..068e7f57be13a89889047abeddd07dfc
}
diff --git a/chrome/browser/media/webrtc/fake_desktop_media_list.h b/chrome/browser/media/webrtc/fake_desktop_media_list.h
index 33ca7a53dfb6d2c9e3a33f0065a3acd806e82e01..9fdf2e8ff0056ff407015b914c6b03eb6e25e0e4 100644
index afc2cf89299315cca68b50196c2377a7d474883d..52bfd487d501ef895915800b9ee83a5b6c945473 100644
--- a/chrome/browser/media/webrtc/fake_desktop_media_list.h
+++ b/chrome/browser/media/webrtc/fake_desktop_media_list.h
@@ -40,7 +40,8 @@ class FakeDesktopMediaList : public DesktopMediaList {
@@ -82,7 +82,7 @@ index 33ca7a53dfb6d2c9e3a33f0065a3acd806e82e01..9fdf2e8ff0056ff407015b914c6b03eb
const Source& GetSource(int index) const override;
DesktopMediaList::Type GetMediaListType() const override;
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
index 48b66d16f28b93d1f3a8e772533d7a347d8a3ad2..bec38602dd68faf39b9e0db38f13b5ffbbcb25ee 100644
index 7ad8178ada6bc852845837205162d7d7a1e431f3..78ad522d9772cb65128abba35a0d312fbff3c1e9 100644
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
@@ -160,7 +160,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
@@ -94,7 +94,7 @@ index 48b66d16f28b93d1f3a8e772533d7a347d8a3ad2..bec38602dd68faf39b9e0db38f13b5ff
#endif
content::DesktopMediaID::Type ConvertToDesktopMediaIDType(
@@ -331,7 +331,7 @@ class NativeDesktopMediaList::Worker
@@ -345,7 +345,7 @@ class NativeDesktopMediaList::Worker
base::WeakPtr<NativeDesktopMediaList> media_list_;
DesktopMediaID::Type source_type_;
@@ -103,7 +103,7 @@ index 48b66d16f28b93d1f3a8e772533d7a347d8a3ad2..bec38602dd68faf39b9e0db38f13b5ff
const ThumbnailCapturer::FrameDeliveryMethod frame_delivery_method_;
const bool add_current_process_windows_;
@@ -615,6 +615,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
@@ -633,6 +633,12 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
FROM_HERE,
base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished,
media_list_));
@@ -116,7 +116,7 @@ index 48b66d16f28b93d1f3a8e772533d7a347d8a3ad2..bec38602dd68faf39b9e0db38f13b5ff
}
void NativeDesktopMediaList::Worker::OnCaptureResult(
@@ -991,6 +997,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
@@ -1017,6 +1023,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails,
base::Unretained(worker_.get()),
std::move(native_ids), thumbnail_size_));

View File

@@ -1,239 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Birunthan Mohanathas <birunthan@mohanathas.com>
Date: Fri, 30 Nov 2018 12:44:12 +0200
Subject: disable_color_correct_rendering.patch
This adds a --disable-color-correct-rendering switch. In Electron 2.0,
`--disable-features=ColorCorrectRendering` could be
used to make the app use the display color space (e.g. P3 on Macs)
instead of color correcting to sRGB. Because color correct rendering is
always enabled on Chromium 62 and later and because
`--force-color-profile` has no effect on macOS, apps that need e.g. P3
colors are currently stuck on Electron 2.0.
This restores the functionality removed in
https://chromium-review.googlesource.com/698347 in the form of the
`--disable-color-correct-rendering` switch.
This can be removed once web content (including WebGL) learn how
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 3e7608703c8e7ab212a283a5db512ec7e6bdc1e6..75a8ae51753b183bd3cdefb0ae41bb9e18da1157 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1880,6 +1880,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
TargetColorParams LayerTreeHostImpl::GetTargetColorParams(
gfx::ContentColorUsage content_color_usage) const {
TargetColorParams params;
+ if (!settings_.enable_color_correct_rendering) {
+ params.color_space = gfx::ColorSpace();
+ return params;
+ }
// If we are likely to software composite the resource, we use sRGB because
// software compositing is unable to perform color conversion.
diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
index e43b58e7458336f914662d026a24e774fbe647ba..68c8f235f6afb412ebc65604c7b39109d9842d23 100644
--- a/cc/trees/layer_tree_settings.h
+++ b/cc/trees/layer_tree_settings.h
@@ -101,6 +101,8 @@ class CC_EXPORT LayerTreeSettings {
bool use_rgba_4444 = false;
bool unpremultiply_and_dither_low_bit_depth_tiles = false;
+ bool enable_color_correct_rendering = true;
+
// If set to true, the compositor may selectively defer image decodes to the
// 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 66564fbc928d28af97d7afaa2cfea03ce7ebc04c..cdd32d25eab50cbc2910f92eca92b9f6c8c7b5fe 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 {
RendererSettings(const RendererSettings& other);
~RendererSettings();
+ bool enable_color_correct_rendering = true;
bool allow_antialiasing = true;
bool force_antialiasing = false;
bool force_blending_with_shaders = false;
diff --git a/components/viz/host/renderer_settings_creation.cc b/components/viz/host/renderer_settings_creation.cc
index e4deb71ea3afa1ef9d6ddac9c61f5916ff608514..d2e6854ac2aaa3cc83c0b72ebc03193b5dc54149 100644
--- a/components/viz/host/renderer_settings_creation.cc
+++ b/components/viz/host/renderer_settings_creation.cc
@@ -17,6 +17,7 @@
#include "components/viz/common/features.h"
#include "components/viz/common/switches.h"
#include "ui/base/ui_base_switches.h"
+#include "ui/gfx/switches.h"
#if BUILDFLAG(IS_OZONE)
#include "ui/ozone/public/ozone_platform.h"
@@ -49,6 +50,8 @@ bool GetSwitchValueAsInt(const base::CommandLine* command_line,
RendererSettings CreateRendererSettings() {
RendererSettings renderer_settings;
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ renderer_settings.enable_color_correct_rendering =
+ !command_line->HasSwitch(switches::kDisableColorCorrectRendering);
renderer_settings.partial_swap_enabled =
!command_line->HasSwitch(switches::kUIDisablePartialSwap);
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 7c0598fb3f9f08d8d9905c5487f3a128f1262b15..314d443a60d0c9093dd06cd1589ab639dc81fabf 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -227,6 +227,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
// Command-line switches to propagate to the GPU process.
static const char* const kSwitchNames[] = {
+ switches::kDisableColorCorrectRendering,
sandbox::policy::switches::kDisableSeccompFilterSandbox,
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 8e7cca5026c165c06687210b3206eac21e70e89c..14e4ecad4284e433b72b091451a53e4115a86d8f 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -3350,6 +3350,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[] = {
+ switches::kDisableColorCorrectRendering,
switches::kDisableInProcessStackTraces,
sandbox::policy::switches::kDisableSeccompFilterSandbox,
sandbox::policy::switches::kNoSandbox,
diff --git a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
index 6892376fa33d006453977c354734d880a7ef7c91..4cd7b762d5fe1c54f5b06cc0d8f50560d6431a2f 100644
--- a/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
+++ b/third_party/blink/renderer/platform/graphics/canvas_color_params.cc
@@ -4,6 +4,7 @@
#include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
+#include "base/command_line.h"
#include "cc/paint/skia_paint_canvas.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/khronos/GLES2/gl2.h"
@@ -11,6 +12,7 @@
#include "third_party/khronos/GLES3/gl3.h"
#include "third_party/skia/include/core/SkSurfaceProps.h"
#include "ui/gfx/color_space.h"
+#include "ui/gfx/switches.h"
namespace blink {
@@ -18,6 +20,10 @@ namespace blink {
// Level 4 specification.
gfx::ColorSpace PredefinedColorSpaceToGfxColorSpace(
PredefinedColorSpace color_space) {
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ return gfx::ColorSpace();
+ }
switch (color_space) {
case PredefinedColorSpace::kSRGB:
return gfx::ColorSpace::CreateSRGB();
@@ -117,6 +123,11 @@ uint8_t CanvasColorParams::BytesPerPixel() const {
}
gfx::ColorSpace CanvasColorParams::GetStorageGfxColorSpace() const {
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ return gfx::ColorSpace();
+ }
+
return PredefinedColorSpaceToGfxColorSpace(color_space_);
}
diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
index 0e5ecb97bff85e0775a840f205893b5d6d12f38e..986f9a6f3de813feb16711d65d03dc8200215e27 100644
--- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
+++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
@@ -30,6 +30,7 @@
#include "third_party/blink/renderer/platform/web_test_support.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_switches.h"
+#include "ui/gfx/switches.h"
#include "ui/native_theme/native_theme_features.h"
#include "ui/native_theme/overlay_scrollbar_constants_aura.h"
@@ -342,6 +343,9 @@ cc::LayerTreeSettings GenerateLayerTreeSettings(
settings.main_frame_before_activation_enabled =
cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
+ settings.enable_color_correct_rendering =
+ !cmd.HasSwitch(::switches::kDisableColorCorrectRendering);
+
// Checkerimaging is not supported for synchronous single-threaded mode, which
// is what the renderer uses if its not threaded.
settings.enable_checker_imaging =
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
index 2f2eb750b71e6a219af9f8601c6053a9799a0044..9d4daa0d5d2df9c55caad9881ee462e20beff2b9 100644
--- a/ui/gfx/mac/io_surface.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -21,6 +21,7 @@
#include "ui/gfx/color_space.h"
#include "ui/gfx/icc_profile.h"
#include "ui/gfx/mac/color_space_util.h"
+#include "ui/gfx/switches.h"
namespace gfx {
@@ -147,6 +148,14 @@ void IOSurfaceMachPortTraits::Release(mach_port_t port) {
// Common method used by IOSurfaceSetColorSpace and IOSurfaceCanSetColorSpace.
bool IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
const ColorSpace& color_space) {
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ base::apple::ScopedCFTypeRef<CFDataRef> system_icc(
+ CGColorSpaceCopyICCData(base::mac::GetSystemColorSpace()));
+ IOSurfaceSetValue(io_surface, CFSTR("IOSurfaceColorSpace"), system_icc.get());
+ return true;
+ }
+
// Allow but ignore invalid color spaces.
if (!color_space.IsValid())
return true;
@@ -340,6 +349,15 @@ base::apple::ScopedCFTypeRef<IOSurfaceRef> CreateIOSurface(
DCHECK_EQ(kIOReturnSuccess, r);
}
+ auto* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableColorCorrectRendering)) {
+ CGColorSpaceRef color_space = base::mac::GetSystemColorSpace();
+ base::apple::ScopedCFTypeRef<CFDataRef> color_space_icc(
+ CGColorSpaceCopyICCData(color_space));
+ IOSurfaceSetValue(surface.get(), CFSTR("IOSurfaceColorSpace"), color_space_icc.get());
+ return surface;
+ }
+
// Ensure that all IOSurfaces start as sRGB.
IOSurfaceSetValue(surface.get(), CFSTR("IOSurfaceColorSpace"),
kCGColorSpaceSRGB);
diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
index 1bf6fffae161414d650be3210c427dcc47ac1cf8..64a6e263c693b17b26a538219ab681000b98cb9a 100644
--- a/ui/gfx/switches.cc
+++ b/ui/gfx/switches.cc
@@ -13,6 +13,8 @@ namespace switches {
// only apply to LinearAnimation and its subclasses.
const char kAnimationDurationScale[] = "animation-duration-scale";
+const char kDisableColorCorrectRendering[] = "disable-color-correct-rendering";
+
// Force disables font subpixel positioning. This affects the character glyph
// sharpness, kerning, hinting and layout.
const char kDisableFontSubpixelPositioning[] =
diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h
index 98697d908f507e30ffbe0e5f5996afb7856f7c12..039024924c7fc10d8311746b88369dec1732a9d0 100644
--- a/ui/gfx/switches.h
+++ b/ui/gfx/switches.h
@@ -13,6 +13,7 @@
namespace switches {
GFX_SWITCHES_EXPORT extern const char kAnimationDurationScale[];
+GFX_SWITCHES_EXPORT extern const char kDisableColorCorrectRendering[];
GFX_SWITCHES_EXPORT extern const char kDisableFontSubpixelPositioning[];
GFX_SWITCHES_EXPORT extern const char kEnableNativeGpuMemoryBuffers[];
GFX_SWITCHES_EXPORT extern const char kForcePrefersReducedMotion[];

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 893cfb4908ab73a3aedca25d056d1ddfc64d3cea..fd10856ad338dadfc2a67d9761b6d3f9da225e5c 100644
index 8e89fb47039493ae0040b0789a3e9ed2f742464e..6837c7a1046f37eb8ffa6825af4f9c6b333d38c5 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -557,7 +557,11 @@

View File

@@ -15,16 +15,16 @@ at some point be an API to "unfreeze" the flags, or we may be able to refactor
node initialization to not update flags after V8 initialization.
diff --git a/content/renderer/render_process_impl.cc b/content/renderer/render_process_impl.cc
index be1f39d4038a80b9d73ae0cb0a6709d280501bd4..d3ae9bcab7e28145c3c196f6c5bba56597c29ee4 100644
index 0739558b3912221356ed1a4491bab95eca8e7156..613c757eb7366263df2781da16e18266cb2f5ba4 100644
--- a/content/renderer/render_process_impl.cc
+++ b/content/renderer/render_process_impl.cc
@@ -224,6 +224,9 @@ RenderProcessImpl::RenderProcessImpl()
@@ -229,6 +229,9 @@ RenderProcessImpl::RenderProcessImpl()
v8::V8::SetFlagsFromString(kSABPerContextFlag, sizeof(kSABPerContextFlag));
}
+ // Freezing flags after init conflicts with node in the renderer.
+ v8::V8::SetFlagsFromString("--no-freeze-flags-after-init");
+
#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && defined(ARCH_CPU_X86_64)
#ifdef ENABLE_WEB_ASSEMBLY_TRAP_HANDLER_LINUX
if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) {
base::CommandLine* const command_line =

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 22eccd1647c4ff48e994366527e45154d986d164..b7a3f5643ced5013c38197f654bd616ffe0f73de 100644
index b62442d2213a7f55c66d19d3747f7f00c5b2aaa4..033634314d706196b5a68fc44114971d31bda3cb 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -818,6 +818,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -832,6 +832,9 @@ void RenderWidgetHostImpl::WasHidden() {
return;
}
@@ -20,10 +20,10 @@ index 22eccd1647c4ff48e994366527e45154d986d164..b7a3f5643ced5013c38197f654bd616f
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 561bd928028df438e4184d07316ef98d9d9c91c0..1485e8d345adbdb5fdb055e1ff325bcd48121d72 100644
index 709246523b417943b4c64ef364312980d717e1bc..079b93338c3af4605c470b88934a32d1868eabe6 100644
--- a/content/browser/renderer_host/render_widget_host_impl.h
+++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -911,6 +911,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -914,6 +914,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
void UpdateBrowserControlsState(cc::BrowserControlsState constraints,
cc::BrowserControlsState current,
bool animate);
@@ -33,10 +33,10 @@ index 561bd928028df438e4184d07316ef98d9d9c91c0..1485e8d345adbdb5fdb055e1ff325bcd
void StartDragging(blink::mojom::DragDataPtr drag_data,
const url::Origin& source_origin,
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 268533e5bd0ef599dc7ea82bb4d68fd2d814c729..f14a7c55f6db46d9684639fcac3a203af792d65a 100644
index 7942ee12c003c722b02f2b76cc6cca9837551f68..d78f00cbb877b64892b9871252d79796fd4cabb8 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -625,7 +625,7 @@ void RenderWidgetHostViewAura::HideImpl() {
@@ -620,7 +620,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 607f7aa461ac881f1fe83e6c37092993231f145b..f3c4d0e78e352f32b3c3cb179327909e750826f4 100644
index bef15a4f17358386478d853a84a1c1e32dfd6f0e..5c785109c7223268a096a2c5a5cf6c61298e8227 100644
--- a/content/browser/renderer_host/navigator.cc
+++ b/content/browser/renderer_host/navigator.cc
@@ -1305,6 +1305,7 @@ void Navigator::RecordNavigationMetrics(
@@ -1288,6 +1288,7 @@ void Navigator::RecordNavigationMetrics(
.InMilliseconds());
}
@@ -35,7 +35,7 @@ index 607f7aa461ac881f1fe83e6c37092993231f145b..f3c4d0e78e352f32b3c3cb179327909e
// 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 &&
@@ -1354,6 +1355,7 @@ void Navigator::RecordNavigationMetrics(
@@ -1337,6 +1338,7 @@ void Navigator::RecordNavigationMetrics(
first_before_unload_start_time)
.InMilliseconds());
}

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 6e314250aafafd165e1a50baeb476e1bec6e8701..c72621c0e0fb4be2061ffa75196b6d0b6aa3e019 100644
index d877d237b2c1622057ff5e2304f232760016b948..e8a6da6bdb14eea3217a6824163364958552ba44 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
@@ -579,7 +579,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
@@ -19,7 +19,7 @@ index 6e314250aafafd165e1a50baeb476e1bec6e8701..c72621c0e0fb4be2061ffa75196b6d0b
excluded_margin);
}
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 8044dca7ed9de0b050fc26eaf884ca8d10ff458c..3327fe134545179d5eb1fb098d41805366c30b88 100644
index 36a6e980495ea68d8477a5107dc803294a5711d8..fcc084bb28658b6ca3614815978e3889c3886d43 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -959,8 +959,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,

View File

@@ -21,7 +21,7 @@ index cec5e3b283343586ba846a4ce58fee34e8542164..09ec66b75113d6a934d51ee5aad68428
ThreadIsolatedAllocator* GetThreadIsolatedAllocator() override;
#endif
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc
index a31b05d93b3728a17ebf6b78f0c01a20e0c6f250..9e88ea2190aec8f8ba962dd19a00e7c0cd9402d5 100644
index 3e21c6487268141f08cf308da90a3dd79fd4d6f0..d8e87ffdf7891b20a22d317655f4eaa45a371b5e 100644
--- a/gin/v8_platform.cc
+++ b/gin/v8_platform.cc
@@ -338,6 +338,10 @@ ThreadIsolatedAllocator* V8Platform::GetThreadIsolatedAllocator() {

View File

@@ -33,10 +33,10 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4
} // namespace net
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index b3ef314dfe19a92ebb11ae34405b37c4424efe9a..4ab0420e80cf450ca49b456fedfbf1b887573432 100644
index 8dd57dc6d943054bda0e3ab9d992732f36ec6d3e..8c9c956c6b8642f96e964f562d5a31821ec68005 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -1568,6 +1568,13 @@ void NetworkContext::SetNetworkConditions(
@@ -1612,6 +1612,13 @@ void NetworkContext::SetNetworkConditions(
std::move(network_conditions));
}
@@ -51,10 +51,10 @@ index b3ef314dfe19a92ebb11ae34405b37c4424efe9a..4ab0420e80cf450ca49b456fedfbf1b8
// 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 21f2966b086b029561bbed1bb37b87f2d79f5407..13f3952889c0e04c966e0d5f704261872cf4e6fb 100644
index 453ab6cf11c5fd5aea9f8e30f1d2582cd20f36c4..faf4cc435f0857e186d1c3b32d66477439839d04 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -317,6 +317,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
@@ -315,6 +315,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 21f2966b086b029561bbed1bb37b87f2d79f5407..13f3952889c0e04c966e0d5f70426187
void SetEnableReferrers(bool enable_referrers) override;
#if BUILDFLAG(IS_CT_SUPPORTED)
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index 46520ea94b20d59acc0bd0158cea4b3e289e0cee..f463639a4925d929cbf4c8114b09c57c4d967c9f 100644
index fee16e02e0160825e44c668672176546abe7d99d..e6c2bb7599d1606725c982db98255a04ed456419 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -1240,6 +1240,9 @@ interface NetworkContext {
@@ -1266,6 +1266,9 @@ interface NetworkContext {
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
NetworkConditions? conditions);
@@ -77,7 +77,7 @@ index 46520ea94b20d59acc0bd0158cea4b3e289e0cee..f463639a4925d929cbf4c8114b09c57c
SetAcceptLanguage(string new_accept_language);
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index 94c01006242cdf73b66faa1503701f2e1aca2057..186cb3bf636b91bd233e84c573eadddcd0db6b14 100644
index 381c00fbe1af5711860b3237be1165e1c58540c0..cf16ab98f288b4a74dcb2bc9ab74ae6aa9d78805 100644
--- a/services/network/test/test_network_context.h
+++ b/services/network/test/test_network_context.h
@@ -147,6 +147,7 @@ class TestNetworkContext : public mojom::NetworkContext {

View File

@@ -18,10 +18,10 @@ index 384a59138db11ea38028f844dd67e328ebffbe7b..f153997c2afccef1fa1b64ee5f162c28
bool IsNull() const { return private_.IsNull(); }
diff --git a/third_party/blink/renderer/core/exported/web_blob.cc b/third_party/blink/renderer/core/exported/web_blob.cc
index ce7b5e229789d606df5e74461f09e2e1db59fc95..b1bf2affa5b7f10d9b45d062a2ce0479f5a3b80a 100644
index d92af6b6f3134e5c3c660bcefd1e3da643767629..a4db82d49604e0a770f2985a6b4e607c70dc57f7 100644
--- a/third_party/blink/renderer/core/exported/web_blob.cc
+++ b/third_party/blink/renderer/core/exported/web_blob.cc
@@ -40,6 +40,7 @@
@@ -41,6 +41,7 @@
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/fileapi/blob.h"
#include "third_party/blink/renderer/core/fileapi/file_backed_blob_factory_dispatcher.h"
@@ -29,7 +29,7 @@ index ce7b5e229789d606df5e74461f09e2e1db59fc95..b1bf2affa5b7f10d9b45d062a2ce0479
#include "third_party/blink/renderer/platform/blob/blob_data.h"
#include "third_party/blink/renderer/platform/file_metadata.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
@@ -83,6 +84,14 @@ WebString WebBlob::Uuid() {
@@ -84,6 +85,14 @@ WebString WebBlob::Uuid() {
return private_->Uuid();
}

View File

@@ -12,7 +12,7 @@ Ideally we could add an embedder observer pattern here but that can be
done in future work.
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index 64228ce3fb2134b28ac153a6088c26049c6f203c..6c6af1b9fde3924bad07316860347a93b0660bcc 100644
index 1b1628b5ba7b6920e149f881e8d5086ac9be0132..9c1359730ae381037102d2fe9950f1a19a679e54 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -167,6 +167,7 @@

View File

@@ -65,18 +65,18 @@ index 02d9eabfef9521722340739bf86df3dfc30018d7..af8639ebcc61d8081a12334f652a551d
#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 09108f231a54b117a143e71efa3f3663d64a63e6..b520e59cd5c0e3014497780d2ff8503f30557a4f 100644
index 298c9c81fa110ad7900d0bd6822136bb57f0382e..da7aaed23e4e0cdc037490bbe8beaea705b48df5 100644
--- a/chrome/browser/process_singleton_posix.cc
+++ b/chrome/browser/process_singleton_posix.cc
@@ -613,6 +613,7 @@ class ProcessSingleton::LinuxWatcher
@@ -610,6 +610,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:
@@ -667,13 +668,16 @@ void ProcessSingleton::LinuxWatcher::StartListening(int socket) {
// Called when the ProcessSingleton that owns this class is about to be
@@ -669,13 +670,17 @@ void ProcessSingleton::LinuxWatcher::StartListening(int socket) {
}
void ProcessSingleton::LinuxWatcher::HandleMessage(
@@ -88,14 +88,15 @@ index 09108f231a54b117a143e71efa3f3663d64a63e6..b520e59cd5c0e3014497780d2ff8503f
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))) {
if (parent_ && parent_->notification_callback_.Run(
- base::CommandLine(argv), base::FilePath(current_dir))) {
+ base::CommandLine(argv),
+ 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 {
@@ -721,7 +725,8 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
@@ -723,7 +728,8 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
}
}
@@ -105,7 +106,7 @@ index 09108f231a54b117a143e71efa3f3663d64a63e6..b520e59cd5c0e3014497780d2ff8503f
const size_t kMinMessageLength = std::size(kStartToken) + 4;
if (bytes_read_ < kMinMessageLength) {
buf_[bytes_read_] = 0;
@@ -751,10 +756,28 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
@@ -753,10 +759,28 @@ void ProcessSingleton::LinuxWatcher::SocketReader::
tokens.erase(tokens.begin());
tokens.erase(tokens.begin());
@@ -135,7 +136,7 @@ index 09108f231a54b117a143e71efa3f3663d64a63e6..b520e59cd5c0e3014497780d2ff8503f
fd_watch_controller_.reset();
// LinuxWatcher::HandleMessage() is in charge of destroying this SocketReader
@@ -783,8 +806,10 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK(
@@ -785,8 +809,10 @@ void ProcessSingleton::LinuxWatcher::SocketReader::FinishWithACK(
//
ProcessSingleton::ProcessSingleton(
const base::FilePath& user_data_dir,
@@ -146,7 +147,7 @@ index 09108f231a54b117a143e71efa3f3663d64a63e6..b520e59cd5c0e3014497780d2ff8503f
current_pid_(base::GetCurrentProcId()) {
socket_path_ = user_data_dir.Append(chrome::kSingletonSocketFilename);
lock_path_ = user_data_dir.Append(chrome::kSingletonLockFilename);
@@ -902,7 +927,8 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
@@ -907,7 +933,8 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
sizeof(socket_timeout));
// Found another process, prepare our command line
@@ -156,7 +157,7 @@ index 09108f231a54b117a143e71efa3f3663d64a63e6..b520e59cd5c0e3014497780d2ff8503f
std::string to_send(kStartToken);
to_send.push_back(kTokenDelimiter);
@@ -912,11 +938,21 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
@@ -917,11 +944,21 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeout(
to_send.append(current_dir.value());
const std::vector<std::string>& argv = cmd_line.argv();

View File

@@ -1,31 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Apthorp <nornagon@nornagon.net>
Date: Wed, 4 Mar 2020 11:18:03 -0800
Subject: feat: add onclose to MessagePort
This adds the 'onclose' event to MessagePort. Can be removed once
https://bugs.chromium.org/p/chromium/issues/detail?id=1495616 is fixed.
diff --git a/third_party/blink/renderer/core/messaging/message_port.cc b/third_party/blink/renderer/core/messaging/message_port.cc
index 5d7780c48a74fc7d95aeb690c90ab394b1e01a83..15f5f0f6aa05d3b17adae87286c92df9cc26a712 100644
--- a/third_party/blink/renderer/core/messaging/message_port.cc
+++ b/third_party/blink/renderer/core/messaging/message_port.cc
@@ -195,6 +195,7 @@ void MessagePort::close() {
Entangle(pipe.TakePort0(), nullptr);
}
closed_ = true;
+ DispatchEvent(*Event::Create(event_type_names::kClose));
}
void MessagePort::Entangle(MessagePortDescriptor port_descriptor,
diff --git a/third_party/blink/renderer/core/messaging/message_port.idl b/third_party/blink/renderer/core/messaging/message_port.idl
index 9df43655b569428a6abc54341b4b0023e159f99b..3f1f181d9b8a66997136f870f55c97c08294b6eb 100644
--- a/third_party/blink/renderer/core/messaging/message_port.idl
+++ b/third_party/blink/renderer/core/messaging/message_port.idl
@@ -40,5 +40,5 @@
// event handlers
attribute EventHandler onmessage;
attribute EventHandler onmessageerror;
- [RuntimeEnabled=MessagePortCloseEvent] attribute EventHandler onclose;
+ attribute EventHandler onclose;
};

View File

@@ -13,10 +13,10 @@ uses internally for things like menus and devtools.
We can remove this patch once it has in some shape been upstreamed.
diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
index ce34cced354b092b8e8cf04a8c034c9833765e71..67c1c16b028f87b04007242d60d9cf90a61731da 100644
index fbbc35818cfa1709b30520e2336eeab2d96693d0..814230e423a44bfc71b6e028fb870f2a1d15e15f 100644
--- a/ui/native_theme/native_theme.cc
+++ b/ui/native_theme/native_theme.cc
@@ -191,6 +191,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors,
@@ -198,6 +198,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors,
NativeTheme::~NativeTheme() = default;
bool NativeTheme::ShouldUseDarkColors() const {
@@ -26,10 +26,10 @@ index ce34cced354b092b8e8cf04a8c034c9833765e71..67c1c16b028f87b04007242d60d9cf90
}
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 099bc7193edf98c8b3aff2d35a3c1653820c75fd..1d1ae195131e80ee1bc080e28992ef3554808389 100644
index 772c7a34a97588dd20c040be5ca482696990c880..fe1c04d6f9c9e9ca6a3aeacbaf897f1df5783248 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -441,6 +441,23 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -442,6 +442,23 @@ class NATIVE_THEME_EXPORT NativeTheme {
scoped_refptr<ColorProviderKey::ThemeInitializerSupplier> custom_theme,
bool use_custom_frame = true) const;
@@ -53,7 +53,7 @@ index 099bc7193edf98c8b3aff2d35a3c1653820c75fd..1d1ae195131e80ee1bc080e28992ef35
// Returns a shared instance of the native theme that should be used for web
// rendering. Do not use it in a normal application context (i.e. browser).
// The returned object should not be deleted by the caller. This function is
@@ -662,6 +679,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -658,6 +675,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
bool inverted_colors_ = false;
PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight;
PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference;
@@ -62,10 +62,10 @@ index 099bc7193edf98c8b3aff2d35a3c1653820c75fd..1d1ae195131e80ee1bc080e28992ef35
SEQUENCE_CHECKER(sequence_checker_);
};
diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
index 50647269ec84f1a543132b3d102152a40e1e65e1..41a7df7e873a7d3300fd48db0ffa5f1fc8e43198 100644
index 6af4df92820d5a9d247a927244522f4c4acd164d..92af8c4a933b8462dce2524b0623a6843abd2600 100644
--- a/ui/native_theme/native_theme_win.cc
+++ b/ui/native_theme/native_theme_win.cc
@@ -664,6 +664,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
@@ -655,6 +655,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
// ...unless --force-dark-mode was specified in which case caveat emptor.
if (InForcedColorsMode() && !IsForcedDarkMode())
return false;

View File

@@ -65,7 +65,7 @@ index a7e9ab69fa13a0ad2e5aa97f09a8da4d9d51a48f..f994f23c16cc7dbc703d5e2289803940
void MultiBufferDataSource::SetReader(MultiBufferReader* reader) {
diff --git a/third_party/blink/renderer/platform/media/multi_buffer_data_source.h b/third_party/blink/renderer/platform/media/multi_buffer_data_source.h
index 578374d9a4fbaa9001e2dc39e4c7fa2a09658dde..64031ef9928ec86bf7e46c77c05ba7ca2e7f2d28 100644
index faad2219254615fedba155c41598478026190788..f1e8feb1f235faed58f76346622eaa22f5a351f4 100644
--- a/third_party/blink/renderer/platform/media/multi_buffer_data_source.h
+++ b/third_party/blink/renderer/platform/media/multi_buffer_data_source.h
@@ -34,6 +34,8 @@ namespace blink {

View File

@@ -9,15 +9,22 @@ 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 48b7a20c212578ba9055b781b5c05b312fa7e974..3ae8136e5c938be80df141f7ca582d974fb08eed 100644
index 48b7a20c212578ba9055b781b5c05b312fa7e974..d7d92f326ba94be7a3960d527bc2b6d8d15890fa 100644
--- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
+++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
@@ -49,6 +49,9 @@ namespace {
@@ -13,6 +13,7 @@
#include "base/functional/bind.h"
#include "base/lazy_instance.h"
#include "base/location.h"
+#include "base/no_destructor.h"
#include "base/notreached.h"
#include "base/observer_list.h"
#include "base/path_service.h"
@@ -49,6 +50,8 @@ namespace {
base::LazyInstance<GURL>::Leaky g_download_url_for_testing =
LAZY_INSTANCE_INITIALIZER;
+base::LazyInstance<GURL>::Leaky g_base_download_url_override =
+ LAZY_INSTANCE_INITIALIZER;
+base::NoDestructor<GURL> g_base_download_url_override;
+
// Close the file.
void CloseDictionary(base::File file) {
@@ -27,7 +34,7 @@ index 48b7a20c212578ba9055b781b5c05b312fa7e974..3ae8136e5c938be80df141f7ca582d97
}
+void SpellcheckHunspellDictionary::SetBaseDownloadURL(const GURL url) {
+ g_base_download_url_override.Get() = url;
+ *g_base_download_url_override = url;
+}
+
GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
@@ -37,8 +44,8 @@ index 48b7a20c212578ba9055b781b5c05b312fa7e974..3ae8136e5c938be80df141f7ca582d97
std::string bdict_file = dictionary_file_.path.BaseName().MaybeAsASCII();
DCHECK(!bdict_file.empty());
+ if (g_base_download_url_override.Get() != GURL())
+ return GURL(g_base_download_url_override.Get().spec() + base::ToLowerASCII(bdict_file));
+ if (*g_base_download_url_override != GURL())
+ return GURL(g_base_download_url_override->spec() + base::ToLowerASCII(bdict_file));
+
static const char kDownloadServerUrl[] =
"https://redirector.gvt1.com/edgedl/chrome/dict/";

View File

@@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 26 Oct 2023 11:07:47 +0900
Date: Thu, 14 Dec 2023 21:16:53 +0900
Subject: Enable V8 code cache for custom schemes
Add a new category in ContentClient::AddAdditionalSchemes which allows
@@ -9,7 +9,7 @@ embedders to make custom schemes allow V8 code cache.
Chromium CL: https://chromium-review.googlesource.com/c/chromium/src/+/5019665
diff --git a/content/browser/code_cache/generated_code_cache.cc b/content/browser/code_cache/generated_code_cache.cc
index 65ac47b199b3f6d37fe78495eeb3d3598c4add8d..5230bf2cf1387ca73b34e0be2e0cffecd46a3653 100644
index 65ac47b199b3f6d37fe78495eeb3d3598c4add8d..b2d84eef99d64b2b591dbbf735ff29882cacc297 100644
--- a/content/browser/code_cache/generated_code_cache.cc
+++ b/content/browser/code_cache/generated_code_cache.cc
@@ -6,6 +6,7 @@
@@ -28,48 +28,90 @@ index 65ac47b199b3f6d37fe78495eeb3d3598c4add8d..5230bf2cf1387ca73b34e0be2e0cffec
using storage::BigIOBuffer;
@@ -46,24 +48,37 @@ void CheckValidKeys(const GURL& resource_url,
@@ -36,7 +38,7 @@ constexpr char kSeparator[] = " \n";
// We always expect to receive valid URLs that can be used as keys to the code
// cache. The relevant checks (for ex: resource_url is valid, origin_lock is
-// not opque etc.,) must be done prior to requesting the code cache.
+// not opaque etc.,) must be done prior to requesting the code cache.
//
// This function doesn't enforce anything in the production code. It is here
// to make the assumptions explicit and to catch any errors when DCHECKs are
@@ -46,30 +48,54 @@ void CheckValidKeys(const GURL& resource_url,
GeneratedCodeCache::CodeCacheType cache_type) {
// If the resource url is invalid don't cache the code.
DCHECK(resource_url.is_valid());
+ bool resource_url_allows_code_cache =
+ base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme());
bool resource_url_is_chrome_or_chrome_untrusted =
- bool resource_url_is_chrome_or_chrome_untrusted =
+
+ // There are 3 kind of URL scheme compatible for the `resource_url`.
+ // 1. http: and https: URLs.
+ // 2. chrome: and chrome-untrusted: URLs.
+ // 3. URLs whose scheme are allowed by the content/ embedder.
+ const bool resource_url_http = resource_url.SchemeIsHTTPOrHTTPS();
+ const bool resource_url_webui =
resource_url.SchemeIs(content::kChromeUIScheme) ||
resource_url.SchemeIs(content::kChromeUIUntrustedScheme);
DCHECK(resource_url.SchemeIsHTTPOrHTTPS() ||
+ resource_url_allows_code_cache ||
resource_url_is_chrome_or_chrome_untrusted);
- DCHECK(resource_url.SchemeIsHTTPOrHTTPS() ||
- resource_url_is_chrome_or_chrome_untrusted);
-
- // |origin_lock| should be either empty or should have
- // Http/Https/chrome/chrome-untrusted schemes and it should not be a URL with
- // opaque origin. Empty origin_locks are allowed when the renderer is not
- // locked to an origin.
- bool origin_lock_is_chrome_or_chrome_untrusted =
+ const bool resource_url_embedder =
+ base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme());
+ DCHECK(resource_url_http || resource_url_webui || resource_url_embedder);
+
+ // |origin_lock| should be either empty or should have code cache allowed
+ // schemes (http/https/chrome/chrome-untrusted or other custom schemes added
+ // by url::AddCodeCacheScheme), and it should not be a URL with opaque
+ // origin. Empty origin_locks are allowed when the renderer is not locked to
+ // an origin.
+ bool origin_lock_allows_code_cache =
+ base::Contains(url::GetCodeCacheSchemes(), origin_lock.scheme());
bool origin_lock_is_chrome_or_chrome_untrusted =
+ const bool origin_lock_empty = origin_lock.is_empty();
+ const bool origin_lock_for_http = origin_lock.SchemeIsHTTPOrHTTPS();
+ const bool origin_lock_for_webui =
origin_lock.SchemeIs(content::kChromeUIScheme) ||
origin_lock.SchemeIs(content::kChromeUIUntrustedScheme);
DCHECK(origin_lock.is_empty() ||
((origin_lock.SchemeIsHTTPOrHTTPS() ||
+ origin_lock_allows_code_cache ||
origin_lock_is_chrome_or_chrome_untrusted) &&
!url::Origin::Create(origin_lock).opaque()));
- DCHECK(origin_lock.is_empty() ||
- ((origin_lock.SchemeIsHTTPOrHTTPS() ||
- origin_lock_is_chrome_or_chrome_untrusted) &&
- !url::Origin::Create(origin_lock).opaque()));
-
- // The chrome and chrome-untrusted schemes are only used with the WebUI
- // code cache type.
- DCHECK_EQ(origin_lock_is_chrome_or_chrome_untrusted,
- cache_type == GeneratedCodeCache::kWebUIJavaScript);
- DCHECK_EQ(resource_url_is_chrome_or_chrome_untrusted,
- cache_type == GeneratedCodeCache::kWebUIJavaScript);
+ const bool origin_lock_for_embedder =
+ base::Contains(url::GetCodeCacheSchemes(), origin_lock.scheme());
+
+ DCHECK(origin_lock_empty || ((origin_lock_for_http || origin_lock_for_webui ||
+ origin_lock_for_embedder) &&
+ !url::Origin::Create(origin_lock).opaque()));
+
+ // The webui schemes are only used with their dedicated code cache type.
+ switch (cache_type) {
+ case GeneratedCodeCache::kJavaScript:
+ case GeneratedCodeCache::kWebAssembly:
+ DCHECK(!origin_lock_for_webui);
+ DCHECK(!resource_url_webui);
+ break;
+ case GeneratedCodeCache::kWebUIJavaScript:
+ DCHECK(origin_lock_for_webui);
+ DCHECK(resource_url_webui);
+ break;
+ }
+
+ // The custom schemes share the cache type with http(s).
+ if (origin_lock_allows_code_cache || resource_url_allows_code_cache) {
+ if (origin_lock_for_embedder || resource_url_embedder) {
+ DCHECK(cache_type == GeneratedCodeCache::kJavaScript ||
+ cache_type == GeneratedCodeCache::kWebAssembly);
+ }
+
// The chrome and chrome-untrusted schemes are only used with the WebUI
// code cache type.
DCHECK_EQ(origin_lock_is_chrome_or_chrome_untrusted,
}
// Generates the cache key for the given |resource_url|, |origin_lock| and
diff --git a/content/browser/code_cache/generated_code_cache.h b/content/browser/code_cache/generated_code_cache.h
index f5c5ff2c89489257003dfe3284ee9de9f517c99b..fdd2e2483171c4d43963590200817dac27d22cf9 100644
--- a/content/browser/code_cache/generated_code_cache.h
@@ -94,23 +136,18 @@ index f5c5ff2c89489257003dfe3284ee9de9f517c99b..fdd2e2483171c4d43963590200817dac
// JavaScript from chrome and chrome-untrusted pages. The resource URLs are
diff --git a/content/browser/code_cache/generated_code_cache_browsertest.cc b/content/browser/code_cache/generated_code_cache_browsertest.cc
index 672b9bb14cd493b05d1e27019cda30c5269bf46f..f4093315dea8feb4184adbfd4c398768a6fb197d 100644
index 2b84d4ef58986bb2eb8da1e62edd31769004bd98..7b213ad2757ece877d93e9f2cfdcaf666a6c054c 100644
--- a/content/browser/code_cache/generated_code_cache_browsertest.cc
+++ b/content/browser/code_cache/generated_code_cache_browsertest.cc
@@ -2,21 +2,32 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/test/test_future.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/test_future.h"
+#include "components/services/storage/storage_service_impl.h"
@@ -8,12 +8,17 @@
#include "content/browser/code_cache/generated_code_cache.h"
+#include "content/browser/code_cache/generated_code_cache_context.h"
#include "content/browser/code_cache/generated_code_cache_context.h"
#include "content/browser/renderer_host/code_cache_host_impl.h"
+#include "content/browser/storage_partition_impl.h"
+#include "content/common/url_schemes.h"
#include "content/public/browser/browser_context.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
@@ -119,9 +156,8 @@ index 672b9bb14cd493b05d1e27019cda30c5269bf46f..f4093315dea8feb4184adbfd4c398768
+#include "content/test/test_content_client.h"
#include "net/dns/mock_host_resolver.h"
#include "third_party/blink/public/common/features.h"
+#include "url/url_util.h"
namespace content {
#include "third_party/blink/public/common/page/v8_compile_hints_histograms.h"
@@ -22,6 +27,8 @@ namespace content {
namespace {
@@ -130,37 +166,46 @@ index 672b9bb14cd493b05d1e27019cda30c5269bf46f..f4093315dea8feb4184adbfd4c398768
bool SupportsSharedWorker() {
#if BUILDFLAG(IS_ANDROID)
// SharedWorkers are not enabled on Android. https://crbug.com/154571
@@ -427,4 +438,80 @@ IN_PROC_BROWSER_TEST_P(CodeCacheBrowserTest,
@@ -115,8 +122,7 @@ class CodeCacheBrowserTest
// Worker scripts will fetch this once the cacheable resource has been
// loaded and the test logic (checking histograms) can continue.
if (absolute_url.path() == "/done.js") {
- content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
- std::move(done_callback_));
+ GetUIThreadTaskRunner({})->PostTask(FROM_HERE, std::move(done_callback_));
auto http_response =
std::make_unique<net::test_server::BasicHttpResponse>();
@@ -629,4 +635,82 @@ IN_PROC_BROWSER_TEST_F(LocalCompileHintsBrowserTest, LocalCompileHints) {
}
}
+class CodeCacheInCustomSchemeBrowserTest : public ContentBrowserTest {
+class CodeCacheInCustomSchemeBrowserTest : public ContentBrowserTest,
+ public TestContentClient {
+ public:
+ CodeCacheInCustomSchemeBrowserTest() {
+ SetContentClient(&test_content_client_);
+ SetContentClient(this);
+ ReRegisterContentSchemesForTests();
+ }
+
+ private:
+ class CustomSchemeContentClient : public TestContentClient {
+ public:
+ void AddAdditionalSchemes(Schemes* schemes) override {
+ schemes->standard_schemes.push_back(kCodeCacheScheme);
+ schemes->code_cache_schemes.push_back(kCodeCacheScheme);
+ }
+ };
+ ~CodeCacheInCustomSchemeBrowserTest() override { SetContentClient(nullptr); }
+
+ private:
+ void AddAdditionalSchemes(Schemes* schemes) override {
+ schemes->standard_schemes.push_back(kCodeCacheScheme);
+ schemes->code_cache_schemes.push_back(kCodeCacheScheme);
+ }
+
+ CustomSchemeContentClient test_content_client_;
+ url::ScopedSchemeRegistryForTests scheme_registry_;
+};
+
+IN_PROC_BROWSER_TEST_F(CodeCacheInCustomSchemeBrowserTest,
+ AllowedCustomSchemeCanGenerateCodeCache) {
+ // Create browser context and get code cache context.
+ base::ScopedAllowBlockingForTesting allow_blocking;
+ TestBrowserContext browser_context;
+ StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>(
+ browser_context.GetDefaultStoragePartition());
+ StoragePartitionImpl* partition =
+ static_cast<StoragePartitionImpl*>(shell()
+ ->web_contents()
+ ->GetBrowserContext()
+ ->GetDefaultStoragePartition());
+ scoped_refptr<GeneratedCodeCacheContext> context =
+ partition->GetGeneratedCodeCacheContext();
+ EXPECT_NE(context, nullptr);
@@ -175,44 +220,47 @@ index 672b9bb14cd493b05d1e27019cda30c5269bf46f..f4093315dea8feb4184adbfd4c398768
+ base::test::TestFuture<void> add_entry_future;
+ GeneratedCodeCacheContext::RunOrPostTask(
+ context.get(), FROM_HERE,
+ base::BindOnce([](scoped_refptr<GeneratedCodeCacheContext> context,
+ const GURL& url,
+ const GURL& origin,
+ const std::string& data,
+ base::OnceClosure callback) {
+ context->generated_js_code_cache()->WriteEntry(
+ url, origin, net::NetworkIsolationKey(),
+ base::Time::Now(), std::vector<uint8_t>(data.begin(), data.end()));
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE, std::move(callback));
+ }, context, url, origin, data, add_entry_future.GetCallback()));
+ base::BindOnce(
+ [](scoped_refptr<GeneratedCodeCacheContext> context, const GURL& url,
+ const GURL& origin, const std::string& data,
+ base::OnceClosure callback) {
+ context->generated_js_code_cache()->WriteEntry(
+ url, origin, net::NetworkIsolationKey(), base::Time::Now(),
+ std::vector<uint8_t>(data.begin(), data.end()));
+ GetUIThreadTaskRunner({})->PostTask(FROM_HERE, std::move(callback));
+ },
+ context, url, origin, data, add_entry_future.GetCallback()));
+ ASSERT_TRUE(add_entry_future.Wait());
+
+ // Get the code cache entry.
+ base::test::TestFuture<std::string> get_entry_future;
+ GeneratedCodeCacheContext::RunOrPostTask(
+ context.get(), FROM_HERE,
+ base::BindOnce([](scoped_refptr<GeneratedCodeCacheContext> context,
+ const GURL& url,
+ const GURL& origin,
+ base::OnceCallback<void(std::string)> callback) {
+ context->generated_js_code_cache()->FetchEntry(
+ url, origin, net::NetworkIsolationKey(),
+ base::BindOnce([](base::OnceCallback<void(std::string)> callback,
+ const base::Time& response_time,
+ mojo_base::BigBuffer buffer) {
+ std::string data(buffer.data(), buffer.data() + buffer.size());
+ content::GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE, base::BindOnce(std::move(callback), data));
+ }, std::move(callback)));
+ }, context, url, origin, get_entry_future.GetCallback()));
+ base::BindOnce(
+ [](scoped_refptr<GeneratedCodeCacheContext> context, const GURL& url,
+ const GURL& origin,
+ base::OnceCallback<void(std::string)> callback) {
+ context->generated_js_code_cache()->FetchEntry(
+ url, origin, net::NetworkIsolationKey(),
+ base::BindOnce(
+ [](base::OnceCallback<void(std::string)> callback,
+ const base::Time& response_time,
+ mojo_base::BigBuffer buffer) {
+ std::string data(buffer.data(),
+ buffer.data() + buffer.size());
+ GetUIThreadTaskRunner({})->PostTask(
+ FROM_HERE, base::BindOnce(std::move(callback), data));
+ },
+ std::move(callback)));
+ },
+ context, url, origin, get_entry_future.GetCallback()));
+ ASSERT_TRUE(get_entry_future.Wait());
+ ASSERT_EQ(data, get_entry_future.Get<0>());
+}
+
} // namespace content
diff --git a/content/browser/renderer_host/code_cache_host_impl.cc b/content/browser/renderer_host/code_cache_host_impl.cc
index 6b9e5065dc570b506c4c2606d536319d98684e12..9d1f337b9c9890b6b7afda40bf2f829ff2a25bfd 100644
index 9604422742eb8eb3a6b460f2791e3fb0056e0fcf..cfeae69888f7101328ef1425d474a33ef861d86d 100644
--- a/content/browser/renderer_host/code_cache_host_impl.cc
+++ b/content/browser/renderer_host/code_cache_host_impl.cc
@@ -6,6 +6,7 @@
@@ -231,100 +279,123 @@ index 6b9e5065dc570b506c4c2606d536319d98684e12..9d1f337b9c9890b6b7afda40bf2f829f
using blink::mojom::CacheStorageError;
@@ -40,6 +42,11 @@ enum class Operation {
kWrite,
};
@@ -35,6 +37,11 @@ namespace content {
namespace {
+bool ProcessLockURLIsCodeCacheScheme(const ProcessLock& process_lock) {
+ return base::Contains(url::GetCodeCacheSchemes(),
+ process_lock.lock_url().scheme());
+}
+
bool CheckSecurityForAccessingCodeCacheData(const GURL& resource_url,
int render_process_id,
Operation operation) {
@@ -47,11 +54,12 @@ bool CheckSecurityForAccessingCodeCacheData(const GURL& resource_url,
bool CheckSecurityForAccessingCodeCacheData(
const GURL& resource_url,
int render_process_id,
@@ -43,40 +50,57 @@ bool CheckSecurityForAccessingCodeCacheData(
ChildProcessSecurityPolicyImpl::GetInstance()->GetProcessLock(
render_process_id);
- // Code caching is only allowed for http(s) and chrome/chrome-untrusted
- // scripts. Furthermore, there is no way for http(s) pages to load chrome or
- // chrome-untrusted scripts, so any http(s) page attempting to store data
- // about a chrome or chrome-untrusted script would be an indication of
- // suspicious activity.
+ // Code caching is only allowed for scripts from open-web (http/https and
+ // custom schemes registered with url::AddCodeCacheScheme) and
+ // chrome/chrome-untrusted schemes. Furthermore, there is no way for
+ // open-web pages to load chrome or chrome-untrusted scripts, so any
+ // open-web page attempting to store data about a chrome or
+ // chrome-untrusted script would be an indication of suspicious activity.
if (resource_url.SchemeIs(content::kChromeUIScheme) ||
resource_url.SchemeIs(content::kChromeUIUntrustedScheme)) {
if (!process_lock.is_locked_to_site()) {
@@ -60,9 +68,10 @@ bool CheckSecurityForAccessingCodeCacheData(const GURL& resource_url,
return false;
}
+ // Code caching is only allowed for scripts from:
+ // 1. http: and https: schemes.
+ // 2. chrome: and chrome-untrusted: schemes.
+ // 3. Schemes registered by content/ embedder via url::AddCodeCacheScheme.
+ //
+ // Furthermore, we know there are no way for http(s) pages to load chrome or
// chrome-untrusted scripts, so any http(s) page attempting to store data
// about a chrome or chrome-untrusted script would be an indication of
// suspicious activity.
- if (resource_url.SchemeIs(content::kChromeUIScheme) ||
- resource_url.SchemeIs(content::kChromeUIUntrustedScheme)) {
- if (!process_lock.is_locked_to_site()) {
- // We can't tell for certain whether this renderer is doing something
- // malicious, but we don't trust it enough to store data.
- return false;
- }
+ if (resource_url.SchemeIsHTTPOrHTTPS()) {
if (process_lock.matches_scheme(url::kHttpScheme) ||
- process_lock.matches_scheme(url::kHttpsScheme)) {
+ process_lock.matches_scheme(url::kHttpsScheme) ||
+ ProcessLockURLIsCodeCacheScheme(process_lock)) {
if (operation == Operation::kWrite) {
- mojo::ReportBadMessage("HTTP(S) pages cannot cache WebUI code");
+ mojo::ReportBadMessage("Open-web pages cannot cache WebUI code");
}
return false;
}
@@ -72,7 +81,16 @@ bool CheckSecurityForAccessingCodeCacheData(const GURL& resource_url,
return process_lock.matches_scheme(content::kChromeUIScheme) ||
process_lock.matches_scheme(content::kChromeUIUntrustedScheme);
}
- if (resource_url.SchemeIsHTTPOrHTTPS()) {
+ if (base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme()) &&
+ (process_lock.matches_scheme(url::kHttpScheme) ||
+ process_lock.matches_scheme(url::kHttpsScheme))) {
+ // While custom schemes registered with url::AddCodeCacheScheme are
+ // considered as open-web pages, we still do not trust http(s) pages
+ // loading resources from custom schemes.
process_lock.matches_scheme(url::kHttpsScheme)) {
- if (operation == CodeCacheHostImpl::Operation::kWrite) {
+ return true;
+ }
+ // Pages in custom schemes like isolated-app: are allowed to load http(s)
+ // resources.
+ if (ProcessLockURLIsCodeCacheScheme(process_lock)) {
+ return true;
+ }
+ // It is possible for WebUI pages to include open-web content, but such
+ // usage is rare and we've decided that reasoning about security is easier
+ // if the WebUI code cache includes only WebUI scripts.
+ return false;
+ }
+ if (resource_url.SchemeIsHTTPOrHTTPS() ||
+ base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme())) {
if (process_lock.matches_scheme(content::kChromeUIScheme) ||
process_lock.matches_scheme(content::kChromeUIUntrustedScheme)) {
// It is possible for WebUI pages to include open-web content, but such
@@ -136,15 +154,17 @@ absl::optional<GURL> GetSecondaryKeyForCodeCache(const GURL& resource_url,
return absl::nullopt;
+
+ if (resource_url.SchemeIs(kChromeUIScheme) ||
+ resource_url.SchemeIs(kChromeUIUntrustedScheme)) {
+ if (process_lock.matches_scheme(kChromeUIScheme) ||
+ process_lock.matches_scheme(kChromeUIUntrustedScheme)) {
+ return true;
+ }
+ if (operation == CodeCacheHostImpl::Operation::kWrite) {
+ if (process_lock.matches_scheme(url::kHttpScheme) ||
+ process_lock.matches_scheme(url::kHttpsScheme)) {
mojo::ReportBadMessage("HTTP(S) pages cannot cache WebUI code");
}
+ if (ProcessLockURLIsCodeCacheScheme(process_lock)) {
+ mojo::ReportBadMessage(
+ "Page whose scheme are allowed by content/ embedders cannot cache "
+ "WebUI code. Did the embedder misconfigured content/?");
+ }
return false;
}
// Other schemes which might successfully load chrome or chrome-untrusted
// scripts, such as the PDF viewer, are unsupported but not considered
- // dangerous.
- return process_lock.matches_scheme(content::kChromeUIScheme) ||
- process_lock.matches_scheme(content::kChromeUIUntrustedScheme);
+ // dangerous. Similarly, the process might not be locked to a site.
+ return false;
}
- if (resource_url.SchemeIsHTTPOrHTTPS()) {
- if (process_lock.matches_scheme(content::kChromeUIScheme) ||
- process_lock.matches_scheme(content::kChromeUIUntrustedScheme)) {
- // It is possible for WebUI pages to include open-web content, but such
- // usage is rare and we've decided that reasoning about security is easier
- // if the WebUI code cache includes only WebUI scripts.
- return false;
- }
- return true;
+
+ if (base::Contains(url::GetCodeCacheSchemes(), resource_url.scheme())) {
+ return ProcessLockURLIsCodeCacheScheme(process_lock);
}
// Case 3: process_lock_url is used to enfore site-isolation in code caches.
- // Http/https/chrome schemes are safe to be used as a secondary key. Other
- // schemes could be enabled if they are known to be safe and if it is
- // required to cache code from those origins.
+ // Code cache enabled schemes (http/https/chrome/chrome-untrusted and custom
+ // schemes registered with url::AddCodeCacheScheme) are safe to be used as a
+ // secondary key. Other schemes could be enabled if they are known to be safe
+ // and if it is required to cache code from those origins.
//
// file:// URLs will have a "file:" process lock and would thus share a
// cache across all file:// URLs. That would likely be ok for security, but
// since this case is not performance sensitive we will keep things simple and
- // limit the cache to http/https/chrome/chrome-untrusted processes.
- if (process_lock.matches_scheme(url::kHttpScheme) ||
+ // limit the cache to processes of code cache enabled schemes.
+ if (ProcessLockURLIsCodeCacheScheme(process_lock) ||
+ process_lock.matches_scheme(url::kHttpScheme) ||
if (operation == CodeCacheHostImpl::Operation::kWrite) {
@@ -422,7 +446,8 @@ std::optional<GURL> CodeCacheHostImpl::GetSecondaryKeyForCodeCache(
if (process_lock.matches_scheme(url::kHttpScheme) ||
process_lock.matches_scheme(url::kHttpsScheme) ||
process_lock.matches_scheme(content::kChromeUIScheme) ||
process_lock.matches_scheme(content::kChromeUIUntrustedScheme)) {
- process_lock.matches_scheme(content::kChromeUIUntrustedScheme)) {
+ process_lock.matches_scheme(content::kChromeUIUntrustedScheme) ||
+ ProcessLockURLIsCodeCacheScheme(process_lock)) {
return process_lock.lock_url();
}
diff --git a/content/common/url_schemes.cc b/content/common/url_schemes.cc
index ce9644d33fe83379127b01bf9a2b1c4badc3bc7c..532b14e013b9b65ba390f09e8bb8934bb278a0d8 100644
index ce9644d33fe83379127b01bf9a2b1c4badc3bc7c..fd486d4637ae4766ed78571dee7f9cebbd809f38 100644
--- a/content/common/url_schemes.cc
+++ b/content/common/url_schemes.cc
@@ -98,6 +98,9 @@ void RegisterContentSchemes(bool should_lock_registry) {
@@ -98,6 +98,14 @@ void RegisterContentSchemes(bool should_lock_registry) {
for (auto& scheme : schemes.empty_document_schemes)
url::AddEmptyDocumentScheme(scheme.c_str());
+ for (auto& scheme : schemes.code_cache_schemes)
+ for (auto& scheme : schemes.code_cache_schemes) {
+ CHECK_NE(scheme, kChromeUIScheme);
+ CHECK_NE(scheme, kChromeUIUntrustedScheme);
+ CHECK_NE(scheme, url::kHttpScheme);
+ CHECK_NE(scheme, url::kHttpsScheme);
+ url::AddCodeCacheScheme(scheme.c_str());
+ }
+
#if BUILDFLAG(IS_ANDROID)
if (schemes.allow_non_standard_schemes_in_origins)
@@ -344,10 +415,10 @@ index 5d1484651fb8c3e03337665d3d5342ba51df3154..d4432a660d6c5a5e937dedabb7e4b71b
std::vector<std::string> extension_schemes;
// Registers a URL scheme with a predefined default custom handler.
diff --git a/url/url_util.cc b/url/url_util.cc
index 9258cfcfada47aafe6ba20c648187947fec72372..a1834e543d27d46265af0c2133acac79b6c840e2 100644
index c57c19ba2773a5ff7318e46b60d58ac9316fa340..bad83f441920d948ad03198f928c99060a7b767b 100644
--- a/url/url_util.cc
+++ b/url/url_util.cc
@@ -114,6 +114,9 @@ struct SchemeRegistry {
@@ -115,6 +115,9 @@ struct SchemeRegistry {
kAboutScheme,
};
@@ -357,7 +428,7 @@ index 9258cfcfada47aafe6ba20c648187947fec72372..a1834e543d27d46265af0c2133acac79
// Schemes with a predefined default custom handler.
std::vector<SchemeWithHandler> predefined_handler_schemes;
@@ -659,6 +662,15 @@ const std::vector<std::string>& GetEmptyDocumentSchemes() {
@@ -670,6 +673,15 @@ const std::vector<std::string>& GetEmptyDocumentSchemes() {
return GetSchemeRegistry().empty_document_schemes;
}
@@ -374,7 +445,7 @@ index 9258cfcfada47aafe6ba20c648187947fec72372..a1834e543d27d46265af0c2133acac79
DoAddSchemeWithHandler(
new_scheme, handler,
diff --git a/url/url_util.h b/url/url_util.h
index 8c94c7a4f6d5f653d326199e5b43452f969911d4..40dcdf9d680f9d345c09426da48b37f288234244 100644
index 8c94c7a4f6d5f653d326199e5b43452f969911d4..518ea53a033233ca88b411200e008beb7bbd75ef 100644
--- a/url/url_util.h
+++ b/url/url_util.h
@@ -115,6 +115,15 @@ COMPONENT_EXPORT(URL) const std::vector<std::string>& GetCSPBypassingSchemes();
@@ -386,7 +457,7 @@ index 8c94c7a4f6d5f653d326199e5b43452f969911d4..40dcdf9d680f9d345c09426da48b37f2
+// The WebUI schemes (chrome/chrome-untrusted) do not belong to this list, as
+// they are treated as a separate cache type for security purpose.
+// The http(s) schemes do not belong to this list neither, they always have V8
+// code cache enabled and can not load scripts from schemes in this list.
+// code cache enabled.
+COMPONENT_EXPORT(URL) void AddCodeCacheScheme(const char* new_scheme);
+COMPONENT_EXPORT(URL) const std::vector<std::string>& GetCodeCacheSchemes();
+

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