Files
electron/patches/v8/build_remove_legacy_oom_error_callback.patch
electron-roller[bot] 9e0a3c44dd chore: bump chromium to 105.0.5187.0 (main) (#34921)
* chore: bump chromium in DEPS to 105.0.5179.0

* chore: update patches

* 3758224: Reland^2 "[flags] Enable freezing of flags"

https://chromium-review.googlesource.com/c/v8/v8/+/3758224

* chore: bump chromium in DEPS to 105.0.5181.0

* chore: update patches

* chore: bump chromium in DEPS to 105.0.5183.0

* chore: bump chromium in DEPS to 105.0.5185.0

* chore: bump chromium in DEPS to 105.0.5187.0

* chore: update patches

* 3723298: Pass RemoteFrame mojo channels through its creation messages.

https://chromium-review.googlesource.com/c/chromium/src/+/3723298

* 3737382: [Code Heath] Replace base::{ListValue,DictionaryValue} in skia et al

https://chromium-review.googlesource.com/c/chromium/src/+/3737382

* Pass RemoteFrame mojo channels through its creation messages.

 https://chromium-review.googlesource.com/c/chromium/src/+/3723298

* Changed PrintRenderFrame.PrintWithParams mojo interface to use callback.

https://chromium-review.googlesource.com/c/chromium/src/+/3761203

* 3738183: [CSP] Add support for `DisableWasmEval`

https://chromium-review.googlesource.com/c/chromium/src/+/3738183

* 3740498: Move LinuxUI from //ui/views/linux_ui to //ui/linux

https://chromium-review.googlesource.com/c/chromium/src/+/3740498

* 3558277: Moves subsystem and semantics to enum class

https://chromium-review.googlesource.com/c/chromium/src/+/3558277

* chore: fix broken steps-electron-gn-check

* 3749583: [arm64] Fix undefined symbol linker error

https://chromium-review.googlesource.com/c/v8/v8/+/3749583

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2022-07-20 13:03:34 +02:00

169 lines
7.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: VerteDinde <keeleymhammond@gmail.com>
Date: Tue, 14 Jun 2022 15:12:43 -0700
Subject: build: remove legacy oom error callback
Addresses 3646014: [API] Deprecate LegacyOOMErrorCallback:
https://chromium-review.googlesource.com/c/v8/v8/+/3646014
This deprecation was added to warn embedders that the legacy method
was being replaced. However, Electron does not use the legacy method.
The deprecation causes build issues on Windows, this patch removes
the unused method entirely to avoid those errors.
This patch can be removed in v8 10.6, when legacy_oom_error_callback
is removed.
diff --git a/include/v8-callbacks.h b/include/v8-callbacks.h
index b39921dea0415362d1a30159f3fac0e345e2313e..810fc4edaf69565959148d3c1ec662f0db3e8490 100644
--- a/include/v8-callbacks.h
+++ b/include/v8-callbacks.h
@@ -217,10 +217,6 @@ using AddHistogramSampleCallback = void (*)(void* histogram, int sample);
using FatalErrorCallback = void (*)(const char* location, const char* message);
-using LegacyOOMErrorCallback V8_DEPRECATED(
- "Use OOMErrorCallback (https://crbug.com/1323177)") =
- void (*)(const char* location, bool is_heap_oom);
-
struct OOMDetails {
bool is_heap_oom = false;
const char* detail = nullptr;
diff --git a/include/v8-initialization.h b/include/v8-initialization.h
index 66adf98c17998dd81178e515db01ef43daae14d7..224ae0dc6b34b4724192a1b0547be110f796a9b2 100644
--- a/include/v8-initialization.h
+++ b/include/v8-initialization.h
@@ -284,9 +284,6 @@ class V8_EXPORT V8 {
*/
static void SetFatalMemoryErrorCallback(OOMErrorCallback callback);
- V8_DEPRECATED("Use OOMErrorCallback (https://crbug.com/1323177)")
- static void SetFatalMemoryErrorCallback(LegacyOOMErrorCallback callback);
-
/**
* Get statistics about the shared memory usage.
*/
diff --git a/include/v8-isolate.h b/include/v8-isolate.h
index b54c7388603b4582356f6741c9a36f2835aa1928..b9533b78046228705e2038396eebf23b1d663df1 100644
--- a/include/v8-isolate.h
+++ b/include/v8-isolate.h
@@ -288,9 +288,6 @@ class V8_EXPORT Isolate {
FatalErrorCallback fatal_error_callback = nullptr;
OOMErrorCallback oom_error_callback = nullptr;
- V8_DEPRECATED("Use oom_error_callback (https://crbug.com/1323177)")
- LegacyOOMErrorCallback legacy_oom_error_callback = nullptr;
-
/**
* The following parameter is experimental and may change significantly.
* This is currently for internal testing.
@@ -1468,10 +1465,6 @@ class V8_EXPORT Isolate {
/** Set the callback to invoke in case of fatal errors. */
void SetFatalErrorHandler(FatalErrorCallback that);
- /** Set the callback to invoke in case of OOM errors (deprecated). */
- V8_DEPRECATED("Use OOMErrorCallback (https://crbug.com/1323177)")
- void SetOOMErrorHandler(LegacyOOMErrorCallback that);
-
/** Set the callback to invoke in case of OOM errors. */
void SetOOMErrorHandler(OOMErrorCallback that);
diff --git a/src/api/api.cc b/src/api/api.cc
index 9fafa6b0089aabf55984b68cff85e353fe50ce52..9472ad8f4f776f98d398113b22a6a710596b3cde 100644
--- a/src/api/api.cc
+++ b/src/api/api.cc
@@ -171,13 +171,6 @@
namespace v8 {
-// Redefine LegacyOOMErrorCallback here for internal usage. We still need to
-// support it but it is deprecated so would trigger warnings.
-// TODO(chromium:1323177): Remove this.
-using DeprecatedLegacyOOMErrorCallback = void (*)(const char* location,
- bool is_heap_oom);
-
-static DeprecatedLegacyOOMErrorCallback g_legacy_oom_error_callback = nullptr;
static OOMErrorCallback g_oom_error_callback = nullptr;
static ScriptOrigin GetScriptOriginForScript(i::Isolate* i_isolate,
@@ -235,9 +228,6 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* i_isolate, const char* location,
// Give the embedder a chance to handle the condition. If it doesn't,
// just crash.
if (g_oom_error_callback) g_oom_error_callback(location, details);
- if (g_legacy_oom_error_callback) {
- g_legacy_oom_error_callback(location, details.is_heap_oom);
- }
FATAL("Fatal process out of memory: %s", location);
UNREACHABLE();
}
@@ -313,9 +303,6 @@ void i::V8::FatalProcessOutOfMemory(i::Isolate* i_isolate, const char* location,
}
Utils::ReportOOMFailure(i_isolate, location, details);
if (g_oom_error_callback) g_oom_error_callback(location, details);
- if (g_legacy_oom_error_callback) {
- g_legacy_oom_error_callback(location, details.is_heap_oom);
- }
// If the fatal error handler returns, we stop execution.
FATAL("API fatal error handler returned after process out of memory");
}
@@ -347,8 +334,6 @@ void Utils::ReportOOMFailure(i::Isolate* i_isolate, const char* location,
const OOMDetails& details) {
if (auto oom_callback = i_isolate->oom_behavior()) {
oom_callback(location, details);
- } else if (auto legacy_oom_callback = i_isolate->legacy_oom_behavior()) {
- legacy_oom_callback(location, details.is_heap_oom);
} else {
// TODO(wfh): Remove this fallback once Blink is setting OOM handler. See
// crbug.com/614440.
@@ -6175,11 +6160,6 @@ void v8::V8::SetFatalMemoryErrorCallback(
g_oom_error_callback = oom_error_callback;
}
-void v8::V8::SetFatalMemoryErrorCallback(
- v8::LegacyOOMErrorCallback legacy_oom_error_callback) {
- g_legacy_oom_error_callback = legacy_oom_error_callback;
-}
-
void v8::V8::SetEntropySource(EntropySource entropy_source) {
base::RandomNumberGenerator::SetEntropySource(entropy_source);
}
@@ -8702,8 +8682,6 @@ void Isolate::Initialize(Isolate* v8_isolate,
#endif
if (params.oom_error_callback) {
v8_isolate->SetOOMErrorHandler(params.oom_error_callback);
- } else if (params.legacy_oom_error_callback) {
- v8_isolate->SetOOMErrorHandler(params.legacy_oom_error_callback);
}
#if __clang__
#pragma clang diagnostic pop
@@ -9445,8 +9423,6 @@ size_t Isolate::CopyCodePages(size_t capacity, MemoryRange* code_pages_out) {
CALLBACK_SETTER(FatalErrorHandler, FatalErrorCallback, exception_behavior)
CALLBACK_SETTER(OOMErrorHandler, OOMErrorCallback, oom_behavior)
-CALLBACK_SETTER(OOMErrorHandler, DeprecatedLegacyOOMErrorCallback,
- legacy_oom_behavior)
CALLBACK_SETTER(ModifyCodeGenerationFromStringsCallback,
ModifyCodeGenerationFromStringsCallback2,
modify_code_gen_callback2)
diff --git a/src/execution/isolate.h b/src/execution/isolate.h
index 13100146bdc981480a08156b54649b8f995789ae..9a117c4220704ed512b117aa2f50c3791f8e9189 100644
--- a/src/execution/isolate.h
+++ b/src/execution/isolate.h
@@ -487,16 +487,9 @@ V8_EXPORT_PRIVATE void FreeCurrentEmbeddedBlob();
using DebugObjectCache = std::vector<Handle<HeapObject>>;
-// Redefine LegacyOOMErrorCallback here for internal usage. We still need to
-// support it but it is deprecated so would trigger warnings.
-// TODO(chromium:1323177): Remove this.
-using DeprecatedLegacyOOMErrorCallback = void (*)(const char* location,
- bool is_heap_oom);
-
#define ISOLATE_INIT_LIST(V) \
/* Assembler state. */ \
V(FatalErrorCallback, exception_behavior, nullptr) \
- V(DeprecatedLegacyOOMErrorCallback, legacy_oom_behavior, nullptr) \
V(OOMErrorCallback, oom_behavior, nullptr) \
V(LogEventCallback, event_logger, nullptr) \
V(AllowCodeGenerationFromStringsCallback, allow_code_gen_callback, nullptr) \