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
|
2019-08-02 23:56:46 +00:00
|
|
|
index 46d92835eadd6429ea0c6a53c5a39ff04f1c2634..1b99a1e601f4226280cdf1382af555b4d61b92fa 100644
|
2019-04-30 16:45:48 +00:00
|
|
|
--- a/content/gpu/gpu_main.cc
|
|
|
|
+++ b/content/gpu/gpu_main.cc
|
2019-08-02 23:56:46 +00:00
|
|
|
@@ -236,6 +236,10 @@ int GpuMain(const MainFunctionParams& parameters) {
|
2019-04-30 16:45:48 +00:00
|
|
|
|
|
|
|
logging::SetLogMessageHandler(GpuProcessLogMessageHandler);
|
|
|
|
|
|
|
|
+ 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
|
2019-08-02 23:56:46 +00:00
|
|
|
@@ -349,7 +353,6 @@ int GpuMain(const MainFunctionParams& parameters) {
|
2019-04-30 16:45:48 +00:00
|
|
|
GpuProcess gpu_process(io_thread_priority);
|
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
|
2019-08-15 20:50:58 +00:00
|
|
|
index 830d5e89af7bd3ddb409ac7bf9d8eb3109830d41..7d544536ec846c294deb6626f51d5de7846fc5c2 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
|
2019-08-15 20:50:58 +00:00
|
|
|
@@ -39,6 +39,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() {}
|
|
|
|
+
|
|
|
|
// Initializes the registry. |registry| will be passed to a ConnectionFilter
|
|
|
|
// (which lives on the IO thread). Unlike other childthreads, the client must
|
|
|
|
// register additional interfaces on this registry rather than just creating
|