electron/patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch
Electron Bot 005101424a
chore: bump chromium to 92.0.4496.0 (master) (#28907)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2021-05-03 20:13:46 -07:00

49 lines
2 KiB
Diff

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
Subject: add_contentgpuclient_precreatemessageloop_callback.patch
This adds a ContentGpuClient::PreCreateMessageLoop() callback.
Invoke in GpuMain after SetErrorMode, before starting the message loop.
Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
This should be upstreamed.
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
index 7d9019b87c8a016a1393c29d2ecf9966aa8f575c..160522d6bebfd47400733267ff3d60b37fff7f17 100644
--- a/content/gpu/gpu_main.cc
+++ b/content/gpu/gpu_main.cc
@@ -237,6 +237,10 @@ int GpuMain(const MainFunctionParams& parameters) {
// to the GpuProcessHost once the GpuServiceImpl has started.
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
+ auto* client = GetContentClient()->gpu();
+ if (client)
+ client->PreCreateMessageLoop();
+
// We are experiencing what appear to be memory-stomp issues in the GPU
// 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
@@ -374,7 +378,6 @@ int GpuMain(const MainFunctionParams& parameters) {
}
#endif
- auto* client = GetContentClient()->gpu();
if (client)
client->PostIOThreadCreated(gpu_process.io_task_runner());
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
index 864ad090cae17f6a93466f9d2ca52b63341f40da..391848e407f6bfcb7ba8f8a652bb062ebd16e697 100644
--- a/content/public/gpu/content_gpu_client.h
+++ b/content/public/gpu/content_gpu_client.h
@@ -28,6 +28,10 @@ class CONTENT_EXPORT ContentGpuClient {
public:
virtual ~ContentGpuClient() {}
+ // Allows the embedder to perform platform-specific initialization before
+ // creating the message loop.
+ virtual void PreCreateMessageLoop() {}
+
// Called during initialization once the GpuService has been initialized.
virtual void GpuServiceInitialized() {}