2019-04-30 18:45:48 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Milan Burda <milan.burda@gmail.com>
|
|
|
|
Date: Thu, 11 Apr 2019 14:49:20 +0200
|
2019-08-23 21:14:23 -04:00
|
|
|
Subject: add_contentgpuclient_precreatemessageloop_callback.patch
|
2019-04-30 18:45:48 +02:00
|
|
|
|
2019-08-23 21:14:23 -04:00
|
|
|
This adds a ContentGpuClient::PreCreateMessageLoop() callback.
|
2019-04-30 18:45:48 +02:00
|
|
|
Invoke in GpuMain after SetErrorMode, before starting the message loop.
|
|
|
|
Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
|
|
|
|
|
2019-08-23 21:14:23 -04:00
|
|
|
This should be upstreamed.
|
2019-04-30 18:45:48 +02:00
|
|
|
|
|
|
|
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
2025-07-21 09:32:53 -07:00
|
|
|
index fd375dee71339a4e8bf858fc0b348c852c594a83..bc4786d408af2297ca6acb4489ab81cf8f70c8c3 100644
|
2019-04-30 18:45:48 +02:00
|
|
|
--- a/content/gpu/gpu_main.cc
|
|
|
|
+++ b/content/gpu/gpu_main.cc
|
2025-07-21 09:32:53 -07:00
|
|
|
@@ -269,6 +269,10 @@ int GpuMain(MainFunctionParams parameters) {
|
2020-04-13 16:39:26 -07:00
|
|
|
// to the GpuProcessHost once the GpuServiceImpl has started.
|
2025-06-16 12:46:06 -05:00
|
|
|
viz::GpuLogMessageManager::GetInstance()->InstallPreInitializeLogHandler();
|
2019-04-30 18:45:48 +02:00
|
|
|
|
|
|
|
+ auto* client = GetContentClient()->gpu();
|
|
|
|
+ if (client)
|
|
|
|
+ client->PreCreateMessageLoop();
|
|
|
|
+
|
|
|
|
// We are experiencing what appear to be memory-stomp issues in the GPU
|
2019-07-02 18:22:09 -07:00
|
|
|
// process. These issues seem to be impacting the task executor and listeners
|
|
|
|
// registered to it. Create the task executor on the heap to guard against
|
2025-07-21 09:32:53 -07:00
|
|
|
@@ -378,7 +382,6 @@ int GpuMain(MainFunctionParams parameters) {
|
2024-04-15 18:10:32 -04:00
|
|
|
#endif
|
2022-09-07 09:46:37 +02:00
|
|
|
const bool dead_on_arrival = !init_success;
|
2019-04-30 18:45:48 +02:00
|
|
|
|
|
|
|
- auto* client = GetContentClient()->gpu();
|
2022-09-07 09:46:37 +02:00
|
|
|
if (client) {
|
|
|
|
client->PostSandboxInitialized();
|
|
|
|
}
|
2019-04-30 18:45:48 +02:00
|
|
|
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
|
2025-07-21 09:32:53 -07:00
|
|
|
index e5389b44df98ab1a5c976524a66a26c763e5c436..4a183b4959fae18e6875440e6570b8ada6823d81 100644
|
2019-04-30 18:45:48 +02:00
|
|
|
--- a/content/public/gpu/content_gpu_client.h
|
|
|
|
+++ b/content/public/gpu/content_gpu_client.h
|
2025-07-21 09:32:53 -07:00
|
|
|
@@ -36,6 +36,10 @@ class CONTENT_EXPORT ContentGpuClient {
|
2019-04-30 18:45:48 +02:00
|
|
|
public:
|
|
|
|
virtual ~ContentGpuClient() {}
|
|
|
|
|
|
|
|
+ // Allows the embedder to perform platform-specific initialization before
|
|
|
|
+ // creating the message loop.
|
|
|
|
+ virtual void PreCreateMessageLoop() {}
|
|
|
|
+
|
2019-12-10 16:22:35 -08:00
|
|
|
// Called during initialization once the GpuService has been initialized.
|
|
|
|
virtual void GpuServiceInitialized() {}
|
|
|
|
|