mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
8 Commits
v24.0.0-ni
...
v23.0.0-al
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb9badc41a | ||
|
|
10632e3f54 | ||
|
|
6010ac6c76 | ||
|
|
1c1a0cdead | ||
|
|
af0a995bb2 | ||
|
|
a0efada13b | ||
|
|
8635029f47 | ||
|
|
ac0ba48736 |
4
.github/workflows/issue-labeled.yml
vendored
4
.github/workflows/issue-labeled.yml
vendored
@@ -11,9 +11,10 @@ jobs:
|
||||
issue-labeled:
|
||||
permissions:
|
||||
issues: write # for actions-cool/issues-helper to update issues
|
||||
pull-requests: write # for actions-cool/issues-helper to update PRs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: blocked/need-repro label added
|
||||
- name: blocked/need-repro
|
||||
if: github.event.label.name == 'blocked/need-repro'
|
||||
uses: actions-cool/issues-helper@dad28fdb88da5f082c04659b7373d85790f9b135 # v3.3.0
|
||||
with:
|
||||
@@ -26,3 +27,4 @@ jobs:
|
||||
Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.
|
||||
|
||||
Now adding the `blocked/need-repro` label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.
|
||||
|
||||
|
||||
11
.github/workflows/stale.yml
vendored
11
.github/workflows/stale.yml
vendored
@@ -23,14 +23,3 @@ jobs:
|
||||
This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue.
|
||||
exempt-issue-labels: "discussion,security \U0001F512,enhancement :sparkles:"
|
||||
only-pr-labels: not-a-real-label
|
||||
pending-repro:
|
||||
steps:
|
||||
- uses: actions/stale@3de2653986ebd134983c79fe2be5d45cc3d9f4e1
|
||||
with:
|
||||
days-before-stale: -1
|
||||
days-before-close: 10
|
||||
stale-issue-label: blocked/need-repro
|
||||
stale-pr-label: not-a-real-label
|
||||
operations-per-run: 1750
|
||||
close-issue-message: >
|
||||
Unfortunately, without a way to reproduce this issue, we're unable to continue investigation. This issue has been closed and will not be monitored further. If you're able to provide a minimal test case that reproduces this issue on a [supported version of Electron](https://www.electronjs.org/docs/latest/tutorial/electron-timelines#timeline) please open a new issue and include instructions for reproducing the issue.
|
||||
|
||||
6
.github/workflows/update_appveyor_image.yml
vendored
6
.github/workflows/update_appveyor_image.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Yarn install
|
||||
@@ -37,7 +37,7 @@ jobs:
|
||||
fi
|
||||
- name: (Optionally) Update Appveyor Image
|
||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||
uses: mikefarah/yq@1c7dc0e88aad311c89889bc5ce5d8f96931a1bd0 # v4.27.2
|
||||
uses: mikefarah/yq@v4.27.2
|
||||
with:
|
||||
cmd: yq '.image = "${{ env.APPVEYOR_IMAGE_VERSION }}"' "appveyor.yml" > "appveyor2.yml"
|
||||
- name: (Optionally) Generate Commit Diff
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
rm appveyor2.yml appveyor.diff
|
||||
- name: (Optionally) Commit and Pull Request
|
||||
if: ${{ env.APPVEYOR_IMAGE_VERSION }}
|
||||
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
|
||||
uses: peter-evans/create-pull-request@v4
|
||||
with:
|
||||
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
|
||||
commit-message: 'build: update appveyor image to latest version'
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
version: 1.0.{build}
|
||||
build_cloud: electronhq-16-core
|
||||
image: Windows_Default_Appveyor
|
||||
image: e-110.0.5451.0
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
@@ -16,17 +16,24 @@ environment:
|
||||
GOMA_FALLBACK_ON_AUTH_FAILURE: true
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
|
||||
PYTHONIOENCODING: UTF-8
|
||||
# Uncomment these lines and set APPVEYOR_RDP_PASSWORD in project settings to enable RDP before bake begins
|
||||
# install:
|
||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
build_script:
|
||||
- ps: Resize-Partition -DriveLetter C -Size (256GB) # ensure initial partition size
|
||||
- ps: Get-Partition -DriveLetter C
|
||||
# Uncomment/change the following line if the hard drive/partition size needs to change
|
||||
# - ps: Resize-Partition -DriveLetter C -Size (256GB) # ensure initial partition size
|
||||
- git config --global core.longpaths true
|
||||
- cd ..
|
||||
- mkdir src
|
||||
- ps: >-
|
||||
if (-not (Test-Path -Path .\src)) {
|
||||
New-Item -Path .\src -ItemType Directory
|
||||
}
|
||||
- ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
|
||||
- update_depot_tools.bat
|
||||
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
|
||||
- src\electron\script\setup-win-for-dev.bat
|
||||
# Uncomment the following line if windows deps change
|
||||
# - src\electron\script\setup-win-for-dev.bat
|
||||
- >-
|
||||
gclient config
|
||||
--name "src\electron"
|
||||
@@ -40,13 +47,20 @@ build_script:
|
||||
- ps: cd ..\..
|
||||
- gclient sync --with_branch_heads --with_tags --nohooks
|
||||
- ps: regsvr32 /s "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\DIA SDK\bin\amd64\msdia140.dll"
|
||||
- ps: |
|
||||
$env:appveyor_user = "appveyor"
|
||||
|
||||
$env:appveyor_password = [Guid]::NewGuid().ToString('B')
|
||||
|
||||
Set-LocalUser -Name $env:appveyor_user -Password (ConvertTo-SecureString -AsPlainText $env:appveyor_password -Force) -PasswordNeverExpires:$true
|
||||
|
||||
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/build-images/master/scripts/Windows/enable_autologon.ps1'))
|
||||
on_image_bake:
|
||||
- ps: >-
|
||||
echo "Baking image: $env:APPVEYOR_BAKE_IMAGE at dir $PWD"
|
||||
- ps: Remove-Item -Recurse -Force $pwd\depot_tools
|
||||
- ps: Remove-Item -Recurse -Force $pwd\src\electron
|
||||
# Uncomment these lines to enable RDP
|
||||
# Uncomment these lines and set APPVEYOR_RDP_PASSWORD in project settings to enable RDP after bake is done
|
||||
#on_finish:
|
||||
# - ps: >-
|
||||
# $env:APPVEYOR_RDP_PASSWORD = "electron"
|
||||
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
version: 1.0.{build}
|
||||
build_cloud: electronhq-16-core
|
||||
image: e-110.0.5415.0-fix
|
||||
image: e-110.0.5451.0
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
|
||||
@@ -2,7 +2,7 @@ is_electron_build = true
|
||||
root_extra_deps = [ "//electron" ]
|
||||
|
||||
# Registry of NMVs --> https://github.com/nodejs/node/blob/master/doc/abi_version_registry.json
|
||||
node_module_version = 114
|
||||
node_module_version = 113
|
||||
|
||||
v8_promise_internal_field_count = 1
|
||||
v8_embedder_string = "-electron.0"
|
||||
|
||||
@@ -1509,6 +1509,7 @@ dock on macOS.
|
||||
|
||||
A `boolean` property that returns `true` if the app is packaged, `false` otherwise. For many apps, this property can be used to distinguish development and production environments.
|
||||
|
||||
[dock-menu]:https://developer.apple.com/macos/human-interface-guidelines/menus/dock-menus/
|
||||
[tasks]:https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks
|
||||
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
|
||||
[electron-forge]: https://www.electronforge.io/
|
||||
|
||||
@@ -1565,13 +1565,6 @@ screen readers
|
||||
Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to
|
||||
convey some sort of application status or to passively notify the user.
|
||||
|
||||
#### `win.invalidateShadow()` _macOS_
|
||||
|
||||
Invalidates the window shadow so that it is recomputed based on the current window shape.
|
||||
|
||||
`BrowserWindows` that are transparent can sometimes leave behind visual artifacts on macOS.
|
||||
This method can be used to clear these artifacts when, for example, performing an animation.
|
||||
|
||||
#### `win.setHasShadow(hasShadow)`
|
||||
|
||||
* `hasShadow` boolean
|
||||
|
||||
@@ -79,5 +79,3 @@ Returns `Menu | null` - The application's [dock menu][dock-menu].
|
||||
* `image` ([NativeImage](native-image.md) | string)
|
||||
|
||||
Sets the `image` associated with this dock icon.
|
||||
|
||||
[dock-menu]: https://developer.apple.com/macos/human-interface-guidelines/menus/dock-menus/
|
||||
|
||||
@@ -56,4 +56,3 @@ Emitted when the remote end of a MessagePortMain object becomes disconnected.
|
||||
|
||||
[`MessagePort`]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort
|
||||
[Channel Messaging API]: https://developer.mozilla.org/en-US/docs/Web/API/Channel_Messaging_API
|
||||
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
|
||||
|
||||
@@ -44,5 +44,3 @@ event.
|
||||
* `message` any
|
||||
|
||||
Sends a message from the process to its parent.
|
||||
|
||||
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
* `id` string - The identifier of a window or screen that can be used as a
|
||||
`chromeMediaSourceId` constraint when calling
|
||||
[`navigator.getUserMedia`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia). The format of the identifier will be
|
||||
[`navigator.webkitGetUserMedia`]. The format of the identifier will be
|
||||
`window:XX:YY` or `screen:ZZ:0`. XX is the windowID/handle. YY is 1 for
|
||||
the current process, and 0 for all others. ZZ is a sequential number
|
||||
that represents the screen, and it does not equal to the index in the
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# WebRequestFilter Object
|
||||
|
||||
* `urls` string[] - Array of URL patterns that will be used to filter out the requests that do not match the URL patterns.
|
||||
* `urls` string[] - Array of [URL patterns](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) that will be used to filter out the requests that do not match the URL patterns.
|
||||
|
||||
@@ -441,7 +441,7 @@ It will always return `granted` for `screen` and for all media types on older ve
|
||||
|
||||
Returns `Promise<boolean>` - A promise that resolves with `true` if consent was granted and `false` if it was denied. If an invalid `mediaType` is passed, the promise will be rejected. If an access request was denied and later is changed through the System Preferences pane, a restart of the app will be required for the new permissions to take effect. If access has already been requested and denied, it _must_ be changed through the preference pane; an alert will not pop up and the promise will resolve with the existing access status.
|
||||
|
||||
**Important:** In order to properly leverage this API, you [must set](https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos?language=objc) the `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your app's `Info.plist` file. The values for these keys will be used to populate the permission dialogs so that the user will be properly informed as to the purpose of the permission request. See [Electron Application Distribution](../tutorial/application-distribution.md#rebranding-with-downloaded-binaries) for more information about how to set these in the context of Electron.
|
||||
**Important:** In order to properly leverage this API, you [must set](https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/requesting_authorization_for_media_capture_on_macos?language=objc) the `NSMicrophoneUsageDescription` and `NSCameraUsageDescription` strings in your app's `Info.plist` file. The values for these keys will be used to populate the permission dialogs so that the user will be properly informed as to the purpose of the permission request. See [Electron Application Distribution](../tutorial/application-distribution.md#macos) for more information about how to set these in the context of Electron.
|
||||
|
||||
This user consent was not required until macOS 10.14 Mojave, so this method will always return `true` if your system is running 10.13 High Sierra or lower.
|
||||
|
||||
|
||||
@@ -135,4 +135,3 @@ Emitted when the child process sends a message using [`process.parentPort.postMe
|
||||
[Services API]: https://chromium.googlesource.com/chromium/src/+/master/docs/mojo_and_services.md
|
||||
[stdio]: https://nodejs.org/dist/latest/docs/api/child_process.html#optionsstdio
|
||||
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
|
||||
[`MessagePortMain`]: message-port-main.md
|
||||
|
||||
@@ -2083,4 +2083,3 @@ with open(), or by navigating a link with a target attribute.
|
||||
[event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter
|
||||
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
||||
[`postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
|
||||
[`MessagePortMain`]: message-port-main.md
|
||||
|
||||
@@ -233,4 +233,3 @@ See also how the [Page Visibility API](browser-window.md#page-visibility) is aff
|
||||
|
||||
[SCA]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm
|
||||
[`postMessage`]: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
|
||||
[`MessagePortMain`]: message-port-main.md
|
||||
|
||||
@@ -132,7 +132,7 @@ OSR (offscreen rendering) can be used for loading heavy page in
|
||||
background and then displaying it after (it will be much faster).
|
||||
It allows you to render page without showing it on screen.
|
||||
|
||||
For more information, read the [Offscreen Rendering] tutorial.
|
||||
For more information, read the [Offscreen Rendering][osr] tutorial.
|
||||
|
||||
### preload script
|
||||
|
||||
@@ -235,10 +235,10 @@ embedded content.
|
||||
[mac app store submission guide]: tutorial/mac-app-store-submission-guide.md
|
||||
[main]: #main-process
|
||||
[msi]: https://docs.microsoft.com/en-us/windows/win32/msi/windows-installer-portal
|
||||
[Native Node Modules]: tutorial/using-native-node-modules.md
|
||||
[offscreen rendering]: tutorial/offscreen-rendering.md
|
||||
[process sandboxing]: tutorial/sandbox.md
|
||||
[renderer]: #renderer-process
|
||||
[userland]: #userland
|
||||
[using native node modules]: tutorial/using-native-node-modules.md
|
||||
[UtilityProcess]: api/utility-process.md
|
||||
[v8]: #v8
|
||||
|
||||
@@ -13,7 +13,7 @@ from the OS.
|
||||
|
||||
If your app has its own dark mode, you should toggle it on and off in sync with
|
||||
the system's dark mode setting. You can do this by using the
|
||||
[prefers-color-scheme] CSS media query.
|
||||
[prefer-color-scheme] CSS media query.
|
||||
|
||||
### Manually update your own interfaces
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ NPM package that does just that.
|
||||
If you don't want to use the tooling approach, you can also do all of the necessary
|
||||
operations by hand. To load an extension in Electron, you need to download it via Chrome,
|
||||
locate its filesystem path, and then load it into your [Session][session] by calling the
|
||||
[`ses.loadExtension`][load-extension] API.
|
||||
[`ses.loadExtension`] API.
|
||||
|
||||
Using the [React Developer Tools][react-devtools] as an example:
|
||||
|
||||
|
||||
@@ -52,6 +52,5 @@ You can find the full list of "How to?" in the sidebar. If there is
|
||||
something that you would like to do that is not documented, please join
|
||||
our [Discord server][discord] and let us know!
|
||||
|
||||
[app]: ../api/app.md
|
||||
[discord]: https://discord.gg/electronjs
|
||||
[fiddle]: https://www.electronjs.org/fiddle
|
||||
|
||||
@@ -227,7 +227,7 @@ rest of our docs and happy developing! If you have questions, please stop by our
|
||||
[github actions]: https://github.com/features/actions
|
||||
[github publisher]: https://www.electronforge.io/config/publishers/github
|
||||
[github releases]: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
|
||||
[git-tag]: https://git-scm.com/book/en/v2/Git-Basics-Tagging
|
||||
[git tag]: https://git-scm.com/book/en/v2/Git-Basics-Tagging
|
||||
[new-pat]: https://github.com/settings/tokens/new
|
||||
[publish command]: https://www.electronforge.io/cli#publish
|
||||
[publisher]: https://www.electronforge.io/config/publishers
|
||||
|
||||
@@ -67,7 +67,7 @@ Depending on your needs, you can choose from one of these:
|
||||
to minify server cost.
|
||||
|
||||
Once you've deployed your update server, you can instrument your app code to receive and
|
||||
apply the updates with Electron's [autoUpdater](../api/auto-updater.md) module.
|
||||
apply the updates with Electron's [autoUpdater] module.
|
||||
|
||||
### Step 2: Receiving updates in your app
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
"parallel/test-trace-events-v8",
|
||||
"parallel/test-trace-events-vm",
|
||||
"parallel/test-trace-events-worker-metadata",
|
||||
"parallel/test-wasm-web-api",
|
||||
"parallel/test-webcrypto-derivebits-cfrg",
|
||||
"parallel/test-webcrypto-derivekey-cfrg",
|
||||
"parallel/test-webcrypto-encrypt-decrypt",
|
||||
|
||||
@@ -14,8 +14,8 @@ const ROLLER_BRANCH_PATTERN = /^roller\/chromium$/;
|
||||
|
||||
const DEFAULT_BUILD_CLOUD_ID = '1598';
|
||||
const DEFAULT_BUILD_CLOUD = 'electronhq-16-core';
|
||||
const DEFAULT_BAKE_BASE_IMAGE = 'Windows_Default_Appveyor';
|
||||
const DEFAULT_BUILD_IMAGE = 'Windows_Default_Appveyor';
|
||||
const DEFAULT_BAKE_BASE_IMAGE = 'e-110.0.5451.0';
|
||||
const DEFAULT_BUILD_IMAGE = 'e-110.0.5451.0';
|
||||
|
||||
const appveyorBakeJob = 'electron-bake-image';
|
||||
const appVeyorJobs = {
|
||||
|
||||
@@ -205,11 +205,7 @@ int NodeMain(int argc, char* argv[]) {
|
||||
uv_loop_configure(loop, UV_METRICS_IDLE_TIME);
|
||||
|
||||
// Initialize gin::IsolateHolder.
|
||||
bool setup_wasm_streaming =
|
||||
node::per_process::cli_options->get_per_isolate_options()
|
||||
->get_per_env_options()
|
||||
->experimental_fetch;
|
||||
JavascriptEnvironment gin_env(loop, setup_wasm_streaming);
|
||||
JavascriptEnvironment gin_env(loop);
|
||||
|
||||
v8::Isolate* isolate = gin_env.isolate();
|
||||
|
||||
@@ -230,7 +226,8 @@ int NodeMain(int argc, char* argv[]) {
|
||||
static_cast<node::EnvironmentFlags::Flags>(env_flags));
|
||||
CHECK_NE(nullptr, env);
|
||||
|
||||
node::SetIsolateUpForNode(isolate);
|
||||
node::IsolateSettings is;
|
||||
node::SetIsolateUpForNode(isolate, is);
|
||||
|
||||
gin_helper::Dictionary process(isolate, env->process_object());
|
||||
process.SetMethod("crash", &ElectronBindings::Crash);
|
||||
|
||||
@@ -639,10 +639,6 @@ std::string BaseWindow::GetBackgroundColor(gin_helper::Arguments* args) {
|
||||
return ToRGBHex(window_->GetBackgroundColor());
|
||||
}
|
||||
|
||||
void BaseWindow::InvalidateShadow() {
|
||||
window_->InvalidateShadow();
|
||||
}
|
||||
|
||||
void BaseWindow::SetHasShadow(bool has_shadow) {
|
||||
window_->SetHasShadow(has_shadow);
|
||||
}
|
||||
@@ -1263,7 +1259,6 @@ void BaseWindow::BuildPrototype(v8::Isolate* isolate,
|
||||
.SetMethod("isVisibleOnAllWorkspaces",
|
||||
&BaseWindow::IsVisibleOnAllWorkspaces)
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
.SetMethod("invalidateShadow", &BaseWindow::InvalidateShadow)
|
||||
.SetMethod("_getAlwaysOnTopLevel", &BaseWindow::GetAlwaysOnTopLevel)
|
||||
.SetMethod("setAutoHideCursor", &BaseWindow::SetAutoHideCursor)
|
||||
#endif
|
||||
|
||||
@@ -156,7 +156,6 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
|
||||
bool IsTabletMode() const;
|
||||
virtual void SetBackgroundColor(const std::string& color_name);
|
||||
std::string GetBackgroundColor(gin_helper::Arguments* args);
|
||||
void InvalidateShadow();
|
||||
void SetHasShadow(bool has_shadow);
|
||||
bool HasShadow();
|
||||
void SetOpacity(const double opacity);
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "shell/common/gin_helper/cleaned_up_at_exit.h"
|
||||
#include "shell/common/node_includes.h"
|
||||
#include "third_party/blink/public/common/switches.h"
|
||||
#include "third_party/electron_node/src/node_wasm_web_api.h"
|
||||
|
||||
namespace {
|
||||
v8::Isolate* g_isolate;
|
||||
@@ -74,9 +73,8 @@ struct base::trace_event::TraceValue::Helper<
|
||||
|
||||
namespace electron {
|
||||
|
||||
JavascriptEnvironment::JavascriptEnvironment(uv_loop_t* event_loop,
|
||||
bool setup_wasm_streaming)
|
||||
: isolate_(Initialize(event_loop, setup_wasm_streaming)),
|
||||
JavascriptEnvironment::JavascriptEnvironment(uv_loop_t* event_loop)
|
||||
: isolate_(Initialize(event_loop)),
|
||||
isolate_holder_(base::ThreadTaskRunnerHandle::Get(),
|
||||
gin::IsolateHolder::kSingleThread,
|
||||
gin::IsolateHolder::kAllowAtomicsWait,
|
||||
@@ -249,8 +247,7 @@ class TracingControllerImpl : public node::tracing::TracingController {
|
||||
}
|
||||
};
|
||||
|
||||
v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop,
|
||||
bool setup_wasm_streaming) {
|
||||
v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop) {
|
||||
auto* cmd = base::CommandLine::ForCurrentProcess();
|
||||
|
||||
// --js-flags.
|
||||
@@ -279,17 +276,6 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop,
|
||||
|
||||
v8::Isolate* isolate = v8::Isolate::Allocate();
|
||||
platform_->RegisterIsolate(isolate, event_loop);
|
||||
|
||||
// This is done here because V8 checks for the callback in NewContext.
|
||||
// Our setup order doesn't allow for calling SetupIsolateForNode
|
||||
// before NewContext without polluting JavaScriptEnvironment with
|
||||
// Node.js logic and so we conditionally do it here to keep
|
||||
// concerns separate.
|
||||
if (setup_wasm_streaming) {
|
||||
isolate->SetWasmStreamingCallback(
|
||||
node::wasm_web_api::StartStreamingCompilation);
|
||||
}
|
||||
|
||||
g_isolate = isolate;
|
||||
|
||||
return isolate;
|
||||
|
||||
@@ -22,8 +22,7 @@ class MicrotasksRunner;
|
||||
// Manage the V8 isolate and context automatically.
|
||||
class JavascriptEnvironment {
|
||||
public:
|
||||
explicit JavascriptEnvironment(uv_loop_t* event_loop,
|
||||
bool setup_wasm_streaming = false);
|
||||
explicit JavascriptEnvironment(uv_loop_t* event_loop);
|
||||
~JavascriptEnvironment();
|
||||
|
||||
// disable copy
|
||||
@@ -42,7 +41,7 @@ class JavascriptEnvironment {
|
||||
static v8::Isolate* GetIsolate();
|
||||
|
||||
private:
|
||||
v8::Isolate* Initialize(uv_loop_t* event_loop, bool setup_wasm_streaming);
|
||||
v8::Isolate* Initialize(uv_loop_t* event_loop);
|
||||
std::unique_ptr<node::MultiIsolatePlatform> platform_;
|
||||
|
||||
v8::Isolate* isolate_;
|
||||
|
||||
@@ -175,11 +175,7 @@ void NativeWindow::InitFromOptions(const gin_helper::Dictionary& options) {
|
||||
int max_width = max_size.width() > 0 ? max_size.width() : INT_MAX;
|
||||
int max_height = max_size.height() > 0 ? max_size.height() : INT_MAX;
|
||||
bool have_max_width = options.Get(options::kMaxWidth, &max_width);
|
||||
if (have_max_width && max_width <= 0)
|
||||
max_width = INT_MAX;
|
||||
bool have_max_height = options.Get(options::kMaxHeight, &max_height);
|
||||
if (have_max_height && max_height <= 0)
|
||||
max_height = INT_MAX;
|
||||
|
||||
// By default the window has a default maximum size that prevents it
|
||||
// from being resized larger than the screen, so we should only set this
|
||||
@@ -421,8 +417,6 @@ void NativeWindow::SetParentWindow(NativeWindow* parent) {
|
||||
parent_ = parent;
|
||||
}
|
||||
|
||||
void NativeWindow::InvalidateShadow() {}
|
||||
|
||||
void NativeWindow::SetAutoHideCursor(bool auto_hide) {}
|
||||
|
||||
void NativeWindow::SelectPreviousTab() {}
|
||||
|
||||
@@ -169,7 +169,6 @@ class NativeWindow : public base::SupportsUserData,
|
||||
virtual bool IsTabletMode() const;
|
||||
virtual void SetBackgroundColor(SkColor color) = 0;
|
||||
virtual SkColor GetBackgroundColor() = 0;
|
||||
virtual void InvalidateShadow();
|
||||
virtual void SetHasShadow(bool has_shadow) = 0;
|
||||
virtual bool HasShadow() = 0;
|
||||
virtual void SetOpacity(const double opacity) = 0;
|
||||
|
||||
@@ -94,7 +94,6 @@ class NativeWindowMac : public NativeWindow,
|
||||
bool IsKiosk() override;
|
||||
void SetBackgroundColor(SkColor color) override;
|
||||
SkColor GetBackgroundColor() override;
|
||||
void InvalidateShadow() override;
|
||||
void SetHasShadow(bool has_shadow) override;
|
||||
bool HasShadow() override;
|
||||
void SetOpacity(const double opacity) override;
|
||||
|
||||
@@ -226,8 +226,8 @@ NativeWindowMac::NativeWindowMac(const gin_helper::Dictionary& options,
|
||||
|
||||
NSUInteger styleMask = NSWindowStyleMaskTitled;
|
||||
|
||||
// The NSWindowStyleMaskFullSizeContentView style removes rounded corners
|
||||
// for frameless window.
|
||||
// Removing NSWindowStyleMaskTitled removes window title, which removes
|
||||
// rounded corners of window.
|
||||
bool rounded_corner = true;
|
||||
options.Get(options::kRoundedCorners, &rounded_corner);
|
||||
if (!rounded_corner && !has_frame())
|
||||
@@ -1061,10 +1061,6 @@ bool NativeWindowMac::HasShadow() {
|
||||
return [window_ hasShadow];
|
||||
}
|
||||
|
||||
void NativeWindowMac::InvalidateShadow() {
|
||||
[window_ invalidateShadow];
|
||||
}
|
||||
|
||||
void NativeWindowMac::SetOpacity(const double opacity) {
|
||||
const double boundedOpacity = base::clamp(opacity, 0.0, 1.0);
|
||||
[window_ setAlphaValue:boundedOpacity];
|
||||
|
||||
@@ -35,9 +35,6 @@ void OnWebNotificationAllowed(base::WeakPtr<Notification> notification,
|
||||
options.icon = icon;
|
||||
options.silent = audio_muted ? true : data.silent;
|
||||
options.has_reply = false;
|
||||
if (data.require_interaction)
|
||||
options.timeout_type = u"never";
|
||||
|
||||
notification->Show(options);
|
||||
} else {
|
||||
notification->Destroy();
|
||||
|
||||
Reference in New Issue
Block a user