Граф коммитов

3429 Коммитов

Автор SHA1 Сообщение Дата
Charles Kerr fe0d4274e2
fix: confirm a `v8::Value` is a `v8::Object` before casting it (#43575)
fix: confirm a v8::Value is a v8::Object before casting it
2024-09-06 11:20:04 -05:00
Charles Kerr cc5aa65cb4
fix: delete UvTaskRunner's timers only after they're closed (#43561)
* fix: free UvTaskRunner timers only after they are closed

* refactor: UvTaskRunner now holds UvHandles
2024-09-06 07:16:56 -05:00
Charles Kerr 3fde574db1
fix: -Wunsafe-buffer-usage warnings in url-loader (#43564)
Use v8::ArrayBufferView::CopyContents() instead of doing the pointer
math + memcpy() ourselves. This not only solves the buffer warnings,
but may also avoid some additional overhead:

> Copy the contents of the ArrayBufferView's buffer to an
> embedder defined memory without additional overhead that
> calling ArrayBufferView::Buffer might incur.
2024-09-05 20:22:03 -05:00
Orko Garai 69df09dc90
fix: Launch apps with XDG_ACTIVATION_TOKEN in ozone/wayland (#43480)
* fix: Launch apps with XDG_ACTIVATION_TOKEN in ozone/wayland

Ensure apps are launched with the activation token received from
xdg_activation_v1 protocol.

* add focus_launched_process option
2024-09-05 13:07:10 -05:00
Charles Kerr 2d868ecb8d
perf: use v8::Local<v8::Object> as the key in ObjectCache (#43519)
* perf: use v8::Object* as direct keys instead of using hash + a linked list

* refactor: use v8::Local<v8::Object> as the key
2024-09-04 22:53:06 -05:00
Charles Kerr 0467790aee
chore: migrate to v8::Object::SetPrototypeV2() (#43535)
chore: migrate to v8::Object::SetPrototypeV2().

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

[api] Mark v8::Object::GetPrototype() for deprecation

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2024-09-04 20:30:54 -05:00
Charles Kerr 8ae5aacc8c
refactor: declare gin::Wrapper subclasses as final (#43527)
As per the gin docs: "Wrappable<T> explicitly does not support further
subclassing of T. Subclasses of Wrappable<T> should be declared final."
2024-09-04 18:40:02 -05:00
Charles Kerr 054cbcd6eb
fix: don't use deprecate-soon class v8::String::Value (#43518)
* fix: remove use of deprecated v8::String::Value

Upstream marked v8::String::Value as `V8_DEPRECATE_SOON` last month,
so let's stop using it.

The replacement code mostly does the same as v8::String::Value();
but since our test only cares about the length and not the contents,
we get a small perf win of not needing to allocate a char array and
not needing to call Local::String::Write().

Upstream V8_DEPRECATE_SOON:
Xref: https://chromium-review.googlesource.com/c/v8/v8/+/5667299kkk

v8::String::Value() implementation:
20226b740b/src/api/api.cc (10883)

History on why we used it:
80c1a9739d
f49ed30f72

* Update shell/common/gin_converters/file_path_converter.h

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

* fixup! Update shell/common/gin_converters/file_path_converter.h

do not return success for all non-Null non-Strings

---------

Co-authored-by: Robo <hop2deep@gmail.com>
2024-09-04 08:56:14 -05:00
Orko Garai 53dcda1fe9
fix: Use XDG_ACTIVATION_TOKEN in wayland when launched by other app (#43481)
When an electron app is launched by another app ensure that the
XDG_ACTIVATION_TOKEN env var is read and used for activation using
xdg_activation_v1 protocol.
2024-09-04 12:54:00 +02:00
George Xu 635d421123
fix: systemMediaPermissionDenied should not check camera perms when the request is asking for screen share (#43517)
* fix: systemMediaPermissionDenied: should check for screen capture perms instead of camera

* Revert "fix: systemMediaPermissionDenied: should check for screen capture perms instead of camera"

This reverts commit e9cc672165.

* should only do these checks for audio or video, but not screenshare

* no service

* oops

---------

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2024-09-04 09:56:26 +01:00
Charles Kerr b42c0ae00d
fix: -Wunsafe-buffer-usage warnings in IsUrlArg() (#43477)
* fix: -Wunsafe-buffer-usage warnings in IsUrlArg()

* chore: improve code comments for CheckCommandLineArguments()

* chore: reduce diffs from main

* refactor: CheckCommandLineArguments takes a StringVector arg

Fixes another buffer warning!
2024-09-03 21:51:39 -04:00
Robo 41b8fdca5c
fix: devtools dock state with WCO on linux (#43490) 2024-08-29 09:17:00 +09:00
Charles Kerr 7cea992926
refactor: simplify KeyWeakMap impl (#43461) 2024-08-26 13:19:05 -05:00
Charles Kerr 2390706030
refactor: prefer std::ranges over begin() and end() (#43464) 2024-08-26 10:58:32 -04:00
David Sanders 56829f75c1
chore: cleanup include groupings (#43478) 2024-08-26 10:44:20 -04:00
Charles Kerr 5994b34a5d
chore: remove unused WinFrameView::kInactiveTitlebarFeatureAlpha (#43448)
added in Aug 2021 (41646d11, #29600) but never used
2024-08-23 20:59:41 -05:00
Charles Kerr 5a1eeea102
perf: prefer GURL string_view getters (#43443)
* chore: avoid double-call to url.scheme() in WebContentsZoomController::SetZoomMode()

* perf: use gurl.scheme_piece() in GetAppInfoHelperForProtocol()

* perf: use gurl.scheme_piece() in Browser::GetApplicationNameForProtocol()

* refactor: add std::less<> to HandlersMap

This lets us search it using string_view keys

* refactor: ProtocolRegistry::FindRegistered() now takes a std::string_view

* perf: use gurl.scheme_piece() in InspectableWebContents::LoadNetworkResource()

* refactor: ProtocolRegistry::FindIntercepted() now takes a std::string_view

* perf: use gurl.scheme_piece() in SimpleURLLoaderWrapper::GetURLLoaderFactoryForURL()

* perf: use gurl.scheme_piece() in ProxyingURLLoaderFactory::CreateLoaderAndStart()

* perf: use gurl.host_piece() in ElectronWebUIControllerFactory::GetWebUIType()

* perf: use gurl.host_piece() in ElectronWebUIControllerFactory::CreateWebUIControllerForURL()
2024-08-23 17:15:45 -05:00
Charles Kerr 7f34b0e6f5
chore: remove unused method asar::ClearArchives() (#43442)
chore: remove unused asar::ClearArchives()

last use removed in Jun 2021 (b1d1ac65, #29293)
2024-08-23 14:53:01 -05:00
John Kleinschmidt c1eee18e41
test: add -pdf-ready-to-print event to WebContents for testing (#43436) 2024-08-23 12:34:26 -05:00
Shelley Vohr 6e4d90fcdb
fix: ensure bounds stability in `OnWidgetBoundsChanged` (#43431)
* fix: ensure bounds stability in OnWidgetBoundsChanged

* Update shell/browser/native_window_views.cc

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

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-08-23 11:02:05 -04:00
Alexander Cyon ca0837c852
chore: fix typos in 'shell/' folder. (#43373) 2024-08-22 19:48:32 -05:00
reito 1aeca6fd0e
feat: GPU shared texture offscreen rendering (#42953)
* feat: GPU shared texture offscreen rendering

* docs: clarify texture infos that passed by the paint event.

* feat: make gpu osr spec test optional

* fix: osr image compare

* fix: remove duplicate test

* fix: update patch file

* fix: code review

* feat: expose more metadata

* feat: use better switch design

* feat: add warning when user forget to release the texture.

* fix: typo

* chore: update patch

* fix: update patch

* fix: update patch description

* fix: update docs

* fix: apply suggestions from code review

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

* fix: apply suggested fixes

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-08-22 19:23:13 -05:00
Shelley Vohr 4ae43dcb3b
fix: touch bar functionality on BaseWindow (#43353)
* fix: touch bar functionality on BaseWindow

* test: add test for BaseWindow.setTouchBar
2024-08-22 12:48:25 +02:00
Charles Kerr 4fbf18a021
refactor: move impl functions into private namespace (#43372) 2024-08-21 15:26:06 -05:00
Charles Kerr 93a6f3e607
refactor: NodeBindings::Create() returns a unique_ptr (#43361)
* refactor: NodeBindings::Create() returns a unique_ptr

* empty commit
2024-08-20 15:34:59 -04:00
Charles Kerr a2de94dda1
chore: remove unused ConvertableToTraceFormatWrapper (#43356)
* chore: remove unused ConvertableToTraceFormatWrapper

Last use removed in Apr 2024 (39bf441b, #41880)

* fixup! chore: remove unused ConvertableToTraceFormatWrapper

remove now-unused trace_event.h header, too
2024-08-20 15:21:43 -04:00
electron-roller[bot] 2cc14c6e8f
chore: bump chromium to 129.0.6668.0 (main) (#43368)
* chore: bump chromium in DEPS to 129.0.6668.0

* 5787687: [Extensions] Remove EventRouterForwarder from BrowserProcess

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

* 5788808: Resolve Blob URL's origin using info from browser process

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

* chore: fixup patch indices

* 5786747: Remove "int WriteFile"

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

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-08-20 16:54:27 +02:00
Charles Kerr 3186c2f0ef
refactor: remove unused SetWMSpecState (#43347)
last use removed in Aug 2022 by 53cd2315 #35179
2024-08-19 17:15:19 -04:00
Charles Kerr 44e4e4521c
chore: remove unused method Erase() (#43348)
Last use removed in Mar 2018 by 4b39d17e
2024-08-19 17:14:57 -04:00
Vít Černý 189675575c
feat: extend navigationHistory API (#42014)
* feat: extend navigationHistory API

* refactor: simplify index checking

* refactor: rename 'getHistory' and 'replaceHistory' methods of navigationHistory

* refactor: rename delete*() methods to remove*()

* feat: remove navigationHistory.replaceHistory()

* tests: add tests for removeEntryAtIndex and getAllEntries
2024-08-19 15:46:04 -04:00
electron-roller[bot] 4c3014944c
chore: bump chromium to 129.0.6664.0 (main) (#43329)
* chore: bump chromium in DEPS to 129.0.6657.0

* chore: update patches

* chore: bump chromium in DEPS to 129.0.6658.0

* chore: update patches

* 5743786: [ServiceWorker] Populate service worker start token to WorkerId.

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

* 5784424: [Extensions] Move ownership of Dispatcher to ExtensionsRendererClient

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

* chore: bump chromium in DEPS to 129.0.6659.0

* chore: bump chromium in DEPS to 129.0.6660.0

* chore: update patches

* chore: bump chromium in DEPS to 129.0.6662.0

* chore: bump chromium in DEPS to 129.0.6664.0

* 5789627: [Partitioned Popins] (3) `popin` feature triggers third-party storage partitioning

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

* 5791367: Remove some chrome:: namespace from chrome/browser/app_mode/*

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

* 5791522: [SCK] Skip redundant getShareableContentWithCompletionHandler

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

* 5761330: Send refresh rate prefs b/w RefreshRateController and DisplayPrivate

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

* chore: fixup patch indices

* 5793591: Remove unused GetHeader overload

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

* 5787624: [Extensions] Simplify ExtensionsRendererClient::RenderThreadStarted()

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

* 5721709: Fix Incorrect last_accessed_time Tracking for Tabs

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

* 5789215: [Extensions] Add a //chrome/common/extensions build target

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

* Roll V8 from 48f669a0758c to eee3eb91d01c

48f669a075..eee3eb91d0

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2024-08-19 14:52:53 -04:00
Shelley Vohr 4801a54d08
refactor: migrate deprecated `platform_util_mac` calls (#43161)
refactor: migrate deprecated platform_util_mac calls
2024-08-15 10:53:38 -04:00
electron-roller[bot] a7c52f1fb2
chore: bump chromium to 129.0.6656.0 (main) (#43323)
* chore: bump chromium in DEPS to 129.0.6656.0

* chore: update patches

* 5750664: Introduce Signin.NumberOfActiveAccounts.* metrics

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

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2024-08-14 16:47:37 -04:00
Shelley Vohr 286384258b
fix: blank page when printing pdf (#43309) 2024-08-14 15:47:47 -04:00
Robo 9b166b3ed4
feat: support app#login event for utility process net requests (#42631)
* feat: support app#login event for utility process net requests

* chore: address review feedback

* GlobalRequestID: Avoid unwanted inlining and narrowing int conversions

Refs https://chromium-review.googlesource.com/c/chromium/src/+/5702737
2024-08-14 11:36:47 +09:00
Charles Kerr bba31189a0
feat: accept-encoding zstd (#43150)
* fix: accept-encoding zstd

* Update shell/browser/net/system_network_context_manager.cc

Co-authored-by: Sam Maddock <smaddock@slack-corp.com>

* chore: make lint happy

---------

Co-authored-by: Sam Maddock <smaddock@slack-corp.com>
2024-08-12 10:00:04 -04:00
Shelley Vohr d294871980
chore: deprecate `textured` BrowserWindow `type` option on macOS (#43133) 2024-08-12 10:32:35 +02:00
electron-roller[bot] c9b7806418
chore: bump chromium to 129.0.6650.0 (main) (#43266)
* chore: bump chromium in DEPS to 129.0.6645.0

* chore: update patches

* chore: bump chromium in DEPS to 129.0.6646.0

* refactor: remove ppapi dependency

PPAPI removal - https://issues.chromium.org/issues/40511450
PDF viewer migration - https://issues.chromium.org/issues/40511452

* chore: update patches

* chore: enable `content_enable_legacy_ipc`

We were indirectly relying on this via `enable_ppapi=true`, with
633a57d9b6 ppapi is now disabled and
this commit makes the dependency explicit.

* fix: gn check

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2024-08-12 10:28:33 +02:00
Charles Kerr 23bcca3ffc
refactor: put empty virtual function definitions in header (#43285)
* refactor: in FramelessView, move empty function decls to header

* refactor: in electron::api::WebContents, move empty function decls to header

* refactor: in electron::api::NativeWindow, move empty function decls to header

* refactor: in electron::OffScreenWebContentsView, move empty function decls to header

* refactor: in electron::OffScreenRenderWidgetHostView, move empty function decls to header

* refactor: in auto_updater::AutoUpdater, move empty function decls to header

* refactor: in electorn::api::FrameSubscriber, move empty function decls to header

* refactor: in electorn::api::SimpleURLLoaderWrapper, move empty function decls to header

* refactor: in electorn::InspectableWebContents, move empty function decls to header

* refactor: in electorn::OffScreenVideoConsumer, move empty function decls to header

* refactor: in electron::OffScreenWebContentsView, move empty function decls to header

* refactor: in electron::TrayIcon, move empty function decls to header

* refactor: in electron::ViewsDelegate, move empty function decls to header

* refactor: in electron::MediaCaptureDevicesDispatcher, move empty function decls to header

* refactor: in electron::UsbChooserContext::DeviceObserver, move empty function decls to header

* refactor: in electron::ProxyingWebSocket, move empty function decls to header

* refactor: in electron::Notification, move empty function decls to header

* refactor: in electron::PlatformNotificationService, move empty function decls to header

* Revert "refactor: in electron::PlatformNotificationService, move empty function decls to header"

This reverts commit 9103750d03b9ba1ceccba43d11dfdc2404ff6191.

* refactor: in electron::ElectronPDFDocumentHelperClient, move empty function decls to header

* refactor: in electron::api::SpellCheckClient, move empty function decls to header

* refactor: in electron::ElectronExtensionHostDelegate, move empty function decls to header

* refactor: in electron::PlatformNotificationService, move empty function decls to header

* refactor: in electron::NativeWindowViews, move empty function decls to header

* chore: move SetTouchBar() back to cc

* Revert "refactor: in auto_updater::AutoUpdater, move empty function decls to header"

This reverts commit c43d6862d3.
2024-08-12 09:56:51 +02:00
Charles Kerr bff298987f
chore: remove unused Notification fields icon_path_, has_icon_ (#43286)
Last use of `icon_path_` was removed on May 29, 2017 (c741b584)
Last use of `has_icon_` was removed on May 30, 2017 (5048425e)
2024-08-12 09:55:54 +02:00
Shelley Vohr 6d13c503c5
refactor: update chrome.scripting extensions api impls (#43205) 2024-08-11 21:31:37 +02:00
Charles Kerr 7721fdf886
chore: remove unused method ElectronDesktopWindowTreeHostLinux::UpdateClientDecorationHints() (#43283)
Xref: dff980c9c2

Removed in #41868
2024-08-10 18:55:10 -05:00
Charles Kerr c35739d60d
refactor: use url::DomainIs() to check cookie domains (#43262)
* test: add tests to exercise pre-exsiting cookie domain matching behavior

* refactor: use url::DomainIs() to match cookie domains

* docs: fix typo
2024-08-09 18:35:18 -05:00
Charles Kerr c4dfff9844
fix: accidental handle copying in a range loop (#43260)
fix: accidental handle copying

Xref: https://github.com/electron/electron/pull/37857
2024-08-09 13:38:03 -05:00
Shelley Vohr f49f6ff68b
fix: check screen capture permissions in `desktopCapturer` (#43080)
fix: check screen capture permissions in desktopCapturer
2024-08-09 10:08:49 +02:00
Shelley Vohr 0718c2b9ee
fix: system-context-menu with frameless BrowserWindows (#43243) 2024-08-09 10:08:01 +02:00
Shelley Vohr 70dda694e2
build: fix build when `enable_pdf_viewer` and `enable_electron_extensions` disabled (#43206)
build: fix build when enable_pdf_viewer and enable_electron_extensions disabled
2024-08-07 14:51:38 +02:00
Charles Kerr 6293bbced0
perf: avoid redundant calls to GetView() (#43216)
* perf: avoid double-calls to GetView()

There are a lot of places where we call the virtual method GetView()
twice in succession: the first to check if the view exists, and the
second to use. This PR holds the view in a temp variable instead, e.g.:

if (auto* view = foo->GetView())
  view->DoSomething();

* perf: avoid discarded GetView() call
2024-08-06 11:25:59 -05:00
Charles Kerr 3d766e9ccb
perf: don't build unused vectors in HidChooserContext (#43192)
* refactor: remove unused code in HidChooserContext::DeviceRemoved()

* refactor: remove unused code in HidChooserContext::OnHidManagerConnectionError()

* refactor: use structured bindings for readability
2024-08-05 15:31:58 +02:00
Charles Kerr 6877671390
fix: gin_helper::MicrotasksScope instantiation (#43185) 2024-08-05 08:24:27 -05:00