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 df61f9a3f12a626a295488d24da3cf31aa1f12eb..965e9562f0e891ab043cd7dfab0f53d1bb08192d 100644 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc @@ -422,8 +422,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 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); 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);