62da00e5c5
* chore: bump chromium in DEPS to 7f366dc6e2f06228b12b021cc1486a1de81a257d * chore: bump chromium in DEPS to d785c1a601f5f33627d23e40b1ed9dd94c63d818 * update patches * Rename an old referrer policy value https://chromium-review.googlesource.com/c/chromium/src/+/2082856 * chore: bump chromium in DEPS to 735e0d2910b2e55c15e0b9cb9fca9431307ac661 * update v8 patches * Update DEPS * update patches * chore: bump chromium in DEPS to b3d09c15c4460680b85218b7b0eb0849c5a6e840 * Replace blink::WebCursorInfo with ui::Cursor https://chromium-review.googlesource.com/c/chromium/src/+/1997138 * chore: bump chromium in DEPS to bf433ad6dcfcaac460512bb45a53d5a2ea5356f9 * chore: bump chromium in DEPS to 38fad190ac908b6977ab271acc82c2fe74f6e85e * chore: bump chromium in DEPS to aa597178119cb37ab54caeda27b2ef30a2f9a003 * update patches * DownloadURLParameters: Remove NetworkIsolationKey parameter. https://chromium-review.googlesource.com/c/chromium/src/+/2050987 * fix pdf viewer tests by binding more mojo things * chore: bump chromium in DEPS to 08835601be331b4a223e6e2bd9d5ce6c37cbdec6 Co-authored-by: Jeremy Apthorp <jeremya@chromium.org> Co-authored-by: Jeremy Apthorp <nornagon@nornagon.net>
74 lines
3.2 KiB
Diff
74 lines
3.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
Date: Thu, 20 Sep 2018 17:47:44 -0700
|
|
Subject: gin_enable_disable_v8_platform.patch
|
|
|
|
We don't use gin to create the V8 platform, because we need to inject Node
|
|
things.
|
|
|
|
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
|
|
index ee74e6ea92c64d0e95a4988557b236667f5b7e42..c3ae4c6221686479d05800c51d17d581c095e397 100644
|
|
--- a/gin/isolate_holder.cc
|
|
+++ b/gin/isolate_holder.cc
|
|
@@ -103,9 +103,10 @@ IsolateHolder::~IsolateHolder() {
|
|
// static
|
|
void IsolateHolder::Initialize(ScriptMode mode,
|
|
v8::ArrayBuffer::Allocator* allocator,
|
|
- const intptr_t* reference_table) {
|
|
+ const intptr_t* reference_table,
|
|
+ bool create_v8_platform) {
|
|
CHECK(allocator);
|
|
- V8Initializer::Initialize(mode);
|
|
+ V8Initializer::Initialize(mode, create_v8_platform);
|
|
g_array_buffer_allocator = allocator;
|
|
g_reference_table = reference_table;
|
|
}
|
|
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h
|
|
index f23af2d9738f3aa76e3a49301e1c3216ee4a64b4..ede178acabc63c3c33d6ce93efd5632bec50ba89 100644
|
|
--- a/gin/public/isolate_holder.h
|
|
+++ b/gin/public/isolate_holder.h
|
|
@@ -88,7 +88,8 @@ class GIN_EXPORT IsolateHolder {
|
|
// reference pointers. Otherwise, it can be nullptr.
|
|
static void Initialize(ScriptMode mode,
|
|
v8::ArrayBuffer::Allocator* allocator,
|
|
- const intptr_t* reference_table = nullptr);
|
|
+ const intptr_t* reference_table = nullptr,
|
|
+ bool create_v8_platform = true);
|
|
|
|
v8::Isolate* isolate() { return isolate_; }
|
|
|
|
diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
|
|
index 3a3742ed911cf49b6c93d02763d6eaa9554df62b..c53ea98d3897675c18c1eb8ad37dbce61110fa2e 100644
|
|
--- a/gin/v8_initializer.cc
|
|
+++ b/gin/v8_initializer.cc
|
|
@@ -190,12 +190,14 @@ enum LoadV8FileResult {
|
|
} // namespace
|
|
|
|
// static
|
|
-void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
|
|
+void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
|
|
+ bool create_v8_platform) {
|
|
static bool v8_is_initialized = false;
|
|
if (v8_is_initialized)
|
|
return;
|
|
|
|
- v8::V8::InitializePlatform(V8Platform::Get());
|
|
+ if (create_v8_platform)
|
|
+ v8::V8::InitializePlatform(V8Platform::Get());
|
|
|
|
if (!base::FeatureList::IsEnabled(features::kV8OptimizeJavascript)) {
|
|
// We avoid explicitly passing --opt if kV8OptimizeJavascript is enabled
|
|
diff --git a/gin/v8_initializer.h b/gin/v8_initializer.h
|
|
index 2918c6235688ee4eb7c43387296e6d24145c14aa..069c2c96d5067f0444dac3c6ce6d83f75e770129 100644
|
|
--- a/gin/v8_initializer.h
|
|
+++ b/gin/v8_initializer.h
|
|
@@ -20,7 +20,8 @@ namespace gin {
|
|
class GIN_EXPORT V8Initializer {
|
|
public:
|
|
// This should be called by IsolateHolder::Initialize().
|
|
- static void Initialize(IsolateHolder::ScriptMode mode);
|
|
+ static void Initialize(IsolateHolder::ScriptMode mode,
|
|
+ bool create_v8_platform = true);
|
|
|
|
// Get address and size information for currently loaded snapshot.
|
|
// If no snapshot is loaded, the return values are null for addresses
|