electron/shell/browser/javascript_environment.cc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

165 lines
5.7 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.
#include "shell/browser/javascript_environment.h"
#include <memory>
2015-11-13 12:22:08 +08:00
#include <string>
#include <utility>
2015-11-13 12:22:08 +08:00
chore: bump chromium to 98.0.4706.0 (main) (#31555) * chore: bump chromium in DEPS to 97.0.4678.0 * chore: bump chromium in DEPS to 97.0.4679.0 * chore: bump chromium in DEPS to 97.0.4680.0 * chore: bump chromium in DEPS to 97.0.4681.0 * chore: bump chromium in DEPS to 97.0.4682.0 * chore: update patches * 3234737: Disable -Wunused-but-set-variable Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3234737 * 3216953: Reland "Move task-related files from base/ to base/task/" Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3216953 * 3202710: TimeDelta factory function migration. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3202710 * 3226841: Rename WCO::RenderProcessGone to PrimaryMainFrameRenderProcessGone Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3226841 * 3212165: blink/gin: changes blink to load snapshot based on runtime information Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3212165 * 3220292: Deprecate returning a GURL from GURL::GetOrigin() Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3220292 * 3231995: build: Enable -Wbitwise-instead-of-logical everywhere except iOS and Windows Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3231995 * 3205121: Remove base::DictionaryValue::GetDouble Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3205121 * 3208413: [flags] Make --js-flags settings have priority over V8 features Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3208413 * chore: bump chromium in DEPS to 97.0.4683.0 * chore: update patches * 3188834: Combine RWHVBase GetCurrentDeviceScaleFactor/GetDeviceScaleFactor Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3188834 * chore: update process_singleton patches * chore: bump chromium in DEPS to 97.0.4684.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4685.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4686.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4687.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4688.0 * chore: update patches * 3247722: Use correct source_site_instance if navigating via context menu Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3247722 Update signature of HandleContextMenu() * 3247722: Use correct source_site_instance if navigating via context menu Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3247722 Update signature of HandleContextMenu() * 3223422: Remove PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE enum option Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3223422 sync pepper_plugin_support.patch with upstream * chore: bump chromium in DEPS to 97.0.4689.0 * 3247791: ax_mac_merge: Merge AX Math attribute implementations Xref: ax_mac_merge: Merge AX Math attribute implementations chore: fix minor patch shear in #includes * 3243425: Add VisibleTimeRequestTrigger helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3243425 chore: fix minor patch shear in #includes * chore: regen chromium patches * fixup! 3247722: Use correct source_site_instance if navigating via context menu * chore: bump chromium in DEPS to 97.0.4690.0 * 3188659: Window Placement: make GetScreenInfo(s) const Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3188659 simple sync GetScreenInfo with upstream refactor * chore: update patches * chore: bump chromium in DEPS to 97.0.4690.4 * chore: bump chromium in DEPS to 97.0.4692.0 * 3198073: ozone: //content: clean up from USE_X11 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3198073 Fixing patch shear. Nothing to see here. * 3252338: Remove label images checkbox from chrome://accessibility page Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3252338 Part of our a11y patch is no longer needed due to upstream label removal * 3258183: Remove DISALLOW_IMPLICIT_CONSTRUCTORS() definition Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3258183 Replace our use of the macro with explicitly-deleted class methods. See https://chromium-review.googlesource.com/c/chromium/src/+/3256952 for upstream examples of this same replacement. * chore: update patches * 3247295: Unwind SecurityStyleExplanations Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3247295 update GetSecurityStyle() signature and impl to match upstream changes * 3259578: media: grabs lock to ensure video output when occluded Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3259578 Add stub for new upstream virtual method OnCapturerCountChanged() * fixup! 3247295: Unwind SecurityStyleExplanations * 3238504: Fix up drag image is not shown from bookmark bar Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3238504 SetDragImage() no longer takes a widget argument * 3217452: [devtools] Add getSyncInformation host binding Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3217452 Add stub for new upstream method GetSyncInformation(). Stub sends info back to caller saying that syncing is disabled. * chore: bump chromium in DEPS to 98.0.4693.0 * chore: bump chromium in DEPS to 98.0.4694.0 * chore: bump chromium in DEPS to 98.0.4695.0 * chore: bump chromium in DEPS to 98.0.4696.0 * chore: bump chromium in DEPS to 98.0.4697.0 * chore: bump chromium in DEPS to 98.0.4699.0 * chore: bump chromium in DEPS to 98.0.4701.0 * chore: bump chromium in DEPS to 98.0.4703.0 * chore: bump chromium in DEPS to 98.0.4705.0 * chore: bump chromium in DEPS to 98.0.4706.0 * chore: update patches * 3279210: Rename "base/macros.h" => "base/ignore_result.h" https://chromium-review.googlesource.com/c/chromium/src/+/3279210 * 3259964: Remove all DISALLOW_COPY_AND_ASSIGNs https://chromium-review.googlesource.com/c/chromium/src/+/3259964 * 3269029: blink/gin: sets histogram callbacks during isolate creation https://chromium-review.googlesource.com/c/chromium/src/+/3269029 * fixup after rebase * [content] Make ContentMainParams and MainFunctionParams move-only https://chromium-review.googlesource.com/c/chromium/src/+/3244976 * 3255305: Stop sending the securityStateChanged event and unwind https://chromium-review.googlesource.com/c/chromium/src/+/3255305 * [Blink] Add promise support to WebLocalFrame::RequestExecuteScript() https://chromium-review.googlesource.com/c/chromium/src/+/3230010 * 3256162: Simplify RWHV Show and ShowWithVisibility handling https://chromium-review.googlesource.com/c/chromium/src/+/3256162 * 3263824: ozone: //ui/base: clean up from USE_X11 1/* https://chromium-review.googlesource.com/c/chromium/src/+/3263824 * Request or cancel RecordContentToPresentationTimeRequest during capture https://chromium-review.googlesource.com/c/chromium/src/+/3256802 * appcache: remove BrowsingData/quota references https://chromium-review.googlesource.com/c/chromium/src/+/3255725 * [Autofill] Don't show Autofill dropdown if overlaps with permissions https://chromium-review.googlesource.com/c/chromium/src/+/3236729 * Rename to_different_document to should_show_loading_ui in LoadingStateChanged() callbacks https://chromium-review.googlesource.com/c/chromium/src/+/3268574 * cleanup patch * fixup [content] Make ContentMainParams and MainFunctionParams move-only * 3279210: Rename "base/macros.h" => "base/ignore_result.h" https://chromium-review.googlesource.com/c/chromium/src/+/3279210 * ozone: //chrome/browser clean up from USE_X11 https://chromium-review.googlesource.com/c/chromium/src/+/3186490 Refs: https://github.com/electron/electron/issues/31382 * chore: update support_mixed_sandbox_with_zygote.patch * Enable -Wunused-but-set-variable. Refs https://chromium-review.googlesource.com/c/chromium/src/+/3234737 * fixup! ozone: //ui/base: clean up from USE_X11 1/* * fixup! ozone: //chrome/browser clean up from USE_X11 * chore: fix deprecation warning in libuv * chore: fixup for lint * 3251161: Reland "Make the Clang update.py script require Python 3" https://chromium-review.googlesource.com/c/chromium/src/+/3251161 * fixup: Enable -Wunused-but-set-variable. * [base][win] Rename DIR_APP_DATA to DIR_ROAMING_APP_DATA https://chromium-review.googlesource.com/c/chromium/src/+/3262369 * Replace sandbox::policy::SandboxType with mojom Sandbox enum https://chromium-review.googlesource.com/c/chromium/src/+/3213677 * fixup: [content] Make ContentMainParams and MainFunctionParams move-only * build: ensure angle has a full git checkout available to it * fixup: [base][win] Rename DIR_APP_DATA to DIR_ROAMING_APP_DATA * fixup lint * [unseasoned-pdf] Dispatch 'afterprint' event in PDF plugin frame https://chromium-review.googlesource.com/c/chromium/src/+/3223434 * fixup: [Autofill] Don't show Autofill dropdown if overlaps with permissions * 3217591: Move browser UI CSS color parsing to own file part 2/2 https://chromium-review.googlesource.com/c/chromium/src/+/3217591 * Make kNoSandboxAndElevatedPrivileges only available to utilities https://chromium-review.googlesource.com/c/chromium/src/+/3276784 * 3211575: [modules] Change ScriptOrModule to custom Struct https://chromium-review.googlesource.com/c/v8/v8/+/3211575 * Address review feedback * chore: update patches * 3211575: [modules] Change ScriptOrModule to custom Struct https://chromium-review.googlesource.com/c/v8/v8/+/3211575 * fix: unused variable compat * chore: remove redundant patch * fixup for 3262517: Re-enable WindowCaptureMacV2 https://chromium-review.googlesource.com/c/chromium/src/+/3262517 * chore: cleanup todo The functions added in https://chromium-review.googlesource.com/c/chromium/src/+/3256802 are not used by offscreen rendering. * fixup: update mas_no_private_api.patch * 3216879: [PA] Make features::kPartitionAllocLazyCommit to be PartitionOptions::LazyCommit Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3216879 Fixes up commit b2f1aca95604ec61649808c846657454097e6935 * chore: cleanup support_mixed_sandbox_with_zygote.patch * test: use window focus event instead of delay to wait for webContents focus Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: VerteDinde <khammond@slack-corp.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-24 09:45:59 +01:00
#include "base/allocator/partition_alloc_features.h"
chore: bump chromium to 120.0.6078.0 (main) (#40114) * chore: bump chromium in DEPS to 120.0.6049.0 * chore: update patches * chore: bump chromium in DEPS to 120.0.6050.0 * chore: update patches * 4910494: Reland "[autopip] Show autopip UI for video pip" https://chromium-review.googlesource.com/c/chromium/src/+/4910494 * 4812338: Move partition_alloc into a "partition_alloc" dir. https://chromium-review.googlesource.com/c/chromium/src/+/4812338 * [Extensions Cleanup] Remove mojom ViewType::kExtensionDialog https://chromium-review.googlesource.com/c/chromium/src/+/4909897 * 4894923: Force enable raw_ptrs pointer arithmetic check. https://chromium-review.googlesource.com/c/chromium/src/+/4894923 * gin: Prevent wrappables from being constructed from author code. https://chromium-review.googlesource.com/c/chromium/src/+/4905829 * chore: update patches * chore: bump chromium in DEPS to 120.0.6052.0 * chore: bump chromium in DEPS to 120.0.6054.0 * chore: bump chromium in DEPS to 120.0.6056.0 * chore: fix patches * 4918545: Reland "[autopip] Add permissions embargo" https://chromium-review.googlesource.com/c/chromium/src/+/4918545 * 4881761: UI bindings for visual logging with structured metrics. https://chromium-review.googlesource.com/c/chromium/src/+/4881761 * chore: bump chromium in DEPS to 120.0.6058.0 * chore: update patches * chore: bump chromium in DEPS to 120.0.6060.0 * chore: bump chromium in DEPS to 120.0.6061.0 * chore: bump chromium in DEPS to 120.0.6062.0 * chore: gen libc++ filenames * chore: update patches * 4911894: Move //c/b/ui/views/eye_dropper to //components https://chromium-review.googlesource.com/c/chromium/src/+/4911894 * chore: bump chromium in DEPS to 120.0.6064.0 * chore: bump chromium in DEPS to 120.0.6066.0 * chore: bump chromium in DEPS to 120.0.6068.0 * chore: bump chromium in DEPS to 120.0.6070.0 * chore: remove temp_prevent_unused_function_error.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4931270 * chore: add TransferDragSecurityInfo() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4928028 * mark TransferDragSecurityInfo() as NOTREACHED A follow-up to previous commit. I think this is commit is correct (i.e. that this function shouldn't get called) but am not positive, so I'm including it in a standalone commit in case we need to revert. * chore: update signature of OnPrivateNetworkAccessPermissionRequired() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4919478 Our impl is a no-op, so updating the signature is the only change. * chore: rebuild patches * chore: bump chromium in DEPS to 120.0.6072.0 * chore: update patches * chore: sync ParseMatchPattern() param order with upstream change Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4944243 * chore: update fix_crash_loading_non-standard_schemes_in_iframes.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4939602 * chore: rebuild patches * chore: bump chromium in DEPS to 120.0.6073.0 * chore: update patches * chore: bump chromium in DEPS to 120.0.6074.0 * chore: update disable_color_correct_rendering.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4908053 no manual changes; patch applied with fuzz 1 * chore: update fix_handle_no_top_level_aura_window_in_webcontentsimpl.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4936315 minor manual sync to upstream code shear * chore: rebuild patches * chore: update ClearHttpAuthCache arguments Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4937937 adding ClearDataFilterPtr arg. Upstream added this arg, which is already present in other NetworkContext methods. Our code uses `nullptr` there. * chore: bump chromium in DEPS to 120.0.6076.0 * chore: update mas_disable_remote_accessibility.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4865412 minor manual sync to upstream code shear * chore: update disable_color_correct_rendering.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4942936 minor manual sync to upstream code shear * fix: move x11_util.h include to top of source file This is a short-term fix to unblock the roll. I will follow up a better fix in a standalone PR. * chore: rebuild patches * chore: bump chromium in DEPS to 120.0.6077.0 * chore: update patches * chore: bump chromium in DEPS to 120.0.6078.0 * chore: update patches * refactor: add BrowserProcessImpl::os_crypt_async() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4455776 This is one to keep an eye on. This commit copies the upstream impl, which appears to be an interim step with more upstream code changes still forthcoming. Xref: https://bugs.chromium.org/p/chromium/issues/detail?id=1373092 * fixup! refactor: add BrowserProcessImpl::os_crypt_async() chore: make 'gn check' happy * chore: remove ensure_messageports_get_gced_when_not_referenced.patch Xref: ensure_messageports_get_gced_when_not_referenced.patch no longer needed because upstreamed * chore: remove webrtc/pipewire_capturer_make_restore_tokens_re-usable_more_than_one_time.patch Xref: https://webrtc-review.googlesource.com/c/src/+/322621 no longer needed because upstreamed * chore: add //components/compose:buildflags dep Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4912601 needed by browser/ui/browser_dialogs.h * chore: update filenames.libcxx.gni node ./script/gen-libc++-filenames.js * test: fix UI.InspectorView -> UI.InspectorView.instance() --------- 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: clavin <clavin@electronjs.org> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-10-24 11:24:20 -04:00
#include "base/allocator/partition_allocator/src/partition_alloc/partition_alloc.h"
chore: bump chromium to 102.0.4999.0 (main) (#33731) * chore: bump chromium in DEPS to 102.0.4999.0 * 3576640: Set OOM handler during V8 initialization https://chromium-review.googlesource.com/c/chromium/src/+/3576640 * 3574964: Remove deprecated base::Value usage in print_settings_conversion code. https://chromium-review.googlesource.com/c/chromium/src/+/3574964 * 3570062: Replicate Active state to render process for all RenderViews. https://chromium-review.googlesource.com/c/chromium/src/+/3570062 * chore: fixup patch indices * 3380402: Remove legacy SwiftShader https://chromium-review.googlesource.com/c/chromium/src/+/3380402 * 3570254: [Local Fonts] Rename permission name from FONT_ACCESS to LOCAL_FONTS. https://chromium-review.googlesource.com/c/chromium/src/+/3570254 * 3572172: Rename or remove several parameters involved in creation of MimeHandler streams https://chromium-review.googlesource.com/c/chromium/src/+/3572172 * fix: add missing base/bits include * chore: fix lint * chore: remove ia32 Linux support * chore: patch out swift-format cipd dep on macOS * build: apply patch better * build: reset all caches * build: update zip manifests to remove swiftshared libraries Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3380402 * Revert "build: update zip manifests to remove swiftshared libraries" This reverts commit 6aeec01ef1a79425a7b7d8c1cfb131a26b91c494. * Revert "3380402: Remove legacy SwiftShader" This reverts commit 4c7eebbbf2d0a459cc192959e17ae20f970c2da2. * build: remove unused swiftshader egl libraries Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Samuel Attard <sattard@salesforce.com>
2022-04-22 15:36:22 -07:00
#include "base/bits.h"
2015-10-22 16:20:48 +05:30
#include "base/command_line.h"
chore: bump chromium to 98.0.4706.0 (main) (#31555) * chore: bump chromium in DEPS to 97.0.4678.0 * chore: bump chromium in DEPS to 97.0.4679.0 * chore: bump chromium in DEPS to 97.0.4680.0 * chore: bump chromium in DEPS to 97.0.4681.0 * chore: bump chromium in DEPS to 97.0.4682.0 * chore: update patches * 3234737: Disable -Wunused-but-set-variable Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3234737 * 3216953: Reland "Move task-related files from base/ to base/task/" Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3216953 * 3202710: TimeDelta factory function migration. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3202710 * 3226841: Rename WCO::RenderProcessGone to PrimaryMainFrameRenderProcessGone Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3226841 * 3212165: blink/gin: changes blink to load snapshot based on runtime information Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3212165 * 3220292: Deprecate returning a GURL from GURL::GetOrigin() Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3220292 * 3231995: build: Enable -Wbitwise-instead-of-logical everywhere except iOS and Windows Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3231995 * 3205121: Remove base::DictionaryValue::GetDouble Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3205121 * 3208413: [flags] Make --js-flags settings have priority over V8 features Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3208413 * chore: bump chromium in DEPS to 97.0.4683.0 * chore: update patches * 3188834: Combine RWHVBase GetCurrentDeviceScaleFactor/GetDeviceScaleFactor Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3188834 * chore: update process_singleton patches * chore: bump chromium in DEPS to 97.0.4684.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4685.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4686.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4687.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4688.0 * chore: update patches * 3247722: Use correct source_site_instance if navigating via context menu Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3247722 Update signature of HandleContextMenu() * 3247722: Use correct source_site_instance if navigating via context menu Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3247722 Update signature of HandleContextMenu() * 3223422: Remove PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE enum option Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3223422 sync pepper_plugin_support.patch with upstream * chore: bump chromium in DEPS to 97.0.4689.0 * 3247791: ax_mac_merge: Merge AX Math attribute implementations Xref: ax_mac_merge: Merge AX Math attribute implementations chore: fix minor patch shear in #includes * 3243425: Add VisibleTimeRequestTrigger helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3243425 chore: fix minor patch shear in #includes * chore: regen chromium patches * fixup! 3247722: Use correct source_site_instance if navigating via context menu * chore: bump chromium in DEPS to 97.0.4690.0 * 3188659: Window Placement: make GetScreenInfo(s) const Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3188659 simple sync GetScreenInfo with upstream refactor * chore: update patches * chore: bump chromium in DEPS to 97.0.4690.4 * chore: bump chromium in DEPS to 97.0.4692.0 * 3198073: ozone: //content: clean up from USE_X11 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3198073 Fixing patch shear. Nothing to see here. * 3252338: Remove label images checkbox from chrome://accessibility page Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3252338 Part of our a11y patch is no longer needed due to upstream label removal * 3258183: Remove DISALLOW_IMPLICIT_CONSTRUCTORS() definition Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3258183 Replace our use of the macro with explicitly-deleted class methods. See https://chromium-review.googlesource.com/c/chromium/src/+/3256952 for upstream examples of this same replacement. * chore: update patches * 3247295: Unwind SecurityStyleExplanations Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3247295 update GetSecurityStyle() signature and impl to match upstream changes * 3259578: media: grabs lock to ensure video output when occluded Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3259578 Add stub for new upstream virtual method OnCapturerCountChanged() * fixup! 3247295: Unwind SecurityStyleExplanations * 3238504: Fix up drag image is not shown from bookmark bar Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3238504 SetDragImage() no longer takes a widget argument * 3217452: [devtools] Add getSyncInformation host binding Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3217452 Add stub for new upstream method GetSyncInformation(). Stub sends info back to caller saying that syncing is disabled. * chore: bump chromium in DEPS to 98.0.4693.0 * chore: bump chromium in DEPS to 98.0.4694.0 * chore: bump chromium in DEPS to 98.0.4695.0 * chore: bump chromium in DEPS to 98.0.4696.0 * chore: bump chromium in DEPS to 98.0.4697.0 * chore: bump chromium in DEPS to 98.0.4699.0 * chore: bump chromium in DEPS to 98.0.4701.0 * chore: bump chromium in DEPS to 98.0.4703.0 * chore: bump chromium in DEPS to 98.0.4705.0 * chore: bump chromium in DEPS to 98.0.4706.0 * chore: update patches * 3279210: Rename "base/macros.h" => "base/ignore_result.h" https://chromium-review.googlesource.com/c/chromium/src/+/3279210 * 3259964: Remove all DISALLOW_COPY_AND_ASSIGNs https://chromium-review.googlesource.com/c/chromium/src/+/3259964 * 3269029: blink/gin: sets histogram callbacks during isolate creation https://chromium-review.googlesource.com/c/chromium/src/+/3269029 * fixup after rebase * [content] Make ContentMainParams and MainFunctionParams move-only https://chromium-review.googlesource.com/c/chromium/src/+/3244976 * 3255305: Stop sending the securityStateChanged event and unwind https://chromium-review.googlesource.com/c/chromium/src/+/3255305 * [Blink] Add promise support to WebLocalFrame::RequestExecuteScript() https://chromium-review.googlesource.com/c/chromium/src/+/3230010 * 3256162: Simplify RWHV Show and ShowWithVisibility handling https://chromium-review.googlesource.com/c/chromium/src/+/3256162 * 3263824: ozone: //ui/base: clean up from USE_X11 1/* https://chromium-review.googlesource.com/c/chromium/src/+/3263824 * Request or cancel RecordContentToPresentationTimeRequest during capture https://chromium-review.googlesource.com/c/chromium/src/+/3256802 * appcache: remove BrowsingData/quota references https://chromium-review.googlesource.com/c/chromium/src/+/3255725 * [Autofill] Don't show Autofill dropdown if overlaps with permissions https://chromium-review.googlesource.com/c/chromium/src/+/3236729 * Rename to_different_document to should_show_loading_ui in LoadingStateChanged() callbacks https://chromium-review.googlesource.com/c/chromium/src/+/3268574 * cleanup patch * fixup [content] Make ContentMainParams and MainFunctionParams move-only * 3279210: Rename "base/macros.h" => "base/ignore_result.h" https://chromium-review.googlesource.com/c/chromium/src/+/3279210 * ozone: //chrome/browser clean up from USE_X11 https://chromium-review.googlesource.com/c/chromium/src/+/3186490 Refs: https://github.com/electron/electron/issues/31382 * chore: update support_mixed_sandbox_with_zygote.patch * Enable -Wunused-but-set-variable. Refs https://chromium-review.googlesource.com/c/chromium/src/+/3234737 * fixup! ozone: //ui/base: clean up from USE_X11 1/* * fixup! ozone: //chrome/browser clean up from USE_X11 * chore: fix deprecation warning in libuv * chore: fixup for lint * 3251161: Reland "Make the Clang update.py script require Python 3" https://chromium-review.googlesource.com/c/chromium/src/+/3251161 * fixup: Enable -Wunused-but-set-variable. * [base][win] Rename DIR_APP_DATA to DIR_ROAMING_APP_DATA https://chromium-review.googlesource.com/c/chromium/src/+/3262369 * Replace sandbox::policy::SandboxType with mojom Sandbox enum https://chromium-review.googlesource.com/c/chromium/src/+/3213677 * fixup: [content] Make ContentMainParams and MainFunctionParams move-only * build: ensure angle has a full git checkout available to it * fixup: [base][win] Rename DIR_APP_DATA to DIR_ROAMING_APP_DATA * fixup lint * [unseasoned-pdf] Dispatch 'afterprint' event in PDF plugin frame https://chromium-review.googlesource.com/c/chromium/src/+/3223434 * fixup: [Autofill] Don't show Autofill dropdown if overlaps with permissions * 3217591: Move browser UI CSS color parsing to own file part 2/2 https://chromium-review.googlesource.com/c/chromium/src/+/3217591 * Make kNoSandboxAndElevatedPrivileges only available to utilities https://chromium-review.googlesource.com/c/chromium/src/+/3276784 * 3211575: [modules] Change ScriptOrModule to custom Struct https://chromium-review.googlesource.com/c/v8/v8/+/3211575 * Address review feedback * chore: update patches * 3211575: [modules] Change ScriptOrModule to custom Struct https://chromium-review.googlesource.com/c/v8/v8/+/3211575 * fix: unused variable compat * chore: remove redundant patch * fixup for 3262517: Re-enable WindowCaptureMacV2 https://chromium-review.googlesource.com/c/chromium/src/+/3262517 * chore: cleanup todo The functions added in https://chromium-review.googlesource.com/c/chromium/src/+/3256802 are not used by offscreen rendering. * fixup: update mas_no_private_api.patch * 3216879: [PA] Make features::kPartitionAllocLazyCommit to be PartitionOptions::LazyCommit Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3216879 Fixes up commit b2f1aca95604ec61649808c846657454097e6935 * chore: cleanup support_mixed_sandbox_with_zygote.patch * test: use window focus event instead of delay to wait for webContents focus Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: VerteDinde <khammond@slack-corp.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-24 09:45:59 +01:00
#include "base/feature_list.h"
#include "base/task/current_thread.h"
chore: bump chromium to 111.0.5544.3 (main) (#36820) * chore: bump chromium in DEPS to 111.0.5522.0 * chore: bump chromium in DEPS to 111.0.5524.0 * chore: bump chromium in DEPS to 111.0.5526.0 * chore: bump chromium in DEPS to 111.0.5528.0 * chore: update patches/chromium/mas_avoid_usage_of_private_macos_apis.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4132807 Fix simple code shear * chore: update patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4130675 Fix simple code shear * chore: update patches/chromium/hack_plugin_response_interceptor_to_point_to_electron.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4144281 Fix simple code shear; applied cleanly w/patch-fuzz * chore: update patches/chromium/disable_unload_metrics.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4126173 Fix simple code shear; applied cleanly w/patch-fuzz * chore: update patches/chromium/feat_add_data_parameter_to_processsingleton.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4144281 Fix simple code shear; applied cleanly w/patch-fuzz * chore: update patches/chromium/preconnect_manager.patch https://chromium-review.googlesource.com/c/chromium/src/+/4144281 Fix simple code shear; applied cleanly w/patch-fuzz * chore: update patches/v8/force_cppheapcreateparams_to_be_noncopyable.patch https://chromium-review.googlesource.com/c/v8/v8/+/3533019 Fix simple code shear; applied cleanly w/patch-fuzz * chore: update patches * chore: update patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4128765 Upstream added a new call to HeaderContext(), whose signature we have patched * chore: bump chromium in DEPS to 111.0.5530.0 * chore: update patches * Move ChildProcessHost* from content/common to content/browser Xref: Move ChildProcessHost* from content/common to content/browser * Remove RenderViewHostChanged Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4134103 [upstream removal of RenderViewHostChanged] Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4092763 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4093234 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4133892 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4134103 [examples of upstream code adjusting to the change] Upstream handles this change in roughly two approaches: 1. Move the code over to RenderFrameHostChanged(old_host, new_host) but test for new_host->IsInPrimaryMainFrame() before acting 2. Migrate to the PrimaryPageChanged(page) API and use page.GetMainDocument() to get the RenderFrameHost. I've chosen 1. because electron_api_web_contents needed that pointer to old_host to call RemoveInputEventListener(), but I may be missing some context & would appreciate review on this commit. * Make electron/shell/browser/relauncher_win.cc use <winternl.h> Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4129135 Many internal Windows types are now available in winternl.h so upstrem no longer defines the types themselves. * Move ChildProcessHost* from content/common to content/browser Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4134795 * fixup! Make electron/shell/browser/relauncher_win.cc use <winternl.h> winternl.h does not define the field we need, so clone the struct Chromium was using into unnamed namespace * fixup! Move ChildProcessHost* from content/common to content/browser chore: update #includes too * chore: bump chromium in DEPS to 111.0.5532.0 * chore: sync patches/chromium/pepper_plugin_support.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4133323 manually reync patch; no code changes * chore: sync patches/chromium/mas_no_private_api.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4143865 the content/common/pseudonymization_salt.cc patch is no longer needed * chore: sync patches/chromium/mas_disable_remote_accessibility.patch patch-fuzz update; no manual changes * chore: sync patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4111725 manually reync patch; no code changes * chore: sync patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4133323 manually reync patch; no code changes * chore: sync patches/v8/fix_build_deprecated_attribute_for_older_msvc_versions.patch Xref: https://chromium-review.googlesource.com/c/v8/v8/+/4127230 patch-fuzz update; no manual changes * chore: rebuild patches * fixup! Remove RenderViewHostChanged Use PrimaryPageChanged() * chore: remove unused method TabsUpdateFunction::OnExecuteCodeFinished() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4133991 This private, already-unused function showed up as a FTBFS because it took a base::ListValue parameter and ListValue was removed upstream. * task posting v3: remove includes of runner handles and IWYU task runners Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4133323 * chore: lint * chore: more lint * fixup! task posting v3: remove includes of runner handles and IWYU task runners macOS, too * fixup! task posting v3: remove includes of runner handles and IWYU task runners * chore: bump chromium in DEPS to 111.0.5534.0 * chore: sync patches/chromium/allow_new_privileges_in_unsandboxed_child_processes.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4141862 patch-fuzz update; no manual changes * chore: sync patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4153110 Sync to minor upstream changes. Add const correctness. * chore: sync electron/patches/chromium/feat_configure_launch_options_for_service_process.patch https://chromium-review.googlesource.com/c/chromium/src/+/4141862 patch-fuzz update; no manual changes * chore: patches/v8/fix_build_deprecated_attribute_for_older_msvc_versions.patch sync https://chromium-review.googlesource.com/c/v8/v8/+/4147787 patch-fuzz update; no manual changes * chore: update patches * chore: bump chromium in DEPS to 111.0.5536.0 * chore: sync patches/chromium/allow_new_privileges_in_unsandboxed_child_processes.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4141863 Sync with upstream code changes. Minor code golf for readability. Note: upstream is laying groundwork for being able to work off of env vars instead of switches. Doesn't affect us yet but worth being aware of. > + // Environment variables could be supported in the future, but are not > + // currently supported when launching with the zygote. * chore: update patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4126836 patch-fuzz update; no manual changes * chore: sync electron/patches/chromium/feat_configure_launch_options_for_service_process.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/4141863 manual sync * chore: sync electron/patches/v8/fix_build_deprecated_attribute_for_older_msvc_versions.patch https://chromium-review.googlesource.com/c/v8/v8/+/4147788 fuzz-patch * chore: rebuild patches * chore: bump chromium in DEPS to 111.0.5538.0 * chore: bump chromium in DEPS to 111.0.5540.0 * chore: update patches * Remove sdk_forward_declarations https://chromium-review.googlesource.com/c/chromium/src/+/4166680 * task posting v3: Remove task runner handles from codebase entirely Refs https://chromium-review.googlesource.com/c/chromium/src/+/4150928 * Cleanup child_process_launcher_helper* Refs https://chromium-review.googlesource.com/c/chromium/src/+/4141863 * fix: utilityprocess spec on macOS * fix: build on windows Refs https://chromium-review.googlesource.com/c/chromium/src/+/4141863 * chore: fix lint * chore: bump chromium 111.0.5544.3 * chore: gen filenames.libcxx.gni * Add check for Executable+Writable handles in renderer processes. Refs https://chromium-review.googlesource.com/c/chromium/src/+/3774416 * fixup! Add check for Executable+Writable handles in renderer processes. * 4143761: [110] Disable SwiftShader for WebGL on M1 Macs. https://chromium-review.googlesource.com/c/chromium/src/+/4143761 (cherry picked from commit 2f74db3c2139424c416f92d9169aeaa8a2f9c1ec) * chore: bump chromium to 111.0.5555.0 * 56085: Remove hmac.h include from ssl.h. https://boringssl-review.googlesource.com/c/boringssl/+/56085 * 4167020: Remove forwarding headers https://chromium-review.googlesource.com/c/chromium/src/+/4167020 * chore: bump chromium to 111.0.5559.0 * 4181044: Restrict WebCursor usage to RenderWidgetHostViewAura https://chromium-review.googlesource.com/c/chromium/src/+/4181044 * 4189437: views: rename ink_drop_host_view to ink_drop_host https://chromium-review.googlesource.com/c/chromium/src/+/4189437 * chore: bump chromium to 111.0.5560.0 * 4167016: win7dep: remove non aeroglass code https://chromium-review.googlesource.com/c/chromium/src/+/4167016 * fixup after rebase: Remove forwarding header s https://chromium-review.googlesource.com/c/chromium/src/+/4167020 * 4125755: Reland "Reject getDisplayMedia calls without user activation" https://chromium-review.googlesource.com/c/chromium/src/+/4125755 * test: add workaround * chore: update patches * fix: alter coreModuleRegExp to prevent arm crash * Revert "fix: alter coreModuleRegExp to prevent arm crash" This reverts commit 7e50630c98137831a711c5abdbc8809e60cf1d73. * 4218354: Disable the use of preserve_most on arm64 Windows https://chromium-review.googlesource.com/c/v8/v8/+/4218354 * chore: review changes --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2023-02-03 12:43:42 +01:00
#include "base/task/single_thread_task_runner.h"
chore: bump chromium to 1e9f9a24aa12 (master) (#17880) * chore: bump chromium in DEPS to 1e9f9a24aa12bea9cf194a82a7e249bd1242ec4f * chore: update patches * Make WebContents' theme color a base::Optional<SkColor> https://chromium-review.googlesource.com/c/chromium/src/+/1540022 * update autofill patch for incorrect header includes * Move Shell messages to web_test and rename to BlinkTest. https://chromium-review.googlesource.com/c/chromium/src/+/1525181 * Make PlatformNotificationServiceImpl a KeyedService. https://chromium-review.googlesource.com/c/chromium/src/+/1336150 * Move MediaPlayerId to its own file. https://chromium-review.googlesource.com/c/chromium/src/+/1547057 * Remove net/base/completion_callback.h, which is no longer used https://chromium-review.googlesource.com/c/chromium/src/+/1552821 * AW NS: support file scheme cookies https://chromium-review.googlesource.com/c/chromium/src/+/1533486 * Remove SecurityInfo and adapt remaining consumers https://chromium-review.googlesource.com/c/chromium/src/+/1509455 * Remove deprecated type-specific number to string conversion functions https://chromium-review.googlesource.com/c/chromium/src/+/1545881 * DevTools: Adding new performance histograms for launch of top 4 tools https://chromium-review.googlesource.com/c/chromium/src/+/1506388 * Update include paths for //base/hash/hash.h https://chromium-review.googlesource.com/c/chromium/src/+/1544630 * build: Disable ensure_gn_version gclient hook for mac CI checkout * update patches * use maybe version of v8::String::NewFromTwoByte * bump appveyor image version * fix mac ci hopefully * Convert enum to enum class for MenuAnchorPosition https://chromium-review.googlesource.com/c/chromium/src/+/1530508 * use maybe version of ToObject * RenderViewHost::GetProcess is no longer const * Unrefcount AuthChallengeInfo https://chromium-review.googlesource.com/c/chromium/src/+/1550631 * MenuButtonController takes Button rather than MenuButton https://chromium-review.googlesource.com/c/chromium/src/+/1500935 * add //ui/views_bridge_mac to deps to fix link error * forward declare views::Button in atom::MenuDelegate * more v8 patches * base/{=> hash}/md5.h https://chromium-review.googlesource.com/c/chromium/src/+/1535124 * gfx::{PlatformFontWin => win}::* https://chromium-review.googlesource.com/c/chromium/src/+/1534178 * fix v8 patches * [base] Rename TaskScheduler to ThreadPool https://chromium-review.googlesource.com/c/chromium/src/+/1561552 * use internal_config_base for bytecode_builtins_list_generator avoids windows link errors * FIXME: temporarily disable v8/breakpad integration * FIXME: temporarily disable prevent-will-redirect test * FIXME: disable neon on aarch64 pending crbug.com/953815 * update to account for WebCursor refactor https://chromium-review.googlesource.com/c/chromium/src/+/1562755 * enable stack dumping on appveyor * Revert "FIXME: disable neon on aarch64 pending crbug.com/953815" This reverts commit 57f082026be3d83069f2a2814684abf4dc9e7b53. * fix: remove const qualifiers to match upstream * fix: remove const qualifiers to match upstream in cc files as well * don't throw an error when testing if an object is an object * use non-deprecated Buffer constructor * Remove net::CookieSameSite::DEFAULT_MODE enum value https://chromium-review.googlesource.com/c/chromium/src/+/1567955 * depend on modded dbus-native to work around buffer deprecation https://github.com/sidorares/dbus-native/pull/262 * revert clang roll to fix arm build on linux * fixup! depend on modded dbus-native to work around buffer deprecation need more coffee * update coffee-script * robustify verify-mksnapshot w.r.t. command-line parameters * Revert "robustify verify-mksnapshot w.r.t. command-line parameters" This reverts commit a49af01411f684f6025528d604895c3696e0bc57. * fix mksnapshot by matching args * update patches * TMP: enable rdp on appveyor * Changed ContentBrowserClient::CreateQuotaPermissionContext() to return scoped_refptr. https://chromium-review.googlesource.com/c/chromium/src/+/1569376 * Make content::ResourceType an enum class. https://chromium-review.googlesource.com/c/chromium/src/+/1569345 * fixup! Make content::ResourceType an enum class. * turn off rdp * use net::CompletionRepeatingCallback instead of base::Callback<void(int)> * remove disable_ensure_gn_version_gclient_hook.patch * copy repeating callback instead of std::move * fix lint * add completion_repeating_callback.h include
2019-04-20 13:20:37 -04:00
#include "base/task/thread_pool/initialization_util.h"
#include "gin/array_buffer.h"
#include "gin/v8_initializer.h"
#include "shell/browser/microtasks_runner.h"
#include "shell/common/gin_helper/cleaned_up_at_exit.h"
#include "shell/common/node_includes.h"
chore: bump chromium to 98.0.4706.0 (main) (#31555) * chore: bump chromium in DEPS to 97.0.4678.0 * chore: bump chromium in DEPS to 97.0.4679.0 * chore: bump chromium in DEPS to 97.0.4680.0 * chore: bump chromium in DEPS to 97.0.4681.0 * chore: bump chromium in DEPS to 97.0.4682.0 * chore: update patches * 3234737: Disable -Wunused-but-set-variable Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3234737 * 3216953: Reland "Move task-related files from base/ to base/task/" Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3216953 * 3202710: TimeDelta factory function migration. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3202710 * 3226841: Rename WCO::RenderProcessGone to PrimaryMainFrameRenderProcessGone Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3226841 * 3212165: blink/gin: changes blink to load snapshot based on runtime information Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3212165 * 3220292: Deprecate returning a GURL from GURL::GetOrigin() Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3220292 * 3231995: build: Enable -Wbitwise-instead-of-logical everywhere except iOS and Windows Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3231995 * 3205121: Remove base::DictionaryValue::GetDouble Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3205121 * 3208413: [flags] Make --js-flags settings have priority over V8 features Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3208413 * chore: bump chromium in DEPS to 97.0.4683.0 * chore: update patches * 3188834: Combine RWHVBase GetCurrentDeviceScaleFactor/GetDeviceScaleFactor Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3188834 * chore: update process_singleton patches * chore: bump chromium in DEPS to 97.0.4684.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4685.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4686.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4687.0 * chore: update patches * chore: bump chromium in DEPS to 97.0.4688.0 * chore: update patches * 3247722: Use correct source_site_instance if navigating via context menu Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3247722 Update signature of HandleContextMenu() * 3247722: Use correct source_site_instance if navigating via context menu Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3247722 Update signature of HandleContextMenu() * 3223422: Remove PP_ISOLATEDFILESYSTEMTYPE_PRIVATE_PLUGINPRIVATE enum option Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3223422 sync pepper_plugin_support.patch with upstream * chore: bump chromium in DEPS to 97.0.4689.0 * 3247791: ax_mac_merge: Merge AX Math attribute implementations Xref: ax_mac_merge: Merge AX Math attribute implementations chore: fix minor patch shear in #includes * 3243425: Add VisibleTimeRequestTrigger helper class Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3243425 chore: fix minor patch shear in #includes * chore: regen chromium patches * fixup! 3247722: Use correct source_site_instance if navigating via context menu * chore: bump chromium in DEPS to 97.0.4690.0 * 3188659: Window Placement: make GetScreenInfo(s) const Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3188659 simple sync GetScreenInfo with upstream refactor * chore: update patches * chore: bump chromium in DEPS to 97.0.4690.4 * chore: bump chromium in DEPS to 97.0.4692.0 * 3198073: ozone: //content: clean up from USE_X11 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3198073 Fixing patch shear. Nothing to see here. * 3252338: Remove label images checkbox from chrome://accessibility page Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3252338 Part of our a11y patch is no longer needed due to upstream label removal * 3258183: Remove DISALLOW_IMPLICIT_CONSTRUCTORS() definition Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3258183 Replace our use of the macro with explicitly-deleted class methods. See https://chromium-review.googlesource.com/c/chromium/src/+/3256952 for upstream examples of this same replacement. * chore: update patches * 3247295: Unwind SecurityStyleExplanations Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3247295 update GetSecurityStyle() signature and impl to match upstream changes * 3259578: media: grabs lock to ensure video output when occluded Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3259578 Add stub for new upstream virtual method OnCapturerCountChanged() * fixup! 3247295: Unwind SecurityStyleExplanations * 3238504: Fix up drag image is not shown from bookmark bar Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3238504 SetDragImage() no longer takes a widget argument * 3217452: [devtools] Add getSyncInformation host binding Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3217452 Add stub for new upstream method GetSyncInformation(). Stub sends info back to caller saying that syncing is disabled. * chore: bump chromium in DEPS to 98.0.4693.0 * chore: bump chromium in DEPS to 98.0.4694.0 * chore: bump chromium in DEPS to 98.0.4695.0 * chore: bump chromium in DEPS to 98.0.4696.0 * chore: bump chromium in DEPS to 98.0.4697.0 * chore: bump chromium in DEPS to 98.0.4699.0 * chore: bump chromium in DEPS to 98.0.4701.0 * chore: bump chromium in DEPS to 98.0.4703.0 * chore: bump chromium in DEPS to 98.0.4705.0 * chore: bump chromium in DEPS to 98.0.4706.0 * chore: update patches * 3279210: Rename "base/macros.h" => "base/ignore_result.h" https://chromium-review.googlesource.com/c/chromium/src/+/3279210 * 3259964: Remove all DISALLOW_COPY_AND_ASSIGNs https://chromium-review.googlesource.com/c/chromium/src/+/3259964 * 3269029: blink/gin: sets histogram callbacks during isolate creation https://chromium-review.googlesource.com/c/chromium/src/+/3269029 * fixup after rebase * [content] Make ContentMainParams and MainFunctionParams move-only https://chromium-review.googlesource.com/c/chromium/src/+/3244976 * 3255305: Stop sending the securityStateChanged event and unwind https://chromium-review.googlesource.com/c/chromium/src/+/3255305 * [Blink] Add promise support to WebLocalFrame::RequestExecuteScript() https://chromium-review.googlesource.com/c/chromium/src/+/3230010 * 3256162: Simplify RWHV Show and ShowWithVisibility handling https://chromium-review.googlesource.com/c/chromium/src/+/3256162 * 3263824: ozone: //ui/base: clean up from USE_X11 1/* https://chromium-review.googlesource.com/c/chromium/src/+/3263824 * Request or cancel RecordContentToPresentationTimeRequest during capture https://chromium-review.googlesource.com/c/chromium/src/+/3256802 * appcache: remove BrowsingData/quota references https://chromium-review.googlesource.com/c/chromium/src/+/3255725 * [Autofill] Don't show Autofill dropdown if overlaps with permissions https://chromium-review.googlesource.com/c/chromium/src/+/3236729 * Rename to_different_document to should_show_loading_ui in LoadingStateChanged() callbacks https://chromium-review.googlesource.com/c/chromium/src/+/3268574 * cleanup patch * fixup [content] Make ContentMainParams and MainFunctionParams move-only * 3279210: Rename "base/macros.h" => "base/ignore_result.h" https://chromium-review.googlesource.com/c/chromium/src/+/3279210 * ozone: //chrome/browser clean up from USE_X11 https://chromium-review.googlesource.com/c/chromium/src/+/3186490 Refs: https://github.com/electron/electron/issues/31382 * chore: update support_mixed_sandbox_with_zygote.patch * Enable -Wunused-but-set-variable. Refs https://chromium-review.googlesource.com/c/chromium/src/+/3234737 * fixup! ozone: //ui/base: clean up from USE_X11 1/* * fixup! ozone: //chrome/browser clean up from USE_X11 * chore: fix deprecation warning in libuv * chore: fixup for lint * 3251161: Reland "Make the Clang update.py script require Python 3" https://chromium-review.googlesource.com/c/chromium/src/+/3251161 * fixup: Enable -Wunused-but-set-variable. * [base][win] Rename DIR_APP_DATA to DIR_ROAMING_APP_DATA https://chromium-review.googlesource.com/c/chromium/src/+/3262369 * Replace sandbox::policy::SandboxType with mojom Sandbox enum https://chromium-review.googlesource.com/c/chromium/src/+/3213677 * fixup: [content] Make ContentMainParams and MainFunctionParams move-only * build: ensure angle has a full git checkout available to it * fixup: [base][win] Rename DIR_APP_DATA to DIR_ROAMING_APP_DATA * fixup lint * [unseasoned-pdf] Dispatch 'afterprint' event in PDF plugin frame https://chromium-review.googlesource.com/c/chromium/src/+/3223434 * fixup: [Autofill] Don't show Autofill dropdown if overlaps with permissions * 3217591: Move browser UI CSS color parsing to own file part 2/2 https://chromium-review.googlesource.com/c/chromium/src/+/3217591 * Make kNoSandboxAndElevatedPrivileges only available to utilities https://chromium-review.googlesource.com/c/chromium/src/+/3276784 * 3211575: [modules] Change ScriptOrModule to custom Struct https://chromium-review.googlesource.com/c/v8/v8/+/3211575 * Address review feedback * chore: update patches * 3211575: [modules] Change ScriptOrModule to custom Struct https://chromium-review.googlesource.com/c/v8/v8/+/3211575 * fix: unused variable compat * chore: remove redundant patch * fixup for 3262517: Re-enable WindowCaptureMacV2 https://chromium-review.googlesource.com/c/chromium/src/+/3262517 * chore: cleanup todo The functions added in https://chromium-review.googlesource.com/c/chromium/src/+/3256802 are not used by offscreen rendering. * fixup: update mas_no_private_api.patch * 3216879: [PA] Make features::kPartitionAllocLazyCommit to be PartitionOptions::LazyCommit Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3216879 Fixes up commit b2f1aca95604ec61649808c846657454097e6935 * chore: cleanup support_mixed_sandbox_with_zygote.patch * test: use window focus event instead of delay to wait for webContents focus Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: VerteDinde <khammond@slack-corp.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-11-24 09:45:59 +01:00
#include "third_party/blink/public/common/switches.h"
#include "third_party/electron_node/src/node_wasm_web_api.h"
namespace {
v8::Isolate* g_isolate;
}
namespace electron {
namespace {
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> CreateIsolateHolder(
v8::Isolate* isolate,
size_t* max_young_generation_size) {
std::unique_ptr<v8::Isolate::CreateParams> create_params =
gin::IsolateHolder::getDefaultIsolateParams();
// The value is needed to adjust heap limit when capturing
// snapshot via v8.setHeapSnapshotNearHeapLimit(limit) or
// --heapsnapshot-near-heap-limit=max_count.
*max_young_generation_size =
create_params->constraints.max_young_generation_size_in_bytes();
// Align behavior with V8 Isolate default for Node.js.
// This is necessary for important aspects of Node.js
// including heap and cpu profilers to function properly.
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
return std::make_unique<gin::IsolateHolder>(
base::SingleThreadTaskRunner::GetCurrentDefault(),
gin::IsolateHolder::kSingleThread,
gin::IsolateHolder::IsolateType::kUtility, std::move(create_params),
gin::IsolateHolder::IsolateCreationMode::kNormal, nullptr, nullptr,
isolate);
}
} // namespace
JavascriptEnvironment::JavascriptEnvironment(uv_loop_t* event_loop,
bool setup_wasm_streaming)
: isolate_holder_{CreateIsolateHolder(
Initialize(event_loop, setup_wasm_streaming),
&max_young_generation_size_)},
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
isolate_{isolate_holder_->isolate()},
locker_{std::make_unique<v8::Locker>(isolate_)} {
isolate_->Enter();
v8::HandleScope scope(isolate_);
auto context = node::NewContext(isolate_);
CHECK(!context.IsEmpty());
context->Enter();
}
JavascriptEnvironment::~JavascriptEnvironment() {
DCHECK_NE(platform_, nullptr);
{
v8::HandleScope scope(isolate_);
isolate_->GetCurrentContext()->Exit();
}
isolate_->Exit();
g_isolate = nullptr;
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
// Deinit gin::IsolateHolder prior to calling NodePlatform::UnregisterIsolate.
// Otherwise cppgc::internal::Sweeper::Start will try to request a task runner
// from the NodePlatform with an already unregistered isolate.
locker_.reset();
isolate_holder_.reset();
platform_->UnregisterIsolate(isolate_);
}
v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop,
bool setup_wasm_streaming) {
auto* cmd = base::CommandLine::ForCurrentProcess();
2015-11-13 12:22:08 +08:00
// --js-flags.
std::string js_flags = "--no-freeze-flags-after-init ";
js_flags.append(cmd->GetSwitchValueASCII(blink::switches::kJavaScriptFlags));
v8::V8::SetFlagsFromString(js_flags.c_str(), js_flags.size());
2017-12-08 09:23:17 +09:00
// The V8Platform of gin relies on Chromium's task schedule, which has not
// been started at this point, so we have to rely on Node's V8Platform.
auto* tracing_agent = new node::tracing::Agent();
auto* tracing_controller = tracing_agent->GetTracingController();
node::tracing::TraceEventHelper::SetAgent(tracing_agent);
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
platform_ = node::MultiIsolatePlatform::Create(
base::RecommendedMaxNumberOfThreadsInThreadGroup(3, 8, 0.1, 0),
tracing_controller, gin::V8Platform::GetCurrentPageAllocator());
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
v8::V8::InitializePlatform(platform_.get());
chore: bump chromium to 134.0.6968.0 (main) (#45172) * chore: bump chromium in DEPS to 134.0.6948.0 * chore: update can_create_window.patch https://chromium-review.googlesource.com/c/chromium/src/+/6151982 no patch code changes, but had to manually apply due to upstream context shear * chore: update proxy_config_monitor.patch no manual changes; patch applied with fuzz 2 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6126219 * chore: update build_add_electron_tracing_category.patch Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6149256 * chore: update adjust_accessibility_ui_for_electron.patch https://chromium-review.googlesource.com/c/chromium/src/+/6105650 no patch code changes, but had to manually apply due to upstream context shear * chore: e patches all * chore: use fully-qualified path for all.gn Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6154997 * chore: do not use a variable when assigning rtc_use_h264 Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6154997 * Move GlobalShortcutListenerLinux to //ui/base Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6097375 * [MPArch Guest View] Make WebPreferences queried per frame tree root Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6096390 * [Status Icons] Allow vector resources https://chromium-review.googlesource.com/c/chromium/src/+/6139403 * [Extensions] Move MatchOriginAsFallbackBehavior to Mojom Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6141793 * Remove StrongAlias::Hasher Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6132291 * Rename text-change and select-change methods and related stuff Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6148816 * [Code Health] Remove stale feature EnableWebUsbOnExtensionServiceWorker https://chromium-review.googlesource.com/c/chromium/src/+/6115161 * [Extensions Cleanup] Move creation of tab-based ports to factory method https://chromium-review.googlesource.com/c/chromium/src/+/6143725 * refactor: add StatusIconGtk::SetIcon() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6139403 copied from chrome/browser/status_icons/status_icon.cc * refactor: add TrayIconLinux::GetIcon() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/6139403 * chore: update feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch remove unused filter_ field * chore: bump chromium in DEPS to 134.0.6950.0 * chore: bump chromium in DEPS to 134.0.6952.0 * chore: bump chromium in DEPS to 134.0.6954.0 * chore: bump chromium in DEPS to 134.0.6956.0 * chore: update Chromium patches * 6165749: Check scanout support in RenderableGpuMemoryBufferPool | https://chromium-review.googlesource.com/c/chromium/src/+/6165749 * 6106730: [Win] Use DXGI swapchains and DCOMP visuals in software mode | https://chromium-review.googlesource.com/c/chromium/src/+/6106730 * chore: update patches * chore: bump chromium in DEPS to 134.0.6958.0 * chore: bump chromium in DEPS to 134.0.6960.0 * chore: update chromium patches * 6168371: Remove extensions GlobalShortcutListener wrapper | https://chromium-review.googlesource.com/c/chromium/src/+/6168371 * chore: update patches * 6161637: WebUI: Leverage build_webui() in chrome://translate-internals | https://chromium-review.googlesource.com/c/chromium/src/+/6161637 * chore: bump chromium in DEPS to 134.0.6962.0 * 6177329: Remove policy.used_policy_certificates pref on ChromeOS | https://chromium-review.googlesource.com/c/chromium/src/+/6177329 * 6180524: Simplify logic in components/os_crypt/sync/BUILD.gn | https://chromium-review.googlesource.com/c/chromium/src/+/6180524 * 6144831: Enforce --disallow-v8-feature-flag-overrides in the renderer | https://chromium-review.googlesource.com/c/chromium/src/+/6144831 * chore: update patches * chore: bump chromium in DEPS to 134.0.6964.0 * 6181010: Ensure busy cursor does not show via LaunchWithoutSandbox | https://chromium-review.googlesource.com/c/chromium/src/+/6181010 * chore: update patches * chore: bump chromium in DEPS to 134.0.6966.0 * 6180598: [api] Remove Reallocate | https://chromium-review.googlesource.com/c/v8/v8/+/6180598 * 6170781: [Refactor] Move UninstallExtension to ExtensionRegistrar. | https://chromium-review.googlesource.com/c/chromium/src/+/6170781 * chore: update filenames.libcxx.gni * 6168207: cdm: Remove widevine_cdm_version.h | https://chromium-review.googlesource.com/c/chromium/src/+/6168207 * chore: bump chromium in DEPS to 134.0.6968.0 * 6030552: [macOS] Allow using vibrancy with NativeWidgetNSWindowBridge | https://chromium-review.googlesource.com/c/chromium/src/+/6030552 * fix: use explicit copy to replace realloc impl https://chromium-review.googlesource.com/c/v8/v8/+/6180598 https://issues.chromium.org/issues/331326406 As per recommendation, "File an issue with Node to explicitly copy,because they copy under the hood anyway" * fixup! 6106730: [Win] Use DXGI swapchains and DCOMP visuals in software mode | https://chromium-review.googlesource.com/c/chromium/src/+/6106730 * fix: undefine win32 StrCat https://chromium-review.googlesource.com/c/chromium/src/+/6172292 * fix: //device/vr:directx_helpers breaking the build https://chromium-review.googlesource.com/c/chromium/src/+/6064548 Upstreamed in https://chromium-review.googlesource.com/c/chromium/src/+/6186102 * fix: avoid calling ui::Layer::SetFillsBoundsOpaquely https://chromium-review.googlesource.com/c/chromium/src/+/6175787 The layer opacity is determined by the background color's alpha value * fix: build with proprietary_codecs The explicit setting of rtc_use_h264 is no longer needed since https://webrtc-review.googlesource.com/c/src/+/62380 * fix: increase empty trace file size threshold https://chromium-review.googlesource.com/c/chromium/src/+/6176642 Traces now contain a net-constants property to allow them to be converted to a net log. These contain ~1240 new properties with formatted JSON data. * fix: node tests missing resource management globals https://chromium-review.googlesource.com/c/chromium/src/+/6174695 * fixup! fix: use explicit copy to replace realloc impl * chore: disable focus handling test due to win32/ia32 regression --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: Keeley Hammond <khammond@slack-corp.com> Co-authored-by: VerteDinde <vertedinde@electronjs.org> Co-authored-by: Samuel Maddock <smaddock@slack-corp.com> Co-authored-by: Samuel Maddock <samuelmaddock@electronjs.org>
2025-01-23 23:07:43 -05:00
gin::IsolateHolder::Initialize(
gin::IsolateHolder::kNonStrictMode,
gin::ArrayBufferAllocator::SharedInstance(),
nullptr /* external_reference_table */, js_flags,
false /* disallow_v8_feature_flag_overrides */,
nullptr /* fatal_error_callback */, nullptr /* oom_error_callback */,
false /* create_v8_platform */);
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;
}
// static
v8::Isolate* JavascriptEnvironment::GetIsolate() {
CHECK(g_isolate);
return g_isolate;
}
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 JavascriptEnvironment::CreateMicrotasksRunner() {
DCHECK(!microtasks_runner_);
microtasks_runner_ = std::make_unique<MicrotasksRunner>(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
isolate_holder_->WillCreateMicrotasksRunner();
base::CurrentThread::Get()->AddTaskObserver(microtasks_runner_.get());
}
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 JavascriptEnvironment::DestroyMicrotasksRunner() {
DCHECK(microtasks_runner_);
// Should be called before running gin_helper::CleanedUpAtExit::DoCleanup.
// This helps to signal wrappable finalizer callbacks to not act on freed
// parameters.
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
isolate_holder_->WillDestroyMicrotasksRunner();
{
v8::HandleScope scope(isolate_);
gin_helper::CleanedUpAtExit::DoCleanup();
}
base::CurrentThread::Get()->RemoveTaskObserver(microtasks_runner_.get());
}
} // namespace electron