electron/patches/chromium/isolate_holder.patch
electron-roller[bot] 47572286f3
chore: bump chromium to 135.0.7015.0 (main) (#45500)
* 6230977

* chore: bump chromium to 135.0.7012.0

* chore: update accelerator.patch

Support parsing Ctrl+Alt shortcuts | 6238137

* 6234236: Reapply bindings: Pass CppHeap on Isolate creation | 6234236

* 6234614: [ios blink] Move to use external begin frame source | 6234614

* chore: update chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch

no manual changes; patch applied with fuzz

* chore: update chromium/build_libc_as_static_library.patch

no manual changes; patch applied with fuzz

* chore: remove chromium/cherry-pick-dd8e2822e507.patch

landed upstream

* 6188884: Grit: Remove output_all_resource_defines from list of valid attributes. | 6188884

* 6226981: [views-ax] Remove View::GetAccessibleNodeData() method | 6226981

* 6214895: [views-ax] Deprecate View::NotifyAccessibilityEvent | 6214895

* 6196494: Remove ImageView::SetImage() with ImageSkia param | 6196494

* 6236267: [cleanup] Remove unused PrinterBasicInfo fields | 6236267

* refactor: remove status, isDefault properties from PrinterInfo

Xref: 6236267

* chore: lint

* fixup: added mas bypass to new file added in 6208630 see slack for more context

* chore: node script/gen-libc++-filenames.js

* chore: e patches all

* fix: duplicate crdtp symbols

* chore: update patches

* fixup! [Media Features] Remove launched features

---------

Co-authored-by: alice <alice@makenotion.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2025-02-18 11:51:27 -05:00

83 lines
3.9 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 8632f1c18b407bb7832900bcebadacb3707224ac..d1b95149ea0d16af2606900f10898a355026ffe1 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -81,7 +81,8 @@ IsolateHolder::IsolateHolder(
v8::AddHistogramSampleCallback add_histogram_sample_callback,
scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> best_effort_task_runner,
- std::unique_ptr<v8::CppHeap> cpp_heap)
+ std::unique_ptr<v8::CppHeap> cpp_heap,
+ v8::Isolate* isolate)
: IsolateHolder(std::move(task_runner),
access_mode,
isolate_type,
@@ -92,7 +93,8 @@ IsolateHolder::IsolateHolder(
std::move(cpp_heap)),
isolate_creation_mode,
std::move(user_visible_task_runner),
- std::move(best_effort_task_runner)) {}
+ std::move(best_effort_task_runner),
+ isolate) {}
IsolateHolder::IsolateHolder(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
@@ -101,7 +103,8 @@ IsolateHolder::IsolateHolder(
std::unique_ptr<v8::Isolate::CreateParams> params,
IsolateCreationMode isolate_creation_mode,
scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> best_effort_task_runner)
+ scoped_refptr<base::SingleThreadTaskRunner> best_effort_task_runner,
+ v8::Isolate* isolate)
: access_mode_(access_mode), isolate_type_(isolate_type) {
CHECK(Initialized())
<< "You need to invoke gin::IsolateHolder::Initialize first";
@@ -112,7 +115,7 @@ IsolateHolder::IsolateHolder(
v8::ArrayBuffer::Allocator* allocator = params->array_buffer_allocator;
DCHECK(allocator);
- isolate_ = v8::Isolate::Allocate();
+ isolate_ = isolate ? isolate : v8::Isolate::Allocate();
isolate_data_ = std::make_unique<PerIsolateData>(
isolate_, allocator, access_mode_, task_runner,
std::move(user_visible_task_runner), std::move(best_effort_task_runner));
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index e27f177ce27e177abf6cee84cd466e7a8a829ee7..dc3a5b0678b9c686e241b492e2c3b5ac833611a3 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -88,7 +88,8 @@ class GIN_EXPORT IsolateHolder {
nullptr,
scoped_refptr<base::SingleThreadTaskRunner> best_effort_task_runner =
nullptr,
- std::unique_ptr<v8::CppHeap> cpp_heap = {});
+ std::unique_ptr<v8::CppHeap> cpp_heap = {},
+ v8::Isolate* isolate = nullptr);
IsolateHolder(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
AccessMode access_mode,
@@ -98,7 +99,8 @@ class GIN_EXPORT IsolateHolder {
scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner =
nullptr,
scoped_refptr<base::SingleThreadTaskRunner> best_effort_task_runner =
- nullptr);
+ nullptr,
+ v8::Isolate* isolate = nullptr);
IsolateHolder(const IsolateHolder&) = delete;
IsolateHolder& operator=(const IsolateHolder&) = delete;
~IsolateHolder();