* 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:
80c1a9739df49ed30f72
* 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>
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.
* 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 e9cc67216558263402867056ed332f8781da3153.
* should only do these checks for audio or video, but not screenshare
* no service
* oops
---------
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
* 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!
* 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()
* 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
633a57d9b62da7850ef7946f6b101ed440d04cdd 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>
* 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 c43d6862d32c74f63f82700a7546a732ac05ecb8.
* 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
* chore: bump chromium in DEPS to 129.0.6634.0
* chore: update chore_add_electron_deps_to_gitignores.patch
no manual changes. patch applied with fuzz 1.
* chore: e patches all
* chore: update call to gfx::Image::CreateFrom1xPNGBytes()
Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5743597
The call now takes a base::span
---------
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* fix: handle failing to enter/exit fullscreen on macOS
On macOS, failing to enter/exit fullscreen can fail. If this happens,
properly restore the original window state.
* refactor: remove fail to exit fullscreen handlers
Seem to be unnecessary since the window exits fullscreen anyway.
* fix: vibrant view is inserted into Views API hierarchy (#42263)
* Update shell/browser/native_window_mac.mm
Co-authored-by: Charles Kerr <charles@charleskerr.com>
---------
Co-authored-by: Hans Halverson <hans_halverson@alumni.brown.edu>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* chore: remove unused electron::ObjectLifeMonitor
The last users were removed in June 2020 e1e73fa5f (#24115)
and May 2020 9d7ba982 (#23592).
* fixup! chore: remove unused electron::ObjectLifeMonitor
fix: oops
`.destroy()` is an important method in the lifecycle of a Node.js
Readable stream. It is typically called to reclaim the resources
(e.g., close file descriptor). The only situations where calling
it manually isn't necessary are when the following events are
emitted first:
- `end`: natural end of a stream
- `error`: stream terminated due to a failure
Prior to this commit the ended state was incorrectly tracked together
with a pending internal error. It led to situations where the request
could get aborted during a read and then get marked as ended (having
pending error).
With this change we disentangle pending "error" and "destroyed" cases to
always properly terminate an active Node.js Readable stream.
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
* avoid crash of operation on an invalid entry while erase set iterator.
* fix notification removal crash due to the nullptr presenter
---------
Co-authored-by: bill.shen <shenyb32768@gmail.com>
* chore: bump chromium in DEPS to 128.0.6577.0
* chore: bump chromium in DEPS to 128.0.6579.0
* 5675706: Reland "Reland "Reland "Reland "Add toolchains without PartitionAlloc-Everywhere for dump_syms et al""""
https://chromium-review.googlesource.com/c/chromium/src/+/5675706
* 5668597: [PDF Ink Signatures] Prompt download menu on save when there are edits
https://chromium-review.googlesource.com/c/chromium/src/+/5668597
* 5677014: Reland "Pull data_sharing_sdk from CIPD"
https://chromium-review.googlesource.com/c/chromium/src/+/5677014
* chore: fixup patch indices
* chore: bump chromium in DEPS to 128.0.6581.0
* chore: bump chromium in DEPS to 128.0.6583.0
* update patches
* 5455480: [Extensions] Allow service worker requests to continue without a cert
https://chromium-review.googlesource.com/c/chromium/src/+/5455480
* try to get some debugging output from script/push-patch.js
* chore: bump chromium in DEPS to 128.0.6585.0
* chore: bump chromium in DEPS to 128.0.6587.0
* update patches
* chore: bump chromium in DEPS to 128.0.6589.0
* more patch work
* maybe over here?
* chore: update patches
* 5673207: [HTTPS Upgrades] Disable in captive portal login webview
https://chromium-review.googlesource.com/c/chromium/src/+/5673207
* 5636785: Extensions: WAR: manifest.json's use_dynamic_url requires a dynamic url
https://chromium-review.googlesource.com/c/chromium/src/+/5636785
* chore: bump chromium in DEPS to 128.0.6591.0
* 5665458: Trigger WN2 page when feature is enabled
https://chromium-review.googlesource.com/c/chromium/src/+/5665458
* update patches
* chore: bump chromium in DEPS to 128.0.6593.0
* chore: bump chromium in DEPS to 128.0.6595.0
* chore: bump chromium in DEPS to 128.0.6597.0
* (patch update) 5694586: [compile hints] Remove the usage of v8::Isolate::SetJavaScriptCompileHintsMagicEnabledCallback API
https://chromium-review.googlesource.com/c/chromium/src/+/5694586
* update patches
* 5691287: Reland "Change blink::WebKeyboardEvent to use std::array in is members"
https://chromium-review.googlesource.com/c/chromium/src/+/5691287
The code changed here is modeled after code in `content/renderer/pepper/event_conversion.cc` that was also modified in this CL, so I took the same approach.
* 5529018: Cleanup EnableWebHidOnExtensionServiceWorker flag
https://chromium-review.googlesource.com/c/chromium/src/+/5529018
* 5526324: [Code Health] Add deprecation comment for base::SupportsWeakPtr.
https://chromium-review.googlesource.com/c/chromium/src/+/5526324
Note that this CL actually does make `SupportsWeakPtr` strictly restricted to existing implementations, no new ones. We could add a patch to add ourselves to this list, but it looks like we'll have to refactor this anyways in the near future. Since the refactor seems straightforward, let's try that first.
* chore: bump chromium in DEPS to 128.0.6598.0
* chore: update patches
* 5704737: Rename ExclusiveAccessContext::GetActiveWebContents to avoid conflict
https://chromium-review.googlesource.com/c/chromium/src/+/5704737
* chore: bump chromium in DEPS to 128.0.6601.0
* chore: update patches
* Add `base::StringPiece` header includes
Chromium is working on replacing `base::StringPiece` with `std::string_view`. (See the Chromium Bug below.) They're currently running mass codemods (across many multiple changes) to replace uses of `StringPiece` with `string_view`, including removing the header include for `StringPiece` in those files. This cascades down to our files that were implicitly depending on those includes through some other include.
They're on track to eventually deprecate and remove `StringPiece` so our code should be converted, but that can be done as an upgrade follow-up task. For now, adding the header back to files that need it should suffice for minimal upgrade changes.
Chromium Bug: https://issues.chromium.org/issues/40506050
* 5702737: GlobalRequestID: Avoid unwanted inlining and narrowing int conversions
https://chromium-review.googlesource.com/c/chromium/src/+/5702737
contender for smallest commit 2024
* 5706534: Rename GlobalFeatures to GlobalDesktopFeatures.
https://chromium-review.googlesource.com/c/chromium/src/+/5706534
* 5691321: ui: remove params variants of SelectFile listener functions
https://chromium-review.googlesource.com/c/chromium/src/+/5691321
* 5714949: [Extensions] Display re-enable dialog for MV2 disabled stage
https://chromium-review.googlesource.com/c/chromium/src/+/5714949
* chore: update libc++ filenames
* patch: disable scope reuse & associated dchecks in v8 (hopefully temp, upgrade follow-up)
* fixup! Add `base::StringPiece` header includes
* update MAS patch
5710330: Add crash keys to debug NativeWidgetMacNSWindowBorderlessFrame exception
https://chromium-review.googlesource.com/c/chromium/src/+/5710330
* chore: bump chromium in DEPS to 128.0.6603.0
* chore: update patches
* 5713258: Reland "Preparation for decoupling creation/initialization of context"
https://chromium-review.googlesource.com/c/chromium/src/+/5713258
When destroying a context, it must already be shutdown, and this change enforces it with a new CHECK.
We were overriding `BrowserContextKeyedServiceFactory::BrowserContextShutdown` with an empty implementation, which differed from the default implementation that notifies the `KeyedServiceFactory` that the context has shutdown. Since we were missing this notification, the CHECK would later trip when the service was being destoryed because it was not registered as shutdown when it was shutdown.
* chore: bump chromium in DEPS to 128.0.6605.2
* chore: update patches
* refactor: linux open/save dialog patch
Our existing implementation was relying on an opaque `void* params` parameter that was passed through `ui::SelectFileDialog`.
Recently, that parameter has been getting removed:
- 5691321: ui: remove params variants of SelectFile listener functions | https://chromium-review.googlesource.com/c/chromium/src/+/5691321
- 5709097: ui: remove SelectFileDialog impl params | https://chromium-review.googlesource.com/c/chromium/src/+/5709097
- https://issues.chromium.org/issues/340178601 "reconsider SelectFileDialog"
This restructures the patch to work with mostly the same mechanics, but directly on the `ui::SelectFileDialog` object. This nets us some wins in terms of a smaller patch.
* 5713262: DevTools UI binding AIDA client event returns response
https://chromium-review.googlesource.com/c/chromium/src/+/5713262
* fixup! refactor: linux open/save dialog patch
* chore: bump chromium in DEPS to 128.0.6606.0
* chore: update patches
* fixup! refactor: linux open/save dialog patch
* chore: bump chromium in DEPS to 128.0.6607.0
* chore: update printing.patch
Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5722937
* fix: pwd error in electron-test, nan-test
fix: unshallow depot_tools before 3-way apply
* chore: e patches all
* fixup! fix: pwd error in electron-test, nan-test
* chore: bump chromium in DEPS to 128.0.6609.0
* chore: bump chromium in DEPS to 128.0.6611.0
* chore: update patches
* chore: update libcxx filenames
---------
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: Jeremy Rose <nornagon@nornagon.net>
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: Alice Zhao <alice@makenotion.com>
* feat: Implement password delegate for NSS (#41188)
Introduce an app event client-certificate-request-password. It allows
the user to display a UI to prompt for the password.
An alternative would have been to implement a class similar to
CryptoModulePasswordDialogView, to provide the UI. This might have been
simpler for the user, comparing to letting them implement the UI. But it
seems like electron does not have an i18n framework, so it's not
possible to provide a locale aware UI.
* fix lint:markdown error
* address review comments
* use a trampoline handler in JS. The api exposed is now app.setClientCertRequestPasswordHandler
* use properties on the Event object instead of positional parameters
* remove ChromeNSSCryptoModuleDelegate::OnPassword in favor of args->GetNext(&password_)
* address review comments second round
- backslash escape parametrized TypeScript
- rename hostName param to hostname
- use base::ScopedAllowBaseSyncPrimitivesForTesting
- and then, rename ChromeNSSCryptoModuleDelegate to ElectronNSSCryptoModuleDelegate
* Update docs/api/app.md
Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>
* Update docs/api/app.md
Co-authored-by: Erick Zhao <erick@hotmail.ca>
---------
Co-authored-by: Arno Renevier <arnaud@switchboard.app>
Co-authored-by: Sam Maddock <samuel.maddock@gmail.com>
Co-authored-by: Erick Zhao <erick@hotmail.ca>
On the Mac platform, OffScreenWebContentsView uses Automatic Reference
Counting (ARC) to handle the lifecycle of offScreenView_. However, this
private member variable is not initialized and its value is undefined.
In some cases, it is initialized to a garbage value, which may cause ARC
to release the value incorrectly, resulting in a crash.
* feat: add View#setBorderRadius
test: initial setBorderRadius tests
fix: robustly set border radius
chore: add PAUSE_CAPTURE_TESTS for easier screencap dev
feat: add view border radius support
test: view border radius
refactor: cleanup view code
* maybe delay capture to fix tests?
* refactor: retry screen captures in an attempt to fix flakiness
* refactor: ScreenCapture constructor no longer async
* increase screen capture timeout, feels a little short
* refactor: move rounded rect util into chromium_src
* skip some capture tests on mas
All the listener functions are empty stubs (and have been since d4e3c39)
so it doesn't seem like we need a listener?
SpeechRecognitionManagerDelegate declares this method:
> // Checks whether the delegate is interested (returning a non nullptr
> // ptr) or not (returning nullptr) in receiving a copy of all sessions
> // events. This is called on the IO thread.
> virtual SpeechRecognitionEventListener* GetEventListener() = 0;
This PR has ElectronSpeechRecognitionManagerDelegate stop subclassing
from the Listener and changes GetEventListener() to return nullptr.
The extension system is freed by the DestroyBrowserContextServices()
call in the destructor, so we need to zero out the pointer to avoid
a dangling raw_ptr error.