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 e2213b00d73f399bb14b7edfa0fb719aa12a6be5..363f9e7a823864f67faa7ce9ec6fd914f371652e 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
@@ -450,7 +450,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
