electron/patches/chromium/isolate_holder.patch
electron-roller[bot] 49e62f1261
chore: bump chromium to 95.0.4629.0 (main) (#30676)
* chore: bump chromium in DEPS to 95.0.4620.0

* chore: update patches

* 3076261: Move args_ to private in ExtensionFunction

https://chromium-review.googlesource.com/c/chromium/src/+/3076261

* [GURL -> SiteForCookies] content/public/browser/content_browser_client.h

https://chromium-review.googlesource.com/c/chromium/src/+/3107759

* chore: fix -Wunreachable-code-return in node

* Tracing to diagnose ContentScriptTracker-related bad message reports

https://chromium-review.googlesource.com/c/chromium/src/+/3057922

* chore: bump chromium in DEPS to 95.0.4621.0

* chore: update patches

* Remove title from the URL format on Windows.

https://chromium-review.googlesource.com/c/chromium/src/+/3108445

* chore: bump chromium in DEPS to 95.0.4623.0

* Revert "chore: disable v8 oilpan"

This reverts commit 5d255cf1d8e8efbb906047937a713279e5f800d0.

(cherry picked from commit ba5cde4da2428020d99b7fb603c702878f95da78)

* Change file paths in network context params to be relative.

https://chromium-review.googlesource.com/c/chromium/src/+/3092927

* Code Health: Rename/replace content::WebUI::RegisterMessageCallback().

https://chromium-review.googlesource.com/c/chromium/src/+/3104691

* Migrate CanExecuteContentScriptSync to Mojo

https://chromium-review.googlesource.com/c/chromium/src/+/3108452

* chore: update patches

* remove unreachable code

* Revert "Revert "chore: disable v8 oilpan""

This reverts commit fef495c0294e21760df51bddb5f7bf1ec9ed5f1e.

* fixup mas patch

* Reland "[include] Split out v8.h"

https://chromium-review.googlesource.com/c/v8/v8/+/3113629

* chore: bump chromium in DEPS to 95.0.4624.0

* chore: bump chromium in DEPS to 95.0.4625.0

* chore: bump chromium in DEPS to 95.0.4626.0

* 3033504: Pass NavigationDownloadPolicy in CreateNewWindowParams

https://chromium-review.googlesource.com/c/chromium/src/+/3033504

* 3058038: Introduce TestPrintingContext & test UpdatePrintSettings

https://chromium-review.googlesource.com/c/chromium/src/+/3058038

* 3114943: [Conditional Focus][#4] Add tests and remove flag gating

https://chromium-review.googlesource.com/c/chromium/src/+/3114943

* chore: update patch indices

* chore: bump chromium in DEPS to 95.0.4627.0

* chore: update patches

* 3093591: ozone: webpagepopups: calculate anchor for menu bounds. 4/*

https://chromium-review.googlesource.com/c/chromium/src/+/3093591

* 3110414: [PA] Remove the leading cookie

https://chromium-review.googlesource.com/c/chromium/src/+/3110414

* chore: update patches

* 3076261: Move args_ to private in ExtensionFunction

https://chromium-review.googlesource.com/c/chromium/src/+/3076261

* 3113629: Reland "[include] Split out v8.h"

https://chromium-review.googlesource.com/c/v8/v8/+/3113629

* chore: bump chromium in DEPS to 95.0.4628.0

* chore: update patches

* chore: bump chromium in DEPS to 95.0.4629.0

* chore: update patches

* Fix chrome root store codegen for cross-compile builds.

https://chromium-review.googlesource.com/c/chromium/src/+/3133701

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2021-09-01 15:55:07 -04:00

57 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Thu, 18 Oct 2018 17:07:27 -0700
Subject: isolate_holder.patch
Pass pre allocated isolate for initialization, node platform
needs to register on an isolate so that it can be used later
down in the initialization process of an isolate.
Specifically, v8::Isolate::Initialize ends up calling
NodePlatform::GetForegroundTaskRunner, which requires that the
isolate has previously been registered with NodePlatform::RegisterIsolate.
However, if we let gin allocate the isolate, there's no opportunity
for us to register the isolate in between Isolate::Allocate and
Isolate::Initialize.
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index 366e105c968b1be51eb0f26709486d086cf12eca..70ba5d0ecd8c4c10628db11818012e620895684b 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -55,7 +55,8 @@ IsolateHolder::IsolateHolder(
AccessMode access_mode,
AllowAtomicsWaitMode atomics_wait_mode,
IsolateType isolate_type,
- IsolateCreationMode isolate_creation_mode)
+ IsolateCreationMode isolate_creation_mode,
+ v8::Isolate* isolate)
: access_mode_(access_mode), isolate_type_(isolate_type) {
CHECK(Initialized())
<< "You need to invoke gin::IsolateHolder::Initialize first";
@@ -66,7 +67,11 @@ IsolateHolder::IsolateHolder(
v8::ArrayBuffer::Allocator* allocator = g_array_buffer_allocator;
DCHECK(allocator);
- isolate_ = v8::Isolate::Allocate();
+ if (!isolate) {
+ isolate_ = v8::Isolate::Allocate();
+ } else {
+ isolate_ = isolate;
+ }
isolate_data_ = std::make_unique<PerIsolateData>(isolate_, allocator,
access_mode_, task_runner);
if (isolate_creation_mode == IsolateCreationMode::kCreateSnapshot) {
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index 8ecce17b5bb8b5106de913a2d0197fd3affb1c08..554beedf1fd1e256466b144468b1338fc6ccd473 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -79,7 +79,8 @@ class GIN_EXPORT IsolateHolder {
AccessMode access_mode,
AllowAtomicsWaitMode atomics_wait_mode,
IsolateType isolate_type,
- IsolateCreationMode isolate_creation_mode = IsolateCreationMode::kNormal);
+ IsolateCreationMode isolate_creation_mode = IsolateCreationMode::kNormal,
+ v8::Isolate* isolate = nullptr);
IsolateHolder(const IsolateHolder&) = delete;
IsolateHolder& operator=(const IsolateHolder&) = delete;
~IsolateHolder();