electron/patches/chromium/gin_enable_disable_v8_platform.patch
electron-roller[bot] c3036d4557
chore: bump chromium to 117.0.5938.0 (main) (#39375)
* chore: bump chromium in DEPS to 117.0.5929.0

* chore: bump chromium in DEPS to 117.0.5931.0

* chore: bump chromium in DEPS to 117.0.5932.0

* chore: update patches

* 4728317: Prevent PrintRenderFrameHelper from printing when already printing
 | https://chromium-review.googlesource.com/c/chromium/src/+/4728317

* 4739501: Use base::SequenceBound to manage SerialPortManagerImpl |
 https://chromium-review.googlesource.com/c/chromium/src/+/4739501

* 4702051: Allow overriding source in install-sysroot.py | https://chromium-review.googlesource.com/c/chromium/src/+/4702051

* chore: update filenames.libcxx.gni

* 4727002: Rename "enable_arc2" to "enable_arc" |
https://chromium-review.googlesource.com/c/chromium/src/+/4727002

* chore: bump chromium in DEPS to 117.0.5934.0

* 4736873: Rename ColorSpaces methods on display::Display | https://chromium-review.googlesource.com/c/chromium/src/+/4736873

* 4727203: Replace bool with an enum in as suggested in DevtoolsManagerDelegate. | https://chromium-review.googlesource.com/c/chromium/src/+/4727203

* 4744479: [DevTools] Add 'generateTaggedPDF' option to DevTools Page.printToPDF | https://chromium-review.googlesource.com/c/chromium/src/+/4744479

* 4735893: Don't share WebUSB permissions with webviews | https://chromium-review.googlesource.com/c/chromium/src/+/4735893

* revert: update filenames.libcxx.gni

* chore: bump chromium in DEPS to 117.0.5936.0

* chore: update patches

* 4746465: SAA: Query for embargoed StorageAccess permissions | https://chromium-review.googlesource.com/c/chromium/src/+/4746465

* 4666325: Move buildtools/third_party/lib*/trunk source paths to third_party/lib*/src. | https://chromium-review.googlesource.com/c/chromium/src/+/4666325

* chore: bump chromium in DEPS to 117.0.5938.0

* chore: bump chromium in DEPS to 118.0.5939.0

* chore: update patches

* Send line bounds through CursorAnchorInfo on requestCursorUpdate

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

* Fixup lint for Move buildtools/third_party/lib*/trunk source paths to third_party/lib*/src

* 4700305: [mac] Fix override of CHILD_PROCESS_EXE

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

Needed because of 4729689: Reland "Remove redundant existence check in PathService" | https://chromium-review.googlesource.com/c/chromium/src/+/4729689

* 4753759: More consistent icon handling for menus.

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

* chore: bump chromium in DEPS to 118.0.5941.0

* chore: update patches

* chore: bump chromium in DEPS to 117.0.5938.0

* test: update nan-spec-runner cflags

* build: fix isystem include path in nan-spec-runner

* fixup! 4666325: Move buildtools/third_party/lib*/trunk source paths to third_party/lib*/src. | https://chromium-review.googlesource.com/c/chromium/src/+/4666325

fix a few more instances of the old path

libc++.a and libc++abi.a are still in buildtools/

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2023-08-15 10:49:41 -05:00

77 lines
4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Cheng Zhao <zcbenz@gmail.com>
Date: Thu, 20 Sep 2018 17:47:44 -0700
Subject: gin_enable_disable_v8_platform.patch
We don't use gin to create the V8 platform, because we need to inject Node
things.
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index 4cb88241eeaaacdd1c1e419759fd56bc003dbaf3..1c3536a183aad1965e834b1681e36a3fc46ae419 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -140,9 +140,10 @@ void IsolateHolder::Initialize(ScriptMode mode,
const intptr_t* reference_table,
const std::string js_command_line_flags,
v8::FatalErrorCallback fatal_error_callback,
- v8::OOMErrorCallback oom_error_callback) {
+ v8::OOMErrorCallback oom_error_callback,
+ bool create_v8_platform) {
CHECK(allocator);
- V8Initializer::Initialize(mode, js_command_line_flags, oom_error_callback);
+ V8Initializer::Initialize(mode, js_command_line_flags, oom_error_callback, create_v8_platform);
g_array_buffer_allocator = allocator;
g_reference_table = reference_table;
g_fatal_error_callback = fatal_error_callback;
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
index c19eb72e8d37fe8145b813d07875addf793e12dc..a5db8841773618814ac90f740201d4d7e9057b3c 100644
--- a/gin/public/isolate_holder.h
+++ b/gin/public/isolate_holder.h
@@ -113,7 +113,8 @@ class GIN_EXPORT IsolateHolder {
const intptr_t* reference_table = nullptr,
const std::string js_command_line_flags = {},
v8::FatalErrorCallback fatal_error_callback = nullptr,
- v8::OOMErrorCallback oom_error_callback = nullptr);
+ v8::OOMErrorCallback oom_error_callback = nullptr,
+ bool create_v8_platform = true);
// Returns whether `Initialize` has already been invoked in the process.
// Initialization is a one-way operation (i.e., this method cannot return
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
index f280373f29263c2d3481e701a38f98ba6557e71a..b5f427fcb7239ad864c43d5df6730d564aadb414 100644
--- a/gin/v8_initializer.cc
+++ b/gin/v8_initializer.cc
@@ -424,7 +424,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
// static
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
const std::string js_command_line_flags,
- v8::OOMErrorCallback oom_error_callback) {
+ v8::OOMErrorCallback oom_error_callback,
+ bool create_v8_platform) {
static bool v8_is_initialized = false;
if (v8_is_initialized)
return;
@@ -434,7 +435,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
// See https://crbug.com/v8/11043
SetFlags(mode, js_command_line_flags);
- v8::V8::InitializePlatform(V8Platform::Get());
+ if (create_v8_platform)
+ v8::V8::InitializePlatform(V8Platform::Get());
// Set this as early as possible in order to ensure OOM errors are reported
// correctly.
diff --git a/gin/v8_initializer.h b/gin/v8_initializer.h
index d499cb43c4e12ca32912fce7078fcadff7509a87..dd9899c3e0dbadfc0074ffce87d51193e1c963cb 100644
--- a/gin/v8_initializer.h
+++ b/gin/v8_initializer.h
@@ -31,7 +31,8 @@ class GIN_EXPORT V8Initializer {
// This should be called by IsolateHolder::Initialize().
static void Initialize(IsolateHolder::ScriptMode mode,
const std::string js_command_line_flags = {},
- v8::OOMErrorCallback oom_error_callback = nullptr);
+ v8::OOMErrorCallback oom_error_callback = nullptr,
+ bool create_v8_platform = true);
// Get address and size information for currently loaded snapshot.
// If no snapshot is loaded, the return values are null for addresses