electron/patches/chromium/expose_v8initializer_codegenerationcheckcallbackinmainthread.patch
electron-roller[bot] 0e4e9dc98c
chore: bump chromium to 121.0.6116.0 (main) (#40490)
* chore: bump chromium in DEPS to 121.0.6116.0

* chore: update patches

* Update webIDL to support close event.

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

* Remove uses of implicit conversion of ScopedTypeRef

Refs https://bugs.chromium.org/p/chromium/issues/detail?id=1495439

* Add GlobalRenderFrameHostToken

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

* [DevTools] Console Insights: move from build flag to Feature API

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

* [Extensions] Use script serialization in scripting API

Refs https://chromium-review.googlesource.com/c/chromium/src/+/4968680
Refs https://chromium-review.googlesource.com/c/chromium/src/+/4998265

* [api] Remove AllCan Read/Write

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

* chore: update libcxx files

* chore: address nan compilation error

* spec: use nan dependency from third_party

It is easier to get fixes for spec modules depending on nan

* ci: publish nan artifact for woa

* fix: bad patch update

* chore: update nan resolution

* Revert "chore: update nan resolution"

This reverts commit 786cdb858c9fc8a038a8f3e16068ee5b4a050137.

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
2023-11-14 13:21:32 -08:00

38 lines
2.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jeremy Rose <japthorp@slack-corp.com>
Date: Mon, 5 Dec 2022 14:27:20 -0800
Subject: expose V8Initializer::CodeGenerationCheckCallbackInMainThread
This is needed to blend Blink and Node's policy for code generation policy.
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
index eefae4b59faf4e395977cc59d214d835e079bf9d..822f31cc44a1c3a67b345d81eb220356446e4f82 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -428,8 +428,9 @@ TrustedTypesCodeGenerationCheck(v8::Local<v8::Context> context,
return {true, V8String(context->GetIsolate(), stringified_source)};
}
-static v8::ModifyCodeGenerationFromStringsResult
-CodeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> context,
+// static
+v8::ModifyCodeGenerationFromStringsResult
+V8Initializer::CodeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> context,
v8::Local<v8::Value> source,
bool is_code_like) {
// The TC39 "Dynamic Code Brand Check" feature is currently behind a flag.
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.h b/third_party/blink/renderer/bindings/core/v8/v8_initializer.h
index 7a08647d69a31ff439bbef8c7b8cde8de2953ae7..9e628b96a845322d407f9da30a63c04ef5de9c24 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.h
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.h
@@ -68,6 +68,10 @@ class CORE_EXPORT V8Initializer {
v8::Local<v8::Value>);
static void MessageHandlerInWorker(v8::Local<v8::Message>,
v8::Local<v8::Value>);
+ static v8::ModifyCodeGenerationFromStringsResult
+ CodeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> context,
+ v8::Local<v8::Value> source,
+ bool is_code_like);
static bool WasmCodeGenerationCheckCallbackInMainThread(
v8::Local<v8::Context> context,
v8::Local<v8::String> source);