From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Mon, 5 Oct 2020 13:43:59 -0700
Subject: chore: expose v8 initialization isolate callbacks

This commit is necessary in order to ensure consistent behavior from
v8 Isolate callbacks in contexts which Node.js does not control. If
we're running with contextIsolation enabled, we should be falling back
to Blink's logic. This will be upstreamed in some form.

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 c98a621a366c21fef73be108c7ac809517ca9815..62cd22b0b42df76c5e527d0ad0b953a460f3aaee 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -448,7 +448,7 @@ CodeGenerationCheckCallbackInMainThread(v8::Local<v8::Context> context,
   return {true, std::move(stringified_source)};
 }
 
-static bool WasmCodeGenerationCheckCallbackInMainThread(
+bool V8Initializer::WasmCodeGenerationCheckCallbackInMainThread(
     v8::Local<v8::Context> context,
     v8::Local<v8::String> source) {
   if (ExecutionContext* execution_context = ToExecutionContext(context)) {
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 e7cbc5db7d15aa0fcfb37ba261673b973827296a..6b93aa449a005e06862a99ea0c9b751ffff2d6ec 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.h
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.h
@@ -67,6 +67,9 @@ class CORE_EXPORT V8Initializer {
                                          v8::Local<v8::Value>);
   static void MessageHandlerInWorker(v8::Local<v8::Message>,
                                      v8::Local<v8::Value>);
+  static bool WasmCodeGenerationCheckCallbackInMainThread(
+    v8::Local<v8::Context> context,
+    v8::Local<v8::String> source);
 };
 
 }  // namespace blink
