2019-04-30 16:45:48 +00: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-24 01:14:23 +00:00
|
|
|
Subject: add_contentgpuclient_precreatemessageloop_callback.patch
|
2019-04-30 16:45:48 +00:00
|
|
|
|
2019-08-24 01:14:23 +00:00
|
|
|
This adds a ContentGpuClient::PreCreateMessageLoop() callback.
|
2019-04-30 16:45:48 +00: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-24 01:14:23 +00:00
|
|
|
This should be upstreamed.
|
2019-04-30 16:45:48 +00:00
|
|
|
|
|
|
|
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
|
2020-04-24 01:55:17 +00:00
|
|
|
index 4ba4a1505651f9e63c4476322a12762e46ac9c6b..39e81a63d549c690a040dd463d0300de01abf419 100644
|
2019-04-30 16:45:48 +00:00
|
|
|
--- a/content/gpu/gpu_main.cc
|
|
|
|
+++ b/content/gpu/gpu_main.cc
|
2020-04-24 01:55:17 +00:00
|
|
|
@@ -247,6 +247,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
2020-04-13 23:39:26 +00:00
|
|
|
// to the GpuProcessHost once the GpuServiceImpl has started.
|
|
|
|
viz::GpuServiceImpl::InstallPreInitializeLogHandler();
|
2019-04-30 16:45:48 +00:00
|
|
|
|
|
|
|
+ auto* client = GetContentClient()->gpu();
|
|
|
|
+ if (client)
|
|
|
|
+ client->PreCreateMessageLoop();
|
|
|
|
+
|
|
|
|
// We are experiencing what appear to be memory-stomp issues in the GPU
|
2019-07-03 01:22:09 +00: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
|
2020-04-24 01:55:17 +00:00
|
|
|
@@ -363,7 +367,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
2020-01-31 18:36:00 +00:00
|
|
|
}));
|
2019-07-24 22:58:51 +00:00
|
|
|
#endif
|
2019-04-30 16:45:48 +00:00
|
|
|
|
|
|
|
- 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
|
2020-04-15 00:14:38 +00:00
|
|
|
index 88e80bdaecbdd9000109f638c6d79d8102d0e537..a0c0f17e6642dcd2690c095b95ff2c2de9b6ae4f 100644
|
2019-04-30 16:45:48 +00:00
|
|
|
--- a/content/public/gpu/content_gpu_client.h
|
|
|
|
+++ b/content/public/gpu/content_gpu_client.h
|
2020-04-15 00:14:38 +00:00
|
|
|
@@ -30,6 +30,10 @@ class CONTENT_EXPORT ContentGpuClient {
|
2019-04-30 16:45:48 +00:00
|
|
|
public:
|
|
|
|
virtual ~ContentGpuClient() {}
|
|
|
|
|
|
|
|
+ // Allows the embedder to perform platform-specific initialization before
|
|
|
|
+ // creating the message loop.
|
|
|
|
+ virtual void PreCreateMessageLoop() {}
|
|
|
|
+
|
2019-12-11 00:22:35 +00:00
|
|
|
// Called during initialization once the GpuService has been initialized.
|
|
|
|
virtual void GpuServiceInitialized() {}
|
|
|
|
|