electron/patches/v8/add_realloc.patch
Electron Bot 62da00e5c5
chore: bump chromium to 31b4a223e6e2bd9d5ce6c37cbdec6 (master) (#22514)
* 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>
2020-03-11 07:15:07 -04:00

46 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shelley Vohr <shelley.vohr@gmail.com>
Date: Mon, 22 Oct 2018 10:47:11 -0700
Subject: add_realloc.patch
Blink overrides ArrayBuffer's allocator with its own one, while Node simply
uses malloc and free, so we need to use v8's allocator in Node. As part of the
10.6.0 upgrade, we needed to make SerializerDelegate accept an allocator
argument in its constructor, and override ReallocateBufferMemory and
FreeBufferMemory to use the allocator. We cannot simply allocate and then memcpy
when we override ReallocateBufferMemory, so we therefore need to implement
Realloc on the v8 side.
diff --git a/include/v8.h b/include/v8.h
index 96d6cb815c5a733a1f04117781fe88909c4e67bc..b97acc4cd3d3125512b927b201ed83334f556baf 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5003,6 +5003,13 @@ class V8_EXPORT ArrayBuffer : public Object {
*/
virtual void* AllocateUninitialized(size_t length) = 0;
+ /**
+ * Free the memory block of size |length|, pointed to by |data|.
+ * That memory must be previously allocated by |Allocate| and not yet freed
+ * with a call to |Free| or |Realloc|
+ */
+ virtual void* Realloc(void* data, size_t length);
+
/**
* Free the memory block of size |length|, pointed to by |data|.
* That memory is guaranteed to be previously allocated by |Allocate|.
diff --git a/src/api/api.cc b/src/api/api.cc
index 0294e383fe47f4b16e70d84f8afa2f351fb650ab..1a2cd2c1566fab5ec67a23956bcf998e4252f84f 100644
--- a/src/api/api.cc
+++ b/src/api/api.cc
@@ -528,6 +528,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {
i::V8::SetSnapshotBlob(snapshot_blob);
}
+void* v8::ArrayBuffer::Allocator::Realloc(void* data, size_t length) {
+ UNIMPLEMENTED();
+}
+
namespace {
class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {