mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
17 Commits
mp-33-x-y-
...
alice-fix-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9dc42a304 | ||
|
|
08d8163201 | ||
|
|
204e195b6f | ||
|
|
eb621e7c9c | ||
|
|
08dbb388e5 | ||
|
|
739df86774 | ||
|
|
9a087b9c56 | ||
|
|
8b3f2c5d7c | ||
|
|
ad9bf6b041 | ||
|
|
32822cd747 | ||
|
|
e1419b2fdf | ||
|
|
11c2b61011 | ||
|
|
6b458c78b0 | ||
|
|
77324ff514 | ||
|
|
63d1d9cb65 | ||
|
|
dd5bce17cb | ||
|
|
258a4a76cf |
@@ -2,7 +2,7 @@ version: '3'
|
||||
|
||||
services:
|
||||
buildtools:
|
||||
image: ghcr.io/electron/devcontainer:9a43c14f5c19be0359843299f79e736521373adc
|
||||
image: ghcr.io/electron/devcontainer:77262e58c37631ab082482f42c33cdf68c6c394b
|
||||
|
||||
volumes:
|
||||
- ..:/workspaces/gclient/src/electron:cached
|
||||
|
||||
@@ -6,6 +6,6 @@ runs:
|
||||
- name: Install Build Tools
|
||||
shell: bash
|
||||
run: |
|
||||
export BUILD_TOOLS_SHA=d5b87591842be19058e8d75d2c5b7f1fabe9f450
|
||||
export BUILD_TOOLS_SHA=eeb1a11392e4cec08fd926c93b31ab556dc0c23b
|
||||
npm i -g @electron/build-tools
|
||||
e auto-update disable
|
||||
|
||||
@@ -164,7 +164,7 @@ jobs:
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Init Build Tools
|
||||
run: |
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }} --only-sdk
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||
- name: Run Electron Only Hooks
|
||||
run: |
|
||||
gclient runhooks --spec="solutions=[{'name':'src/electron','url':None,'deps_file':'DEPS','custom_vars':{'process_deps':False},'managed':False}]"
|
||||
@@ -177,18 +177,9 @@ jobs:
|
||||
- name: Fix Sync (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/fix-sync-macos
|
||||
- name: Install build-tools & Setup RBE
|
||||
- name: Setup Number of Ninja Processes
|
||||
run: |
|
||||
echo "NUMBER_OF_NINJA_PROCESSES=${{ inputs.target-platform == 'linux' && '300' || '200' }}" >> $GITHUB_ENV
|
||||
cd ~/.electron_build_tools
|
||||
npx yarn --ignore-engines
|
||||
# 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 'RBE_service='`node -e "console.log(require('./src/utils/reclient.js').serviceAddress)"` >> $GITHUB_ENV
|
||||
echo 'RBE_experimental_credentials_helper='`node -e "console.log(require('./src/utils/reclient.js').helperPath({}))"` >> $GITHUB_ENV
|
||||
echo 'RBE_experimental_credentials_helper_args=print' >> $GITHUB_ENV
|
||||
- name: Free up space (macOS)
|
||||
if: ${{ inputs.target-platform == 'macos' }}
|
||||
uses: ./src/electron/.github/actions/free-space-macos
|
||||
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
uses: ./src/electron/.github/actions/install-build-tools
|
||||
- name: Init Build Tools
|
||||
run: |
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }} --only-sdk
|
||||
e init -f --root=$(pwd) --out=Default ${{ inputs.gn-build-type }} --import ${{ inputs.gn-build-type }} --target-cpu ${{ inputs.target-arch }}
|
||||
- name: Get Depot Tools
|
||||
timeout-minutes: 5
|
||||
run: |
|
||||
|
||||
2
DEPS
2
DEPS
@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
|
||||
|
||||
vars = {
|
||||
'chromium_version':
|
||||
'130.0.6723.44',
|
||||
'130.0.6723.59',
|
||||
'node_version':
|
||||
'v20.18.0',
|
||||
'nan_version':
|
||||
|
||||
@@ -128,8 +128,6 @@ for:
|
||||
if ($env:ELECTRON_RBE_JWT -eq '') {
|
||||
$env:RBE_fail_early_min_action_count = "0"
|
||||
$env:RBE_fail_early_min_fallback_ratio = "0"
|
||||
$env:RBE_exec_strategy = "local"
|
||||
$env:RBE_remote_update_cache= "false"
|
||||
}
|
||||
- cd ..\..
|
||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
||||
@@ -158,7 +156,7 @@ for:
|
||||
- gn check out/Default //electron:electron_app
|
||||
- gn check out/Default //electron/shell/common:mojo
|
||||
- gn check out/Default //electron/shell/common:plugin
|
||||
- if DEFINED ELECTRON_RBE_JWT (autoninja -j 300 -C out/Default electron:electron_app) else (autoninja -C out/Default electron:electron_app)
|
||||
- autoninja -j 300 -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\") use_remoteexec=true %GN_EXTRA_ARGS%"
|
||||
- autoninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
||||
|
||||
@@ -123,8 +123,6 @@ for:
|
||||
if ($env:ELECTRON_RBE_JWT -eq '') {
|
||||
$env:RBE_fail_early_min_action_count = "0"
|
||||
$env:RBE_fail_early_min_fallback_ratio = "0"
|
||||
$env:RBE_exec_strategy = "local"
|
||||
$env:RBE_remote_update_cache= "false"
|
||||
}
|
||||
- cd ..\..
|
||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
||||
@@ -153,7 +151,7 @@ for:
|
||||
- gn check out/Default //electron:electron_app
|
||||
- gn check out/Default //electron/shell/common:mojo
|
||||
- gn check out/Default //electron/shell/common:plugin
|
||||
- if DEFINED ELECTRON_RBE_JWT (autoninja -j 300 -C out/Default electron:electron_app) else (autoninja -C out/Default electron:electron_app)
|
||||
- autoninja -j 300 -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\") use_remoteexec=true %GN_EXTRA_ARGS%"
|
||||
- autoninja -C out/ffmpeg electron:electron_ffmpeg_zip
|
||||
|
||||
@@ -9,10 +9,11 @@ check out our [Electron Versioning](./electron-versioning.md) doc.
|
||||
|
||||
| Electron | Alpha | Beta | Stable | EOL | Chrome | Node | Supported |
|
||||
| ------- | ----- | ------- | ------ | ------ | ---- | ---- | ---- |
|
||||
| 33.0.0 | 2024-Aug-22 | 2024-Sep-18 | 2024-Oct-15 | 2025-Apr-29 | M130 | TBD | ✅ |
|
||||
| 34.0.0 | 2024-Oct-17 | 2024-Nov-13 | 2024-Jan-07 | 2025-Jun-24 | M132 | TBD | ✅ |
|
||||
| 33.0.0 | 2024-Aug-22 | 2024-Sep-18 | 2024-Oct-15 | 2025-Apr-29 | M130 | v20.18 | ✅ |
|
||||
| 32.0.0 | 2024-Jun-14 | 2024-Jul-24 | 2024-Aug-20 | 2025-Mar-04 | M128 | v20.16 | ✅ |
|
||||
| 31.0.0 | 2024-Apr-18 | 2024-May-15 | 2024-Jun-11 | 2025-Jan-07 | M126 | v20.14 | ✅ |
|
||||
| 30.0.0 | 2024-Feb-22 | 2024-Mar-20 | 2024-Apr-16 | 2024-Oct-15 | M124 | v20.11 | ✅ |
|
||||
| 30.0.0 | 2024-Feb-22 | 2024-Mar-20 | 2024-Apr-16 | 2024-Oct-15 | M124 | v20.11 | 🚫 |
|
||||
| 29.0.0 | 2023-Dec-07 | 2024-Jan-24 | 2024-Feb-20 | 2024-Aug-20 | M122 | v20.9 | 🚫 |
|
||||
| 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 | 🚫 |
|
||||
|
||||
@@ -680,8 +680,8 @@ filenames = {
|
||||
"shell/common/skia_util.cc",
|
||||
"shell/common/skia_util.h",
|
||||
"shell/common/thread_restrictions.h",
|
||||
"shell/common/v8_value_serializer.cc",
|
||||
"shell/common/v8_value_serializer.h",
|
||||
"shell/common/v8_util.cc",
|
||||
"shell/common/v8_util.h",
|
||||
"shell/common/world_ids.h",
|
||||
"shell/renderer/api/context_bridge/object_cache.cc",
|
||||
"shell/renderer/api/context_bridge/object_cache.h",
|
||||
|
||||
@@ -130,4 +130,3 @@ chore_remove_reference_to_chrome_browser_themes.patch
|
||||
feat_enable_customizing_symbol_color_in_framecaptionbutton.patch
|
||||
build_expose_webplugininfo_interface_to_electron.patch
|
||||
feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch
|
||||
feat_allow_-4_as_a_macos_screen_share_id.patch
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Fedor Indutny <indutny@signal.org>
|
||||
Date: Tue, 17 Sep 2024 17:51:46 -0700
|
||||
Subject: feat: allow -4 as a macos screen share id
|
||||
|
||||
We use fake video source ids for native macOS screen share window picker
|
||||
of the following form:
|
||||
|
||||
window:-4:-1
|
||||
|
||||
Where the last digit represents the window id and decrements with each
|
||||
requested screen share.
|
||||
|
||||
diff --git a/content/browser/media/capture/screen_capture_kit_device_mac.mm b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
index 1c2d0c6dd4101fe0bac69e3018bbbedadce224cc..e407382a3463374fd57a83d70c5f96dca5825faf 100644
|
||||
--- a/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
+++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
@@ -510,7 +510,9 @@ void OnStart(std::optional<bool> use_native_picker) override {
|
||||
|
||||
if (@available(macOS 15.0, *)) {
|
||||
constexpr bool DefaultUseNativePicker = true;
|
||||
- if (use_native_picker.value_or(DefaultUseNativePicker) && source_.id < 0 && source_.window_id == 0) {
|
||||
+ if (use_native_picker.value_or(DefaultUseNativePicker) &&
|
||||
+ source_.id == DesktopMediaID::kMacOsNativePickerId &&
|
||||
+ source_.window_id < 0) {
|
||||
auto* picker = [SCContentSharingPicker sharedPicker];
|
||||
ScreenCaptureKitDeviceMac::active_streams_++;
|
||||
picker.maximumStreamCount = @(ScreenCaptureKitDeviceMac::active_streams_);
|
||||
diff --git a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
|
||||
index d162612dc70a2b57190aaf558aca8f46cbdedcad..bab2f0282b191a4263fc964125e199e52c62554b 100644
|
||||
--- a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
|
||||
+++ b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
|
||||
@@ -332,8 +332,16 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
break;
|
||||
}
|
||||
|
||||
+#if defined(USE_AURA)
|
||||
+ bool allow_window_id = false;
|
||||
+#elif BUILDFLAG(IS_MAC)
|
||||
+ bool allow_window_id =
|
||||
+ desktop_id.id == DesktopMediaID::kMacOsNativePickerId;
|
||||
+#endif
|
||||
+
|
||||
#if defined(USE_AURA) || BUILDFLAG(IS_MAC)
|
||||
- if (desktop_id.window_id != DesktopMediaID::kNullId) {
|
||||
+ if (!allow_window_id &&
|
||||
+ desktop_id.window_id != DesktopMediaID::kNullId) {
|
||||
// For the other capturers, when a bug reports the type of capture it's
|
||||
// easy enough to determine which capturer was used, but it's a little
|
||||
// fuzzier with window capture.
|
||||
diff --git a/content/public/browser/desktop_media_id.h b/content/public/browser/desktop_media_id.h
|
||||
index 415156d403a59bf426cf4561a9d58ecdb27524b4..78aa7b2359c684d5305bf6352751dfbb7ca00d29 100644
|
||||
--- a/content/public/browser/desktop_media_id.h
|
||||
+++ b/content/public/browser/desktop_media_id.h
|
||||
@@ -27,6 +27,8 @@ struct CONTENT_EXPORT DesktopMediaID {
|
||||
static constexpr Id kNullId = 0;
|
||||
// Represents a fake id to create a dummy capturer for autotests.
|
||||
static constexpr Id kFakeId = -3;
|
||||
+ // Represents an id to use native macOS picker for screenshare
|
||||
+ static constexpr Id kMacOsNativePickerId = -4;
|
||||
|
||||
#if defined(USE_AURA) || BUILDFLAG(IS_MAC)
|
||||
// Assigns integer identifier to the |window| and returns its DesktopMediaID.
|
||||
@@ -46,7 +46,7 @@ index 8ac12480f663a74dfbdcf7128a582a81b4474d25..db6802a2603e1d3c3039e49737438124
|
||||
// OnStop is called by StopAndDeAllocate.
|
||||
virtual void OnStop() = 0;
|
||||
diff --git a/content/browser/media/capture/screen_capture_kit_device_mac.mm b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbedadce224cc 100644
|
||||
index b6129282c6807702cf88e0a3e2ba233e41a20960..87a00302de8db47299b185471e303b9e172e9c76 100644
|
||||
--- a/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
+++ b/content/browser/media/capture/screen_capture_kit_device_mac.mm
|
||||
@@ -24,24 +24,83 @@
|
||||
@@ -143,7 +143,7 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
public:
|
||||
explicit ScreenCaptureKitDeviceMac(const DesktopMediaID& source,
|
||||
SCContentFilter* filter)
|
||||
@@ -152,18 +212,41 @@ explicit ScreenCaptureKitDeviceMac(const DesktopMediaID& source,
|
||||
@@ -152,18 +212,42 @@ explicit ScreenCaptureKitDeviceMac(const DesktopMediaID& source,
|
||||
device_task_runner_,
|
||||
base::BindRepeating(&ScreenCaptureKitDeviceMac::OnStreamSample,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
@@ -165,8 +165,8 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
+ device_task_runner_,
|
||||
+ base::BindRepeating(&ScreenCaptureKitDeviceMac::OnContentFilterReady, weak_factory_.GetWeakPtr())
|
||||
+ );
|
||||
+ auto* picker_observer = [[ScreenCaptureKitPickerHelper alloc] initWithStreamPickCallback:picker_callback cancelCallback:cancel_callback errorCallback:error_callback];
|
||||
+ [[SCContentSharingPicker sharedPicker] addObserver:picker_observer];
|
||||
+ picker_helper_ = [[ScreenCaptureKitPickerHelper alloc] initWithStreamPickCallback:picker_callback cancelCallback:cancel_callback errorCallback:error_callback];
|
||||
+ [[SCContentSharingPicker sharedPicker] addObserver:picker_helper_];
|
||||
+ }
|
||||
}
|
||||
ScreenCaptureKitDeviceMac(const ScreenCaptureKitDeviceMac&) = delete;
|
||||
@@ -180,13 +180,14 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
+ picker.maximumStreamCount = @(ScreenCaptureKitDeviceMac::active_streams_);
|
||||
+ if (ScreenCaptureKitDeviceMac::active_streams_ == 0 && picker.active) {
|
||||
+ picker.active = false;
|
||||
+ [[SCContentSharingPicker sharedPicker] removeObserver:picker_helper_];
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
void OnShareableContentCreated(SCShareableContent* content) {
|
||||
DCHECK(device_task_runner_->RunsTasksInCurrentSequence());
|
||||
@@ -232,7 +315,7 @@ void CreateStream(SCContentFilter* filter) {
|
||||
@@ -232,7 +316,7 @@ void CreateStream(SCContentFilter* filter) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -195,7 +196,7 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
// Update the content size. This step is neccessary when used together
|
||||
// with SCContentSharingPicker. If the Chrome picker is used, it will
|
||||
// change to retina resolution if applicable.
|
||||
@@ -241,6 +324,9 @@ void CreateStream(SCContentFilter* filter) {
|
||||
@@ -241,6 +325,9 @@ void CreateStream(SCContentFilter* filter) {
|
||||
filter.contentRect.size.height * filter.pointPixelScale);
|
||||
}
|
||||
|
||||
@@ -205,7 +206,7 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
gfx::RectF dest_rect_in_frame;
|
||||
actual_capture_format_ = capture_params().requested_format;
|
||||
actual_capture_format_.pixel_format = media::PIXEL_FORMAT_NV12;
|
||||
@@ -254,6 +340,7 @@ void CreateStream(SCContentFilter* filter) {
|
||||
@@ -254,6 +341,7 @@ void CreateStream(SCContentFilter* filter) {
|
||||
stream_ = [[SCStream alloc] initWithFilter:filter
|
||||
configuration:config
|
||||
delegate:helper_];
|
||||
@@ -213,7 +214,7 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
{
|
||||
NSError* error = nil;
|
||||
bool add_stream_output_result =
|
||||
@@ -395,7 +482,7 @@ void OnStreamError() {
|
||||
@@ -395,7 +483,7 @@ void OnStreamError() {
|
||||
if (fullscreen_module_) {
|
||||
fullscreen_module_->Reset();
|
||||
}
|
||||
@@ -222,7 +223,7 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
} else {
|
||||
client()->OnError(media::VideoCaptureError::kScreenCaptureKitStreamError,
|
||||
FROM_HERE, "Stream delegate called didStopWithError");
|
||||
@@ -418,23 +505,39 @@ void OnUpdateConfigurationError() {
|
||||
@@ -418,23 +506,41 @@ void OnUpdateConfigurationError() {
|
||||
}
|
||||
|
||||
// IOSurfaceCaptureDeviceBase:
|
||||
@@ -246,7 +247,9 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
+
|
||||
+ if (@available(macOS 15.0, *)) {
|
||||
+ constexpr bool DefaultUseNativePicker = true;
|
||||
+ if (use_native_picker.value_or(DefaultUseNativePicker) && source_.id < 0 && source_.window_id == 0) {
|
||||
+ if (use_native_picker.value_or(DefaultUseNativePicker) &&
|
||||
+ source_.id == DesktopMediaID::kMacOsNativePickerId &&
|
||||
+ source_.window_id < 0) {
|
||||
+ auto* picker = [SCContentSharingPicker sharedPicker];
|
||||
+ ScreenCaptureKitDeviceMac::active_streams_++;
|
||||
+ picker.maximumStreamCount = @(ScreenCaptureKitDeviceMac::active_streams_);
|
||||
@@ -277,7 +280,7 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
}
|
||||
void OnStop() override {
|
||||
DCHECK(device_task_runner_->RunsTasksInCurrentSequence());
|
||||
@@ -492,6 +595,8 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
@@ -492,6 +598,8 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -286,7 +289,18 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
const DesktopMediaID source_;
|
||||
SCContentFilter* const filter_;
|
||||
const scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_;
|
||||
@@ -521,6 +626,8 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
@@ -509,6 +617,10 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
// Helper class that acts as output and delegate for `stream_`.
|
||||
ScreenCaptureKitDeviceHelper* __strong helper_;
|
||||
|
||||
+ // Helper class that acts as an observer for SCContentSharingPicker
|
||||
+ API_AVAILABLE(macos(15.0))
|
||||
+ ScreenCaptureKitPickerHelper* __strong picker_helper_;
|
||||
+
|
||||
// This is used to detect when a captured presentation enters fullscreen mode.
|
||||
// If this happens, the module will call the ResetStreamTo function.
|
||||
std::unique_ptr<ScreenCaptureKitFullscreenModule> fullscreen_module_;
|
||||
@@ -521,6 +633,8 @@ void ResetStreamTo(SCWindow* window) override {
|
||||
base::WeakPtrFactory<ScreenCaptureKitDeviceMac> weak_factory_{this};
|
||||
};
|
||||
|
||||
@@ -296,10 +310,28 @@ index b6129282c6807702cf88e0a3e2ba233e41a20960..1c2d0c6dd4101fe0bac69e3018bbbeda
|
||||
|
||||
// Although ScreenCaptureKit is available in 12.3 there were some bugs that
|
||||
diff --git a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
|
||||
index 7adf8264cfa9980c4a8414bf0f8bfa9ad70ec0b3..d162612dc70a2b57190aaf558aca8f46cbdedcad 100644
|
||||
index 7adf8264cfa9980c4a8414bf0f8bfa9ad70ec0b3..bab2f0282b191a4263fc964125e199e52c62554b 100644
|
||||
--- a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
|
||||
+++ b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
|
||||
@@ -360,13 +360,15 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
@@ -332,8 +332,16 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
break;
|
||||
}
|
||||
|
||||
+#if defined(USE_AURA)
|
||||
+ bool allow_window_id = false;
|
||||
+#elif BUILDFLAG(IS_MAC)
|
||||
+ bool allow_window_id =
|
||||
+ desktop_id.id == DesktopMediaID::kMacOsNativePickerId;
|
||||
+#endif
|
||||
+
|
||||
#if defined(USE_AURA) || BUILDFLAG(IS_MAC)
|
||||
- if (desktop_id.window_id != DesktopMediaID::kNullId) {
|
||||
+ if (!allow_window_id &&
|
||||
+ desktop_id.window_id != DesktopMediaID::kNullId) {
|
||||
// For the other capturers, when a bug reports the type of capture it's
|
||||
// easy enough to determine which capturer was used, but it's a little
|
||||
// fuzzier with window capture.
|
||||
@@ -360,13 +368,15 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
|
||||
std::move(after_start_capture_callback));
|
||||
break;
|
||||
#else
|
||||
@@ -316,6 +348,19 @@ index 7adf8264cfa9980c4a8414bf0f8bfa9ad70ec0b3..d162612dc70a2b57190aaf558aca8f46
|
||||
CreateDeviceClient(media::VideoCaptureBufferType::kSharedMemory,
|
||||
kMaxNumberOfBuffers, std::move(receiver),
|
||||
std::move(receiver_on_io_thread)),
|
||||
diff --git a/content/public/browser/desktop_media_id.h b/content/public/browser/desktop_media_id.h
|
||||
index 415156d403a59bf426cf4561a9d58ecdb27524b4..78aa7b2359c684d5305bf6352751dfbb7ca00d29 100644
|
||||
--- a/content/public/browser/desktop_media_id.h
|
||||
+++ b/content/public/browser/desktop_media_id.h
|
||||
@@ -27,6 +27,8 @@ struct CONTENT_EXPORT DesktopMediaID {
|
||||
static constexpr Id kNullId = 0;
|
||||
// Represents a fake id to create a dummy capturer for autotests.
|
||||
static constexpr Id kFakeId = -3;
|
||||
+ // Represents an id to use native macOS picker for screenshare
|
||||
+ static constexpr Id kMacOsNativePickerId = -4;
|
||||
|
||||
#if defined(USE_AURA) || BUILDFLAG(IS_MAC)
|
||||
// Assigns integer identifier to the |window| and returns its DesktopMediaID.
|
||||
diff --git a/media/capture/video_capture_types.h b/media/capture/video_capture_types.h
|
||||
index f2b75f5b2f547ad135c1288bf3639b26dedc8053..ef18724d9f2ea68a47b66fc3981f58a73ac1b51d 100644
|
||||
--- a/media/capture/video_capture_types.h
|
||||
|
||||
@@ -926,3 +926,23 @@ index 7a65f7f2d68edb74fbaf74fe41949ed9cc198b25..4d7c59e93d71b624d4e93e643932c816
|
||||
namespace sandbox::policy {
|
||||
|
||||
base::FilePath GetCanonicalPath(const base::FilePath& path) {
|
||||
diff --git a/ui/gtk/gtk_util.cc b/ui/gtk/gtk_util.cc
|
||||
index d86fbcf969f2fa0d176ead903703ab612e5464c2..6b963ea8401d20e655d068a69105586814bab320 100644
|
||||
--- a/ui/gtk/gtk_util.cc
|
||||
+++ b/ui/gtk/gtk_util.cc
|
||||
@@ -227,9 +227,13 @@ aura::Window* GetAuraTransientParent(GtkWidget* dialog) {
|
||||
}
|
||||
|
||||
void ClearAuraTransientParent(GtkWidget* dialog, aura::Window* parent) {
|
||||
+ if (!parent || !parent->GetHost()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
g_object_set_data(G_OBJECT(dialog), kAuraTransientParent, nullptr);
|
||||
- GtkUi::GetPlatform()->ClearTransientFor(
|
||||
- parent->GetHost()->GetAcceleratedWidget());
|
||||
+ gfx::AcceleratedWidget parent_id = parent->GetHost()->GetAcceleratedWidget();
|
||||
+ GtkUi::GetPlatform()->ClearTransientFor(parent_id);
|
||||
}
|
||||
|
||||
base::OnceClosure DisableHostInputHandling(GtkWidget* dialog,
|
||||
|
||||
@@ -205,17 +205,6 @@ async function tagRelease (version: string) {
|
||||
}
|
||||
}
|
||||
|
||||
// function to determine if there have been commits to main since the last release
|
||||
async function changesToRelease () {
|
||||
const lastCommitWasRelease =
|
||||
/^Bump v[0-9]+.[0-9]+.[0-9]+(-beta.[0-9]+)?(-alpha.[0-9]+)?(-nightly.[0-9]+)?$/g;
|
||||
const lastCommit = await GitProcess.exec(
|
||||
['log', '-n', '1', "--pretty=format:'%s'"],
|
||||
ELECTRON_DIR
|
||||
);
|
||||
return !lastCommitWasRelease.test(lastCommit.stdout);
|
||||
}
|
||||
|
||||
export async function printNextVersion (options: PrepareReleaseOptions) {
|
||||
const newVersion = await getNewVersion(options, DryRunMode.DRY_RUN);
|
||||
console.log(newVersion);
|
||||
@@ -225,17 +214,9 @@ export async function prepareRelease (options: PrepareReleaseOptions) {
|
||||
const currentBranch =
|
||||
options.targetBranch || (await getCurrentBranch(ELECTRON_DIR));
|
||||
|
||||
const changes = await changesToRelease();
|
||||
if (changes) {
|
||||
const newVersion = await getNewVersion(options, DryRunMode.DRY_RUN);
|
||||
console.log(`${pass} Starting release of ${newVersion}`);
|
||||
await createRelease(options, currentBranch);
|
||||
await pushRelease(currentBranch);
|
||||
await runReleaseBuilds(currentBranch, newVersion);
|
||||
} else {
|
||||
console.log(
|
||||
'There are no new changes to this branch since the last release, aborting release.'
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
const newVersion = await getNewVersion(options, DryRunMode.DRY_RUN);
|
||||
console.log(`${pass} Starting release of ${newVersion}`);
|
||||
await createRelease(options, currentBranch);
|
||||
await pushRelease(currentBranch);
|
||||
await runReleaseBuilds(currentBranch, newVersion);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,13 @@ int ElectronMain(int argc, char* argv[]) {
|
||||
params.argc = argc;
|
||||
params.argv = const_cast<const char**>(argv);
|
||||
electron::ElectronCommandLine::Init(argc, argv);
|
||||
|
||||
// Ensure that Bundle Id is set before ContentMain.
|
||||
// Refs https://chromium-review.googlesource.com/c/chromium/src/+/5581006
|
||||
delegate.OverrideChildProcessPath();
|
||||
delegate.OverrideFrameworkBundlePath();
|
||||
delegate.SetUpBundleOverrides();
|
||||
|
||||
return content::ContentMain(std::move(params));
|
||||
}
|
||||
|
||||
|
||||
@@ -270,12 +270,6 @@ std::optional<int> ElectronMainDelegate::BasicStartupComplete() {
|
||||
kNonWildcardDomainNonPortSchemes, kNonWildcardDomainNonPortSchemesSize);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
OverrideChildProcessPath();
|
||||
OverrideFrameworkBundlePath();
|
||||
SetUpBundleOverrides();
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Ignore invalid parameter errors.
|
||||
_set_invalid_parameter_handler(InvalidParameterHandler);
|
||||
|
||||
@@ -34,6 +34,12 @@ class ElectronMainDelegate : public content::ContentMainDelegate {
|
||||
ElectronMainDelegate(const ElectronMainDelegate&) = delete;
|
||||
ElectronMainDelegate& operator=(const ElectronMainDelegate&) = delete;
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
void OverrideChildProcessPath();
|
||||
void OverrideFrameworkBundlePath();
|
||||
void SetUpBundleOverrides();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// content::ContentMainDelegate:
|
||||
std::string_view GetBrowserV8SnapshotFilename() override;
|
||||
@@ -57,12 +63,6 @@ class ElectronMainDelegate : public content::ContentMainDelegate {
|
||||
#endif
|
||||
|
||||
private:
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
void OverrideChildProcessPath();
|
||||
void OverrideFrameworkBundlePath();
|
||||
void SetUpBundleOverrides();
|
||||
#endif
|
||||
|
||||
std::unique_ptr<content::ContentBrowserClient> browser_client_;
|
||||
std::unique_ptr<content::ContentClient> content_client_;
|
||||
std::unique_ptr<content::ContentGpuClient> gpu_client_;
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/options_switches.h"
|
||||
#include "shell/common/thread_restrictions.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/object_template_builder.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
#include "third_party/blink/public/common/messaging/message_port_descriptor.h"
|
||||
#include "third_party/blink/public/common/messaging/transferable_message_mojom_traits.h"
|
||||
|
||||
@@ -247,12 +247,16 @@ void UtilityProcessWrapper::OnServiceProcessLaunch(
|
||||
}
|
||||
|
||||
void UtilityProcessWrapper::HandleTermination(uint64_t exit_code) {
|
||||
// HandleTermination is called from multiple callsites,
|
||||
// we need to ensure we only process it for the first callsite.
|
||||
if (terminated_)
|
||||
return;
|
||||
terminated_ = true;
|
||||
|
||||
if (pid_ != base::kNullProcessId)
|
||||
GetAllUtilityProcessWrappers().Remove(pid_);
|
||||
CloseConnectorPort();
|
||||
|
||||
EmitWithoutEvent("exit", exit_code);
|
||||
|
||||
Unpin();
|
||||
}
|
||||
|
||||
@@ -292,13 +296,8 @@ void UtilityProcessWrapper::CloseConnectorPort() {
|
||||
}
|
||||
|
||||
void UtilityProcessWrapper::Shutdown(uint64_t exit_code) {
|
||||
if (pid_ != base::kNullProcessId)
|
||||
GetAllUtilityProcessWrappers().Remove(pid_);
|
||||
node_service_remote_.reset();
|
||||
CloseConnectorPort();
|
||||
// Emit 'exit' event
|
||||
EmitWithoutEvent("exit", exit_code);
|
||||
Unpin();
|
||||
HandleTermination(exit_code);
|
||||
}
|
||||
|
||||
void UtilityProcessWrapper::PostMessage(gin::Arguments* args) {
|
||||
|
||||
@@ -105,6 +105,7 @@ class UtilityProcessWrapper final
|
||||
int stdout_read_fd_ = -1;
|
||||
int stderr_read_fd_ = -1;
|
||||
bool connector_closed_ = false;
|
||||
bool terminated_ = false;
|
||||
std::unique_ptr<mojo::Connector> connector_;
|
||||
blink::MessagePortDescriptor host_port_;
|
||||
mojo::Receiver<node::mojom::NodeServiceClient> receiver_{this};
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
#include "shell/common/node_util.h"
|
||||
#include "shell/common/options_switches.h"
|
||||
#include "shell/common/thread_restrictions.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
#include "storage/browser/file_system/isolated_context.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
#include "third_party/blink/public/common/input/web_input_event.h"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "shell/common/gin_helper/object_template_builder.h"
|
||||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
|
||||
namespace gin {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "shell/common/gin_helper/error_thrower.h"
|
||||
#include "shell/common/gin_helper/event_emitter_caller.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
#include "third_party/blink/public/common/messaging/transferable_message.h"
|
||||
#include "third_party/blink/public/common/messaging/transferable_message_mojom_traits.h"
|
||||
#include "third_party/blink/public/mojom/messaging/transferable_message.mojom.h"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "shell/common/gin_converters/callback_converter.h"
|
||||
#include "shell/common/gin_helper/callback.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
|
||||
ElectronNSSCryptoModuleDelegate::ElectronNSSCryptoModuleDelegate(
|
||||
const net::HostPortPair& server)
|
||||
|
||||
@@ -538,6 +538,11 @@ void NativeWindowViews::ShowInactive() {
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
if (global_menu_bar_)
|
||||
global_menu_bar_->OnWindowMapped();
|
||||
|
||||
// On X11, setting Z order before showing the window doesn't take effect,
|
||||
// so we have to call it again.
|
||||
if (IsX11())
|
||||
widget()->SetZOrderLevel(widget()->GetZOrderLevel());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "shell/browser/ui/win/taskbar_host.h"
|
||||
|
||||
#include <objbase.h>
|
||||
#include <array>
|
||||
#include <string>
|
||||
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
@@ -25,10 +26,10 @@ namespace {
|
||||
// From MSDN:
|
||||
// https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#thumbbars
|
||||
// The thumbnail toolbar has a maximum of seven buttons due to the limited room.
|
||||
const size_t kMaxButtonsCount = 7;
|
||||
constexpr size_t kMaxButtonsCount = 7U;
|
||||
|
||||
// The base id of Thumbar button.
|
||||
const int kButtonIdBase = 40001;
|
||||
constexpr int kButtonIdBase = 40001;
|
||||
|
||||
bool GetThumbarButtonFlags(const std::vector<std::string>& flags,
|
||||
THUMBBUTTONFLAGS* out) {
|
||||
@@ -72,10 +73,10 @@ bool TaskbarHost::SetThumbarButtons(HWND window,
|
||||
// The number of buttons in thumbar can not be changed once it is created,
|
||||
// so we have to claim kMaxButtonsCount buttons initially in case users add
|
||||
// more buttons later.
|
||||
base::win::ScopedHICON icons[kMaxButtonsCount] = {};
|
||||
THUMBBUTTON thumb_buttons[kMaxButtonsCount] = {};
|
||||
auto icons = std::array<base::win::ScopedHICON, kMaxButtonsCount>{};
|
||||
auto thumb_buttons = std::array<THUMBBUTTON, kMaxButtonsCount>{};
|
||||
|
||||
for (size_t i = 0; i < kMaxButtonsCount; ++i) {
|
||||
for (size_t i = 0U; i < kMaxButtonsCount; ++i) {
|
||||
THUMBBUTTON& thumb_button = thumb_buttons[i];
|
||||
|
||||
// Set ID.
|
||||
@@ -118,10 +119,11 @@ bool TaskbarHost::SetThumbarButtons(HWND window,
|
||||
// Finally add them to taskbar.
|
||||
HRESULT r;
|
||||
if (thumbar_buttons_added_) {
|
||||
r = taskbar_->ThumbBarUpdateButtons(window, kMaxButtonsCount,
|
||||
thumb_buttons);
|
||||
r = taskbar_->ThumbBarUpdateButtons(window, thumb_buttons.size(),
|
||||
thumb_buttons.data());
|
||||
} else {
|
||||
r = taskbar_->ThumbBarAddButtons(window, kMaxButtonsCount, thumb_buttons);
|
||||
r = taskbar_->ThumbBarAddButtons(window, thumb_buttons.size(),
|
||||
thumb_buttons.data());
|
||||
}
|
||||
|
||||
thumbar_buttons_added_ = true;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "shell/common/gin_converters/value_converter.h"
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/keyboard_util.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
#include "third_party/blink/public/common/context_menu_data/edit_flags.h"
|
||||
#include "third_party/blink/public/common/input/web_input_event.h"
|
||||
#include "third_party/blink/public/common/input/web_keyboard_event.h"
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "shell/common/gin_converters/value_converter.h"
|
||||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
|
||||
namespace gin {
|
||||
|
||||
@@ -369,10 +370,7 @@ class ChunkedDataPipeReadableStream final
|
||||
num_bytes = *size_ - bytes_read_;
|
||||
MojoResult rv = data_pipe_->ReadData(
|
||||
MOJO_READ_DATA_FLAG_NONE,
|
||||
base::span(static_cast<uint8_t*>(buf->Buffer()->Data()),
|
||||
buf->ByteLength())
|
||||
.subspan(buf->ByteOffset(), num_bytes),
|
||||
num_bytes);
|
||||
electron::util::as_byte_span(buf).first(num_bytes), num_bytes);
|
||||
if (rv == MOJO_RESULT_OK) {
|
||||
bytes_read_ += num_bytes;
|
||||
// Not needed for correctness, but this allows the consumer to send the
|
||||
|
||||
@@ -19,8 +19,10 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/mac/scoped_aedesc.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "base/task/bind_post_task.h"
|
||||
#include "base/task/thread_pool.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "net/base/apple/url_conversions.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
#include "url/gurl.h"
|
||||
@@ -146,11 +148,23 @@ void OpenExternal(const GURL& url,
|
||||
return;
|
||||
}
|
||||
|
||||
bool success = [[NSWorkspace sharedWorkspace] openURL:ns_url];
|
||||
if (success && options.activate)
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
NSWorkspaceOpenConfiguration* configuration =
|
||||
[NSWorkspaceOpenConfiguration configuration];
|
||||
configuration.activates = options.activate;
|
||||
|
||||
std::move(callback).Run(success ? "" : "Failed to open URL");
|
||||
__block OpenCallback copied_callback =
|
||||
base::BindPostTaskToCurrentDefault(std::move(callback));
|
||||
|
||||
[[NSWorkspace sharedWorkspace] openURL:ns_url
|
||||
configuration:configuration
|
||||
completionHandler:^(NSRunningApplication* _Nullable app,
|
||||
NSError* _Nullable error) {
|
||||
if (error) {
|
||||
std::move(copied_callback).Run("Failed to open URL");
|
||||
} else {
|
||||
std::move(copied_callback).Run("");
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
bool MoveItemToTrashWithError(const base::FilePath& full_path,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@@ -240,4 +240,23 @@ v8::Local<v8::Value> DeserializeV8Value(v8::Isolate* isolate,
|
||||
return V8Deserializer(isolate, data).Deserialize();
|
||||
}
|
||||
|
||||
namespace util {
|
||||
|
||||
/**
|
||||
* SAFETY: There is not yet any v8::ArrayBufferView API that passes the
|
||||
* UNSAFE_BUFFER_USAGE test, so let's isolate the unsafe API here.
|
||||
*
|
||||
* Where possible, Electron should use spans returned here instead of
|
||||
* |v8::ArrayBufferView::Buffer()->Data()|,
|
||||
* |v8::ArrayBufferView::ByteOffset()|,
|
||||
* |v8::ArrayBufferView::ByteLength()|.
|
||||
*/
|
||||
base::span<uint8_t> as_byte_span(v8::Local<v8::ArrayBufferView> val) {
|
||||
uint8_t* data = UNSAFE_BUFFERS(static_cast<uint8_t*>(val->Buffer()->Data()) +
|
||||
val->ByteOffset());
|
||||
const size_t size = val->ByteLength();
|
||||
return UNSAFE_BUFFERS(base::span{data, size});
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace electron
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "ui/gfx/image/image_skia_rep.h"
|
||||
|
||||
namespace v8 {
|
||||
class ArrayBufferView;
|
||||
class Isolate;
|
||||
template <class T>
|
||||
class Local;
|
||||
@@ -29,6 +30,12 @@ v8::Local<v8::Value> DeserializeV8Value(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> DeserializeV8Value(v8::Isolate* isolate,
|
||||
base::span<const uint8_t> data);
|
||||
|
||||
namespace util {
|
||||
|
||||
[[nodiscard]] base::span<uint8_t> as_byte_span(
|
||||
v8::Local<v8::ArrayBufferView> abv);
|
||||
|
||||
} // namespace util
|
||||
} // namespace electron
|
||||
|
||||
#endif // ELECTRON_SHELL_COMMON_V8_VALUE_SERIALIZER_H_
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "shell/common/gin_helper/promise.h"
|
||||
#include "shell/common/node_bindings.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
#include "third_party/blink/public/web/web_local_frame.h"
|
||||
#include "third_party/blink/public/web/web_message_port_converter.h"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/options_switches.h"
|
||||
#include "shell/common/thread_restrictions.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
#include "shell/renderer/electron_render_frame_observer.h"
|
||||
#include "shell/renderer/renderer_client_base.h"
|
||||
#include "third_party/blink/public/mojom/frame/user_activation_notification_type.mojom-shared.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "shell/common/gin_helper/dictionary.h"
|
||||
#include "shell/common/gin_helper/event_emitter_caller.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "shell/common/v8_value_serializer.h"
|
||||
#include "shell/common/v8_util.h"
|
||||
#include "third_party/blink/public/common/messaging/transferable_message_mojom_traits.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
@@ -2512,6 +2512,22 @@ describe('BrowserWindow module', () => {
|
||||
expect(c.isAlwaysOnTop()).to.be.true('child is not always on top');
|
||||
expect(c._getAlwaysOnTopLevel()).to.equal('screen-saver');
|
||||
});
|
||||
|
||||
it('works when called prior to show', async () => {
|
||||
w = new BrowserWindow({ show: false });
|
||||
w.setAlwaysOnTop(true, 'screen-saver');
|
||||
w.show();
|
||||
await setTimeout(1000);
|
||||
expect(w.isAlwaysOnTop()).to.be.true('is not alwaysOnTop');
|
||||
});
|
||||
|
||||
it('works when called prior to showInactive', async () => {
|
||||
w = new BrowserWindow({ show: false });
|
||||
w.setAlwaysOnTop(true, 'screen-saver');
|
||||
w.showInactive();
|
||||
await setTimeout(1000);
|
||||
expect(w.isAlwaysOnTop()).to.be.true('is not alwaysOnTop');
|
||||
});
|
||||
});
|
||||
|
||||
describe('preconnect feature', () => {
|
||||
|
||||
@@ -76,6 +76,21 @@ describe('shell module', () => {
|
||||
requestReceived
|
||||
]);
|
||||
});
|
||||
|
||||
ifit(process.platform === 'darwin')('removes focus from the electron window after opening an external link', async () => {
|
||||
const url = 'http://127.0.0.1';
|
||||
const w = new BrowserWindow({ show: true });
|
||||
|
||||
await once(w, 'focus');
|
||||
expect(w.isFocused()).to.be.true();
|
||||
|
||||
await Promise.all<void>([
|
||||
shell.openExternal(url),
|
||||
once(w, 'blur') as Promise<any>
|
||||
]);
|
||||
|
||||
expect(w.isFocused()).to.be.false();
|
||||
});
|
||||
});
|
||||
|
||||
describe('shell.trashItem()', () => {
|
||||
|
||||
@@ -58,10 +58,20 @@ describe('utilityProcess module', () => {
|
||||
await once(child, 'spawn');
|
||||
});
|
||||
|
||||
it('emits \'exit\' when child process exits gracefully', async () => {
|
||||
it('emits \'exit\' when child process exits gracefully', (done) => {
|
||||
const child = utilityProcess.fork(path.join(fixturesPath, 'empty.js'));
|
||||
const [code] = await once(child, 'exit');
|
||||
expect(code).to.equal(0);
|
||||
child.on('exit', (code) => {
|
||||
expect(code).to.equal(0);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('emits \'exit\' when the child process file does not exist', (done) => {
|
||||
const child = utilityProcess.fork('nonexistent');
|
||||
child.on('exit', (code) => {
|
||||
expect(code).to.equal(1);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
ifit(!isWindows32Bit)('emits the correct error code when child process exits nonzero', async () => {
|
||||
|
||||
@@ -15,7 +15,7 @@ import * as path from 'node:path';
|
||||
import { setTimeout } from 'node:timers/promises';
|
||||
import * as url from 'node:url';
|
||||
|
||||
import { ifit, ifdescribe, defer, itremote, listen } from './lib/spec-helpers';
|
||||
import { ifit, ifdescribe, defer, itremote, listen, startRemoteControlApp } from './lib/spec-helpers';
|
||||
import { closeAllWindows } from './lib/window-helpers';
|
||||
import { PipeTransport } from './pipe-transport';
|
||||
|
||||
@@ -556,6 +556,38 @@ describe('command line switches', () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('--trace-startup switch', () => {
|
||||
const outputFilePath = path.join(app.getPath('temp'), 'trace.json');
|
||||
afterEach(() => {
|
||||
if (fs.existsSync(outputFilePath)) {
|
||||
fs.unlinkSync(outputFilePath);
|
||||
}
|
||||
});
|
||||
|
||||
// Disable the test on linux arm and arm64 to avoid startup crash
|
||||
// https://github.com/electron/electron/issues/44293#issuecomment-2420077154
|
||||
ifit(process.platform !== 'linux' || (process.arch !== 'arm' && process.arch !== 'arm64'))('creates startup trace', async () => {
|
||||
const rc = await startRemoteControlApp(['--trace-startup=*', `--trace-startup-file=${outputFilePath}`, '--trace-startup-duration=1', '--enable-logging']);
|
||||
const stderrComplete = new Promise<string>(resolve => {
|
||||
let stderr = '';
|
||||
rc.process.stderr!.on('data', (chunk) => {
|
||||
stderr += chunk.toString('utf8');
|
||||
});
|
||||
rc.process.on('close', () => { resolve(stderr); });
|
||||
});
|
||||
rc.remotely(() => {
|
||||
global.setTimeout(() => {
|
||||
require('electron').app.quit();
|
||||
}, 5000);
|
||||
});
|
||||
const stderr = await stderrComplete;
|
||||
expect(stderr).to.match(/Completed startup tracing to/);
|
||||
expect(fs.existsSync(outputFilePath)).to.be.true('output exists');
|
||||
expect(fs.statSync(outputFilePath).size).to.be.above(0,
|
||||
`the trace output file is empty, check "${outputFilePath}"`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('chromium features', () => {
|
||||
|
||||
Reference in New Issue
Block a user