electron/shell/browser/javascript_environment.h

64 lines
1.8 KiB
C
Raw Normal View History

// Copyright (c) 2013 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_BROWSER_JAVASCRIPT_ENVIRONMENT_H_
#define ELECTRON_SHELL_BROWSER_JAVASCRIPT_ENVIRONMENT_H_
#include <memory>
#include "base/memory/raw_ptr.h"
2014-09-01 16:41:26 +08:00
#include "gin/public/isolate_holder.h"
#include "uv.h" // NOLINT(build/include_directory)
chore: bump chromium to 95.0.4629.0 (main) (#30676) * chore: bump chromium in DEPS to 95.0.4620.0 * chore: update patches * 3076261: Move args_ to private in ExtensionFunction https://chromium-review.googlesource.com/c/chromium/src/+/3076261 * [GURL -> SiteForCookies] content/public/browser/content_browser_client.h https://chromium-review.googlesource.com/c/chromium/src/+/3107759 * chore: fix -Wunreachable-code-return in node * Tracing to diagnose ContentScriptTracker-related bad message reports https://chromium-review.googlesource.com/c/chromium/src/+/3057922 * chore: bump chromium in DEPS to 95.0.4621.0 * chore: update patches * Remove title from the URL format on Windows. https://chromium-review.googlesource.com/c/chromium/src/+/3108445 * chore: bump chromium in DEPS to 95.0.4623.0 * Revert "chore: disable v8 oilpan" This reverts commit 5d255cf1d8e8efbb906047937a713279e5f800d0. (cherry picked from commit ba5cde4da2428020d99b7fb603c702878f95da78) * Change file paths in network context params to be relative. https://chromium-review.googlesource.com/c/chromium/src/+/3092927 * Code Health: Rename/replace content::WebUI::RegisterMessageCallback(). https://chromium-review.googlesource.com/c/chromium/src/+/3104691 * Migrate CanExecuteContentScriptSync to Mojo https://chromium-review.googlesource.com/c/chromium/src/+/3108452 * chore: update patches * remove unreachable code * Revert "Revert "chore: disable v8 oilpan"" This reverts commit fef495c0294e21760df51bddb5f7bf1ec9ed5f1e. * fixup mas patch * Reland "[include] Split out v8.h" https://chromium-review.googlesource.com/c/v8/v8/+/3113629 * chore: bump chromium in DEPS to 95.0.4624.0 * chore: bump chromium in DEPS to 95.0.4625.0 * chore: bump chromium in DEPS to 95.0.4626.0 * 3033504: Pass NavigationDownloadPolicy in CreateNewWindowParams https://chromium-review.googlesource.com/c/chromium/src/+/3033504 * 3058038: Introduce TestPrintingContext & test UpdatePrintSettings https://chromium-review.googlesource.com/c/chromium/src/+/3058038 * 3114943: [Conditional Focus][#4] Add tests and remove flag gating https://chromium-review.googlesource.com/c/chromium/src/+/3114943 * chore: update patch indices * chore: bump chromium in DEPS to 95.0.4627.0 * chore: update patches * 3093591: ozone: webpagepopups: calculate anchor for menu bounds. 4/* https://chromium-review.googlesource.com/c/chromium/src/+/3093591 * 3110414: [PA] Remove the leading cookie https://chromium-review.googlesource.com/c/chromium/src/+/3110414 * chore: update patches * 3076261: Move args_ to private in ExtensionFunction https://chromium-review.googlesource.com/c/chromium/src/+/3076261 * 3113629: Reland "[include] Split out v8.h" https://chromium-review.googlesource.com/c/v8/v8/+/3113629 * chore: bump chromium in DEPS to 95.0.4628.0 * chore: update patches * chore: bump chromium in DEPS to 95.0.4629.0 * chore: update patches * Fix chrome root store codegen for cross-compile builds. https://chromium-review.googlesource.com/c/chromium/src/+/3133701 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: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-01 15:55:07 -04:00
#include "v8/include/v8-locker.h"
namespace node {
class Environment;
class MultiIsolatePlatform;
2018-04-17 21:44:10 -04:00
} // namespace node
namespace electron {
class MicrotasksRunner;
// Manage the V8 isolate and context automatically.
class JavascriptEnvironment {
public:
JavascriptEnvironment(uv_loop_t* event_loop,
bool setup_wasm_streaming = false);
~JavascriptEnvironment();
// disable copy
JavascriptEnvironment(const JavascriptEnvironment&) = delete;
JavascriptEnvironment& operator=(const JavascriptEnvironment&) = delete;
feat: UtilityProcess API (#34980) * chore: initial scaffolding * chore: implement interface and docs * chore: address code style review * fix: cleanup of utility process on shutdown * chore: simplify NodeBindings::CreateEnvironment * chore: rename disableLibraryValidation => allowLoadingUnsignedLibraries * chore: implement process.parentPort * chore(posix): implement stdio pipe interface * chore(win): implement stdio interface * chore: reenable SetNodeOptions for utility process * chore: add specs * chore: fix lint * fix: update kill API * fix: update process.parentPort API * fix: exit event * docs: update exit event * fix: tests on linux * chore: expand on some comments * fix: shutdown of pipe reader Avoid logging since it is always the case that reader end of pipe will terminate after the child process. * fix: remove exit code check for crash spec * fix: rm PR_SET_NO_NEW_PRIVS for unsandbox utility process * chore: fix incorrect rebase * fix: address review feedback * chore: rename utility_process -> utility * chore: update docs * chore: cleanup c++ implemantation * fix: leak in NodeServiceHost impl * chore: minor cleanup * chore: cleanup JS implementation * chore: flip default stdio to inherit * fix: some api improvements * Support cwd option * Remove path restriction for modulePath * Rewire impl for env support * fix: add tests for cwd and env option * chore: alt impl for reading stdio handles * chore: support message queuing * chore: fix lint * chore: new UtilityProcess => utilityProcess.fork * fix: support for uncaught exception exits * chore: remove process.execArgv as default * fix: windows build * fix: style changes * fix: docs and style changes * chore: update patches * spec: disable flaky test on win32 arm CI Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-10-20 14:49:49 +09:00
void CreateMicrotasksRunner();
void DestroyMicrotasksRunner();
chore: upgrade to Node.js v18 (#35999) * chore: update to Node.js v18 * child_process: improve argument validation https://github.com/nodejs/node/pull/41305 * bootstrap: support configure-time user-land snapshot https://github.com/nodejs/node/pull/42466 * chore: update GN patch * src: disambiguate terms used to refer to builtins and addons https://github.com/nodejs/node/pull/44135 * src: use a typed array internally for process._exiting https://github.com/nodejs/node/pull/43883 * chore: lib/internal/bootstrap -> lib/internal/process * src: disambiguate terms used to refer to builtins and addons https://github.com/nodejs/node/pull/44135 * chore: remove redudant browserGlobals patch * chore: update BoringSSL patch * src: allow embedder-provided PageAllocator in NodePlatform https://github.com/nodejs/node/pull/38362 * chore: fixup Node.js crypto tests - https://github.com/nodejs/node/pull/44171 - https://github.com/nodejs/node/pull/41600 * lib: add Promise methods to avoid-prototype-pollution lint rule https://github.com/nodejs/node/pull/43849 * deps: update V8 to 10.1 https://github.com/nodejs/node/pull/42657 * src: add kNoBrowserGlobals flag for Environment https://github.com/nodejs/node/pull/40532 * chore: consolidate asar initialization patches * deps: update V8 to 10.1 https://github.com/nodejs/node/pull/42657 * deps: update V8 to 9.8 https://github.com/nodejs/node/pull/41610 * src,crypto: remove AllocatedBuffers from crypto_spkac https://github.com/nodejs/node/pull/40752 * build: enable V8's shared read-only heap https://github.com/nodejs/node/pull/42809 * src: fix ssize_t error from nghttp2.h https://github.com/nodejs/node/pull/44393 * chore: fixup ESM patch * chore: fixup patch indices * src: merge NativeModuleEnv into NativeModuleLoader https://github.com/nodejs/node/pull/43824 * [API] Pass OOMDetails to OOMErrorCallback https://chromium-review.googlesource.com/c/v8/v8/+/3647827 * src: iwyu in cleanup_queue.cc * src: return Maybe from a couple of functions https://github.com/nodejs/node/pull/39603 * src: clean up embedder API https://github.com/nodejs/node/pull/35897 * src: refactor DH groups to delete crypto_groups.h https://github.com/nodejs/node/pull/43896 * deps,src: use SIMD for normal base64 encoding https://github.com/nodejs/node/pull/39775 * chore: remove deleted source file * chore: update patches * chore: remove deleted source file * lib: add fetch https://github.com/nodejs/node/pull/41749 * chore: remove nonexistent node specs * test: split report OOM tests https://github.com/nodejs/node/pull/44389 * src: trace fs async api https://github.com/nodejs/node/pull/44057 * http: trace http request / response https://github.com/nodejs/node/pull/44102 * test: split test-crypto-dh.js https://github.com/nodejs/node/pull/40451 * crypto: introduce X509Certificate API https://github.com/nodejs/node/pull/36804 * src: split property helpers from node::Environment https://github.com/nodejs/node/pull/44056 * https://github.com/nodejs/node/pull/38905 bootstrap: implement run-time user-land snapshots via --build-snapshot and --snapshot-blob * lib,src: implement WebAssembly Web API https://github.com/nodejs/node/pull/42701 * fixup! deps,src: use SIMD for normal base64 encoding * fixup! src: refactor DH groups to delete crypto_groups.h * chore: fixup base64 GN file * fix: check that node::InitializeContext() returns true * chore: delete _noBrowserGlobals usage * chore: disable fetch in renderer procceses * dns: default to verbatim=true in dns.lookup() https://github.com/nodejs/node/pull/39987 Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-11-10 22:31:20 +01:00
node::MultiIsolatePlatform* platform() const { return platform_.get(); }
v8::Isolate* isolate() const { return isolate_; }
size_t max_young_generation_size_in_bytes() const {
return max_young_generation_size_;
}
static v8::Isolate* GetIsolate();
private:
v8::Isolate* Initialize(uv_loop_t* event_loop, bool setup_wasm_streaming);
chore: upgrade to Node.js v18 (#35999) * chore: update to Node.js v18 * child_process: improve argument validation https://github.com/nodejs/node/pull/41305 * bootstrap: support configure-time user-land snapshot https://github.com/nodejs/node/pull/42466 * chore: update GN patch * src: disambiguate terms used to refer to builtins and addons https://github.com/nodejs/node/pull/44135 * src: use a typed array internally for process._exiting https://github.com/nodejs/node/pull/43883 * chore: lib/internal/bootstrap -> lib/internal/process * src: disambiguate terms used to refer to builtins and addons https://github.com/nodejs/node/pull/44135 * chore: remove redudant browserGlobals patch * chore: update BoringSSL patch * src: allow embedder-provided PageAllocator in NodePlatform https://github.com/nodejs/node/pull/38362 * chore: fixup Node.js crypto tests - https://github.com/nodejs/node/pull/44171 - https://github.com/nodejs/node/pull/41600 * lib: add Promise methods to avoid-prototype-pollution lint rule https://github.com/nodejs/node/pull/43849 * deps: update V8 to 10.1 https://github.com/nodejs/node/pull/42657 * src: add kNoBrowserGlobals flag for Environment https://github.com/nodejs/node/pull/40532 * chore: consolidate asar initialization patches * deps: update V8 to 10.1 https://github.com/nodejs/node/pull/42657 * deps: update V8 to 9.8 https://github.com/nodejs/node/pull/41610 * src,crypto: remove AllocatedBuffers from crypto_spkac https://github.com/nodejs/node/pull/40752 * build: enable V8's shared read-only heap https://github.com/nodejs/node/pull/42809 * src: fix ssize_t error from nghttp2.h https://github.com/nodejs/node/pull/44393 * chore: fixup ESM patch * chore: fixup patch indices * src: merge NativeModuleEnv into NativeModuleLoader https://github.com/nodejs/node/pull/43824 * [API] Pass OOMDetails to OOMErrorCallback https://chromium-review.googlesource.com/c/v8/v8/+/3647827 * src: iwyu in cleanup_queue.cc * src: return Maybe from a couple of functions https://github.com/nodejs/node/pull/39603 * src: clean up embedder API https://github.com/nodejs/node/pull/35897 * src: refactor DH groups to delete crypto_groups.h https://github.com/nodejs/node/pull/43896 * deps,src: use SIMD for normal base64 encoding https://github.com/nodejs/node/pull/39775 * chore: remove deleted source file * chore: update patches * chore: remove deleted source file * lib: add fetch https://github.com/nodejs/node/pull/41749 * chore: remove nonexistent node specs * test: split report OOM tests https://github.com/nodejs/node/pull/44389 * src: trace fs async api https://github.com/nodejs/node/pull/44057 * http: trace http request / response https://github.com/nodejs/node/pull/44102 * test: split test-crypto-dh.js https://github.com/nodejs/node/pull/40451 * crypto: introduce X509Certificate API https://github.com/nodejs/node/pull/36804 * src: split property helpers from node::Environment https://github.com/nodejs/node/pull/44056 * https://github.com/nodejs/node/pull/38905 bootstrap: implement run-time user-land snapshots via --build-snapshot and --snapshot-blob * lib,src: implement WebAssembly Web API https://github.com/nodejs/node/pull/42701 * fixup! deps,src: use SIMD for normal base64 encoding * fixup! src: refactor DH groups to delete crypto_groups.h * chore: fixup base64 GN file * fix: check that node::InitializeContext() returns true * chore: delete _noBrowserGlobals usage * chore: disable fetch in renderer procceses * dns: default to verbatim=true in dns.lookup() https://github.com/nodejs/node/pull/39987 Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
2022-11-10 22:31:20 +01:00
std::unique_ptr<node::MultiIsolatePlatform> platform_;
2017-12-08 09:23:17 +09:00
size_t max_young_generation_size_ = 0;
chore: bump chromium to 136.0.7095.0 (36-x-y) (#46184) * chore: bump chromium in DEPS to 136.0.7081.1 * chore: bump chromium in DEPS to 136.0.7083.1 * chore: bump chromium in DEPS to 136.0.7085.1 * chore: bump chromium in DEPS to 136.0.7087.1 * chore: bump chromium in DEPS to 136.0.7089.0 * chore: bump chromium in DEPS to 136.0.7091.0 * chore: bump chromium in DEPS to 136.0.7092.0 * chore: bump chromium in DEPS to 136.0.7093.1 * chore: bump chromium in DEPS to 136.0.7095.1 * chore: bump chromium in DEPS to 136.0.7097.1 * chore: bump chromium in DEPS to 136.0.7099.1 * chore: bump chromium in DEPS to 136.0.7101.0 * chore: bump chromium in DEPS to 136.0.7103.0 * chore: bump chromium in DEPS to 136.0.7103.15 * chore: bump chromium in DEPS to 136.0.7103.17 * chore: bump chromium to 136.0.7095.0 (main) (#46118) * chore: bump chromium in DEPS to 136.0.7076.0 * chore: bump chromium in DEPS to 136.0.7077.0 * 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | https://chromium-review.googlesource.com/c/chromium/src/+/6368856 * 6356528: Clean up LegacyRenderWidgetHostHWND code | https://chromium-review.googlesource.com/c/chromium/src/+/6356528 * chore: export patches * 6339113: [Viewport Segments] Add CDP commands to override Viewport Segments without overriding other device properties. | https://chromium-review.googlesource.com/c/chromium/src/+/6339113 * 6352169: [DevTools][MultiInstance] Support new tab in another window on Android | https://chromium-review.googlesource.com/c/chromium/src/+/6352169 * 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | https://chromium-review.googlesource.com/c/chromium/src/+/6368856 * 6360858:Clickiness: Wire response from URLLoader to DB, add e2e tests| https://chromium-review.googlesource.com/c/chromium/src/+/6360858 * chore: bump chromium in DEPS to 136.0.7079.0 * chore: export patches * chore: bump chromium in DEPS to 136.0.7081.0 * chore: export patches * chore: bump chromium in DEPS to 136.0.7083.0 * 6361987: Remove double-declaration with gfx::NativeView and gfx::NativeWindow | https://chromium-review.googlesource.com/c/chromium/src/+/6361987 * chore: export patches * chore: bump chromium in DEPS to 136.0.7087.0 * chore: export patches * fix: include node patch for missing AtomicsWaitEvent https://chromium-review.googlesource.com/c/chromium/src/+/6385540 * build: add depot_tools python to path * fix: cppgc init and unregistering v8 isolate https://chromium-review.googlesource.com/c/v8/v8/+/6333562 CppGc is now initialized earlier so Node can skip reinitializing it. Additionally, gin::IsolateHandle was attempting to destruct an already destructed v8::Isolate upon electron::JavaScriptEnvironment destruction. By removing the call to NodePlatform::UnregisterIsolate, this fixes the crash on app shutdown. * fix: unregister isolate after destruction See code comment. * chore: bump chromium in DEPS to 136.0.7095.0 * chore: sync patches * fix: add script_parsing::ContentScriptType parameter https://chromium-review.googlesource.com/c/chromium/src/+/6298395 * fix: migrate content::BrowserAccessibilityState methods https://chromium-review.googlesource.com/c/chromium/src/+/6401437 https://chromium-review.googlesource.com/c/chromium/src/+/6383275 * feat: enableHappyEyeballs option for host resolver https://chromium-review.googlesource.com/c/chromium/src/+/6332599 * fix: add new cookie exclusion reason https://chromium-review.googlesource.com/c/chromium/src/+/6343479 * fix: add new url loader method https://chromium-review.googlesource.com/c/chromium/src/+/6337340 * fix: add new cppgc header file for electron_node headers https://chromium-review.googlesource.com/c/v8/v8/+/6348644 * fix: disable CREL on Linux ARM64 https://chromium-review.googlesource.com/q/I3a62f02f564f07be63173b0773b4ecaffbe939b9 * fixup! fix: add new cppgc header file for electron_node headers https://chromium-review.googlesource.com/c/v8/v8/+/6348644 * chore: update corner smoothing patch * fixup! chore: update corner smoothing patch * chore: disable NAN weak tests These two tests are incompatible with a V8 change that disallows running JS code from a weak finalizer callback. Ref: https://chromium-review.googlesource.com/c/v8/v8/+/4733273 * test: fix task starvation in node test A V8 change makes these contexts get collected in a task that is posted and run asynchronously. The tests were synchronously GC'ing in an infinite loop, preventing the task loop from running the task that would GC these contexts. This change should be upstreamed in some way. Ref: https://chromium-review.googlesource.com/c/v8/v8/+/4733273 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: alice <alice@makenotion.com> Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: clavin <clavin@electronjs.org> (cherry picked from commit 9c019b6147e88dc14959cdb8e555de0fe52f51a4) * Remove file-wide unsafe buffer suppression from content/ [3 of N] https://chromium-review.googlesource.com/c/chromium/src/+/6341711 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-04-07 13:09:35 -05:00
std::unique_ptr<gin::IsolateHolder> isolate_holder_;
// owned-by: isolate_holder_
const raw_ptr<v8::Isolate> isolate_;
// depends-on: isolate_
chore: bump chromium to 136.0.7095.0 (36-x-y) (#46184) * chore: bump chromium in DEPS to 136.0.7081.1 * chore: bump chromium in DEPS to 136.0.7083.1 * chore: bump chromium in DEPS to 136.0.7085.1 * chore: bump chromium in DEPS to 136.0.7087.1 * chore: bump chromium in DEPS to 136.0.7089.0 * chore: bump chromium in DEPS to 136.0.7091.0 * chore: bump chromium in DEPS to 136.0.7092.0 * chore: bump chromium in DEPS to 136.0.7093.1 * chore: bump chromium in DEPS to 136.0.7095.1 * chore: bump chromium in DEPS to 136.0.7097.1 * chore: bump chromium in DEPS to 136.0.7099.1 * chore: bump chromium in DEPS to 136.0.7101.0 * chore: bump chromium in DEPS to 136.0.7103.0 * chore: bump chromium in DEPS to 136.0.7103.15 * chore: bump chromium in DEPS to 136.0.7103.17 * chore: bump chromium to 136.0.7095.0 (main) (#46118) * chore: bump chromium in DEPS to 136.0.7076.0 * chore: bump chromium in DEPS to 136.0.7077.0 * 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | https://chromium-review.googlesource.com/c/chromium/src/+/6368856 * 6356528: Clean up LegacyRenderWidgetHostHWND code | https://chromium-review.googlesource.com/c/chromium/src/+/6356528 * chore: export patches * 6339113: [Viewport Segments] Add CDP commands to override Viewport Segments without overriding other device properties. | https://chromium-review.googlesource.com/c/chromium/src/+/6339113 * 6352169: [DevTools][MultiInstance] Support new tab in another window on Android | https://chromium-review.googlesource.com/c/chromium/src/+/6352169 * 6368856: Migrate absl variant.h and utility.h in content (part 2/2) | https://chromium-review.googlesource.com/c/chromium/src/+/6368856 * 6360858:Clickiness: Wire response from URLLoader to DB, add e2e tests| https://chromium-review.googlesource.com/c/chromium/src/+/6360858 * chore: bump chromium in DEPS to 136.0.7079.0 * chore: export patches * chore: bump chromium in DEPS to 136.0.7081.0 * chore: export patches * chore: bump chromium in DEPS to 136.0.7083.0 * 6361987: Remove double-declaration with gfx::NativeView and gfx::NativeWindow | https://chromium-review.googlesource.com/c/chromium/src/+/6361987 * chore: export patches * chore: bump chromium in DEPS to 136.0.7087.0 * chore: export patches * fix: include node patch for missing AtomicsWaitEvent https://chromium-review.googlesource.com/c/chromium/src/+/6385540 * build: add depot_tools python to path * fix: cppgc init and unregistering v8 isolate https://chromium-review.googlesource.com/c/v8/v8/+/6333562 CppGc is now initialized earlier so Node can skip reinitializing it. Additionally, gin::IsolateHandle was attempting to destruct an already destructed v8::Isolate upon electron::JavaScriptEnvironment destruction. By removing the call to NodePlatform::UnregisterIsolate, this fixes the crash on app shutdown. * fix: unregister isolate after destruction See code comment. * chore: bump chromium in DEPS to 136.0.7095.0 * chore: sync patches * fix: add script_parsing::ContentScriptType parameter https://chromium-review.googlesource.com/c/chromium/src/+/6298395 * fix: migrate content::BrowserAccessibilityState methods https://chromium-review.googlesource.com/c/chromium/src/+/6401437 https://chromium-review.googlesource.com/c/chromium/src/+/6383275 * feat: enableHappyEyeballs option for host resolver https://chromium-review.googlesource.com/c/chromium/src/+/6332599 * fix: add new cookie exclusion reason https://chromium-review.googlesource.com/c/chromium/src/+/6343479 * fix: add new url loader method https://chromium-review.googlesource.com/c/chromium/src/+/6337340 * fix: add new cppgc header file for electron_node headers https://chromium-review.googlesource.com/c/v8/v8/+/6348644 * fix: disable CREL on Linux ARM64 https://chromium-review.googlesource.com/q/I3a62f02f564f07be63173b0773b4ecaffbe939b9 * fixup! fix: add new cppgc header file for electron_node headers https://chromium-review.googlesource.com/c/v8/v8/+/6348644 * chore: update corner smoothing patch * fixup! chore: update corner smoothing patch * chore: disable NAN weak tests These two tests are incompatible with a V8 change that disallows running JS code from a weak finalizer callback. Ref: https://chromium-review.googlesource.com/c/v8/v8/+/4733273 * test: fix task starvation in node test A V8 change makes these contexts get collected in a task that is posted and run asynchronously. The tests were synchronously GC'ing in an infinite loop, preventing the task loop from running the task that would GC these contexts. This change should be upstreamed in some way. Ref: https://chromium-review.googlesource.com/c/v8/v8/+/4733273 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: alice <alice@makenotion.com> Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: clavin <clavin@electronjs.org> (cherry picked from commit 9c019b6147e88dc14959cdb8e555de0fe52f51a4) * Remove file-wide unsafe buffer suppression from content/ [3 of N] https://chromium-review.googlesource.com/c/chromium/src/+/6341711 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2025-04-07 13:09:35 -05:00
std::unique_ptr<v8::Locker> locker_;
std::unique_ptr<MicrotasksRunner> microtasks_runner_;
};
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_JAVASCRIPT_ENVIRONMENT_H_