From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jeremy Rose 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 c9c33c560476e43e097f04d1b21154debc20667c..fcbccbb67b0d152a771e26aaae5beb85ffe83bc2 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc @@ -443,8 +443,9 @@ TrustedTypesCodeGenerationCheck(v8::Local context, return {true, V8String(context->GetIsolate(), stringified_source)}; } -static v8::ModifyCodeGenerationFromStringsResult -CodeGenerationCheckCallbackInMainThread(v8::Local context, +// static +v8::ModifyCodeGenerationFromStringsResult +V8Initializer::CodeGenerationCheckCallbackInMainThread(v8::Local context, v8::Local 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 39d1351a4a8bbc95097640be54affec426abe73e..30a36cf16d4a8f4692ec6a13be1217212390172a 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.h +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.h @@ -69,6 +69,10 @@ class CORE_EXPORT V8Initializer { v8::Local); static void MessageHandlerInWorker(v8::Local, v8::Local); + static v8::ModifyCodeGenerationFromStringsResult + CodeGenerationCheckCallbackInMainThread(v8::Local context, + v8::Local source, + bool is_code_like); static bool WasmCodeGenerationCheckCallbackInMainThread( v8::Local context, v8::Local source);